Skip to content

Custom filters done. #1869

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 45 commits into
base: osora
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
bbe8be1
Custom filters done.
yoganandaness Jun 2, 2025
ee16c07
chore(deps): bump mathjs from 14.5.0 to 14.5.2
dependabot[bot] Jun 2, 2025
79de497
chore(deps): bump mathjs from 14.5.0 to 14.5.2 (#1871)
github-actions[bot] Jun 2, 2025
6d1bb24
chore(deps): bump the ngrx group across 1 directory with 7 updates
dependabot[bot] Jun 2, 2025
1ebeec4
chore(deps): bump the ngrx group across 1 directory with 7 updates (#…
github-actions[bot] Jun 2, 2025
25d43ef
chore(deps-dev): bump @types/node in the types group
dependabot[bot] Jun 2, 2025
eb12e4f
chore(deps-dev): bump @types/node from 22.15.21 to 22.15.29 in the ty…
github-actions[bot] Jun 2, 2025
fb101ee
chore(deps-dev): bump the eslint group across 1 directory with 9 updates
dependabot[bot] Jun 2, 2025
5f929c4
chore(deps-dev): bump the eslint group across 1 directory with 9 upda…
github-actions[bot] Jun 2, 2025
265e8d2
chore(deps): bump the angular group across 1 directory with 17 updates
dependabot[bot] Jun 2, 2025
8015635
chore(deps): bump the angular group across 1 directory with 17 update…
github-actions[bot] Jun 2, 2025
b1cb348
feat(dataset-detail-dynamic): implementation of compatibility with in…
MatthMig Jun 3, 2025
13f16d5
fix: returnUrl from back end was being discarded (#1807)
GBirkel Jun 4, 2025
6767522
fix(jobs): use updated SDK (#1881)
despadam Jun 4, 2025
f3be1e1
feat: dataset table replacement (#1827)
martin-trajanovski Jun 5, 2025
04f3bcc
chore(deps-dev): bump jasmine from 5.7.1 to 5.8.0
dependabot[bot] Jun 9, 2025
aa84cdb
chore(deps-dev): bump jasmine from 5.7.1 to 5.8.0 (#1888)
github-actions[bot] Jun 9, 2025
3b2ca7e
chore(deps-dev): bump the eslint group across 1 directory with 7 updates
dependabot[bot] Jun 9, 2025
bb65bb2
chore(deps-dev): bump the eslint group across 1 directory with 7 upda…
github-actions[bot] Jun 9, 2025
d623dd1
chore(deps-dev): bump cypress from 14.4.0 to 14.4.1
dependabot[bot] Jun 9, 2025
6e670fd
chore(deps-dev): bump cypress from 14.4.0 to 14.4.1 (#1893)
github-actions[bot] Jun 9, 2025
a995ede
feat(dataset-table): add instrument name column (#1885)
MatthMig Jun 10, 2025
2425709
feat: replace files table with the new dynamic material table (#1838)
martin-trajanovski Jun 11, 2025
fc02550
fix(dynamic-mat-table): small css fix for cursor pointer on row label…
MatthMig Jun 11, 2025
4445978
chore(deps-dev): bump brace-expansion from 1.1.11 to 1.1.12
dependabot[bot] Jun 11, 2025
787bacf
chore(deps-dev): bump brace-expansion from 1.1.11 to 1.1.12 (#1898)
github-actions[bot] Jun 11, 2025
afc7878
chore(deps): bump webpack-dev-server and @angular-devkit/build-angular
dependabot[bot] Jun 11, 2025
abe310b
chore(deps): bump webpack-dev-server and @angular-devkit/build-angula…
github-actions[bot] Jun 12, 2025
372c955
chore(deps-dev): bump the angular group with 2 updates
dependabot[bot] Jun 16, 2025
f134c0b
chore(deps-dev): bump the angular group with 2 updates (#1900)
github-actions[bot] Jun 16, 2025
f0a875e
chore(deps-dev): bump the eslint group with 3 updates
dependabot[bot] Jun 16, 2025
6c488e3
chore(deps-dev): bump the eslint group with 3 updates (#1899)
github-actions[bot] Jun 16, 2025
b3d5255
chore(deps-dev): bump @types/node from 22.15.29 to 24.0.3
dependabot[bot] Jun 16, 2025
46a1f3f
chore(deps-dev): bump @types/node from 22.15.29 to 24.0.3 (#1901)
github-actions[bot] Jun 17, 2025
8c582a2
changed config interface and transformed config service in singleton
nitrosx Jun 17, 2025
3589984
Fixed linting
nitrosx Jun 17, 2025
54376a4
changed config interface and transformed config service in singleton
nitrosx Jun 17, 2025
7469678
Fixed linting
nitrosx Jun 17, 2025
3c7acdd
fixed app config tests
nitrosx Jun 17, 2025
f69f78b
Merge branch 'configuration-singleton' of https://github.com/SciCatPr…
nitrosx Jun 17, 2025
e6d2a94
fixed app config tests
nitrosx Jun 17, 2025
8709e42
fixing linting
nitrosx Jun 18, 2025
d6002dc
fix: singleton config service (#1902)
nitrosx Jun 18, 2025
a30ba33
Frontend wip
yoganandaness Jun 20, 2025
8fe8da9
Merge branch 'master' of github.com:SciCatProject/frontend into SWAP-…
yoganandaness Jun 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CI/e2e/frontend.config.e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"name": "pid",
"order": 1,
"type": "standard",
"enabled": true
"enabled": false
},
{
"name": "datasetName",
Expand Down
4 changes: 2 additions & 2 deletions cypress/e2e/datasets/datasets-datafiles.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe("Dataset datafiles", () => {

cy.isLoading();

cy.contains("mat-row", "Cypress Dataset").first().click();
cy.get("mat-row").contains("Cypress Dataset").first().click();

cy.wait("@fetch");

Expand Down Expand Up @@ -101,7 +101,7 @@ describe("Dataset datafiles", () => {

cy.isLoading();

cy.contains("mat-row", "Cypress Dataset").first().click();
cy.get("mat-row").contains("Cypress Dataset").first().click();

cy.wait("@fetch");

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/datasets/datasets-publish.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("Datasets", () => {

cy.isLoading();

cy.get("[data-cy=checkboxInput]").first().click();
cy.get(".dataset-table input[type='checkbox']").first().click();

cy.get("#addToBatchButton").click();

Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/datasets/datasets-share.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("Datasets", () => {

cy.isLoading();

cy.get("[data-cy=checkboxInput]").first().click();
cy.get(".dataset-table input[type='checkbox']").first().click();

cy.get("#addToBatchButton").click();

Expand Down
1,005 changes: 529 additions & 476 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@ngrx/store": "^19.1.0",
"@ngx-translate/core": "^16.0.4",
"@ngxmc/datetime-picker": "^19.3.1",
"@scicatproject/scicat-sdk-ts-angular": "^4.17.0",
"@scicatproject/scicat-sdk-ts-angular": "^4.17.1",
"autolinker": "^4.0.0",
"deep-equal": "^2.0.5",
"exceljs": "^4.3.0",
Expand Down Expand Up @@ -76,7 +76,7 @@
"@types/jasmine": "^5.1.0",
"@types/lodash-es": "^4.17.12",
"@types/luxon": "^3.3.0",
"@types/node": "^22.0.0",
"@types/node": "^24.0.3",
"@types/shortid": "2.2.0",
"@types/source-map-support": "^0.5.3",
"@typescript-eslint/eslint-plugin": "^8.32.0",
Expand Down
4 changes: 2 additions & 2 deletions src/app/_layout/app-header/app-header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ export class AppHeaderComponent implements OnInit {

login(): void {
if (this.config.skipSciCatLoginPageEnabled) {
const returnURL = encodeURIComponent(this.router.url);
const returnUrl = encodeURIComponent(this.router.url);
for (const endpoint of this.oAuth2Endpoints) {
this.document.location.href = `${this.config.lbBaseURL}/${endpoint.authURL}?returnURL=${returnURL}`;
this.document.location.href = `${this.config.lbBaseURL}/${endpoint.authURL}?returnUrl=${returnUrl}`;
}
} else {
this.router.navigateByUrl("/login");
Expand Down
10 changes: 7 additions & 3 deletions src/app/app-config.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { HttpClient } from "@angular/common/http";
import { TestBed } from "@angular/core/testing";
import { AppConfig, AppConfigService, HelpMessages } from "app-config.service";
import {
AppConfigInterface,
AppConfigService,
HelpMessages,
} from "app-config.service";
import { of } from "rxjs";
import { MockHttp } from "shared/MockStubs";

const appConfig: AppConfig = {
const appConfig: AppConfigInterface = {
skipSciCatLoginPageEnabled: false,
accessTokenPrefix: "",
addDatasetEnabled: true,
Expand Down Expand Up @@ -128,7 +132,7 @@ const appConfig: AppConfig = {
name: "select",
order: 0,
type: "standard",
enabled: true,
enabled: false,
},
{
name: "pid",
Expand Down
10 changes: 6 additions & 4 deletions src/app/app-config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class HelpMessages {
}
}

export interface AppConfig {
export interface AppConfigInterface {
skipSciCatLoginPageEnabled?: boolean;
accessTokenPrefix: string;
addDatasetEnabled: boolean;
Expand Down Expand Up @@ -108,7 +108,9 @@ export interface AppConfig {
dateFormat?: string;
}

@Injectable()
@Injectable({
providedIn: "root",
})
export class AppConfigService {
private appConfig: object = {};

Expand All @@ -132,11 +134,11 @@ export class AppConfigService {
}
}

getConfig(): AppConfig {
getConfig(): AppConfigInterface {
if (!this.appConfig) {
console.error("AppConfigService: Configuration not loaded!");
}

return this.appConfig as AppConfig;
return this.appConfig as AppConfigInterface;
}
}
4 changes: 2 additions & 2 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
selectUserMessage,
} from "state-management/selectors/user.selectors";
import { MessageType } from "state-management/models";
import { AppConfigService, AppConfig as Config } from "app-config.service";
import { AppConfigService, AppConfigInterface } from "app-config.service";
import { Configuration } from "@scicatproject/scicat-sdk-ts-angular";

@Component({
Expand All @@ -36,7 +36,7 @@ import { Configuration } from "@scicatproject/scicat-sdk-ts-angular";
export class AppComponent implements OnDestroy, OnInit, AfterViewChecked {
loading$ = this.store.select(selectIsLoading);

config: Config;
config: AppConfigInterface;

title: string;
facility: string;
Expand Down
38 changes: 9 additions & 29 deletions src/app/datasets/dashboard/dashboard.component.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
<breadcrumb></breadcrumb>
<full-text-search-bar
#searchBar
data-cy="text-search"
[placeholder]="'Text Search'"
>
</full-text-search-bar>
<full-text-search-bar #searchBar data-cy="text-search"
[placeholder]="'Text Search'">
</full-text-search-bar>
<mat-sidenav-container [hasBackdrop]="false">
<mat-sidenav-content>
<div fxLayout="row" fxLayout.xs="column">
<div class="action-column" fxFlex="14" fxFlex.lt-xl="20">
<datasets-filter></datasets-filter>
<ng-template [ngIf]="this.loggedIn$ | async">
<mat-card
*ngIf="appConfig.addDatasetEnabled"
class="add-card"
(click)="openDialog()"
>
<mat-card *ngIf="appConfig.addDatasetEnabled" class="add-card"
(click)="openDialog()">
<mat-card-content>
<mat-icon> add_circle </mat-icon>
Create Dataset
Expand All @@ -31,27 +25,13 @@
<div class="table-column" fxFlex="85" fxFlex.lt-xl="80">
<ng-template [ngIf]="this.loggedIn$ | async">
<dataset-table-actions
[selectedSets]="selectedSets$ | async"
></dataset-table-actions>
[selectedSets]="selectedSets$ | async"></dataset-table-actions>
</ng-template>

<dataset-table
[tableColumns]="tableColumns$ | async"
[selectedSets]="selectedSets$ | async"
(settingsClick)="onSettingsClick()"
<dataset-table [selectedSets]="selectedSets$ | async"
(rowClick)="onRowClick($event)"
(pageChange)="onPageChange($event)"
></dataset-table>
(pageChange)="onPageChange($event)"></dataset-table>
</div>
</div>
</mat-sidenav-content>

<mat-sidenav #settings position="end" mode="push">
<dataset-table-settings
[selectableColumns]="selectableColumns$ | async"
[clearSearchBar]="clearColumnSearch"
(closeClick)="onCloseClick()"
(selectColumn)="onSelectColumn($event)"
></dataset-table-settings>
</mat-sidenav>
</mat-sidenav-container>
</mat-sidenav-container>
122 changes: 1 addition & 121 deletions src/app/datasets/dashboard/dashboard.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,15 @@ import {
addDatasetAction,
changePageAction,
} from "state-management/actions/datasets.actions";
import {
selectColumnAction,
deselectColumnAction,
} from "state-management/actions/user.actions";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { SelectColumnEvent } from "datasets/dataset-table-settings/dataset-table-settings.component";
import { provideMockStore } from "@ngrx/store/testing";
import { selectSelectedDatasets } from "state-management/selectors/datasets.selectors";
import { TableColumn } from "state-management/models";
import {
selectColumns,
selectIsLoggedIn,
} from "state-management/selectors/user.selectors";
import { MatDialog, MatDialogModule } from "@angular/material/dialog";
import { MatSidenav, MatSidenavModule } from "@angular/material/sidenav";
import { MatCheckboxChange } from "@angular/material/checkbox";
import { MatSidenavModule } from "@angular/material/sidenav";
import { MatCardModule } from "@angular/material/card";
import { MatIconModule } from "@angular/material/icon";
import { AppConfigService } from "app-config.service";
Expand Down Expand Up @@ -129,91 +122,6 @@ describe("DashboardComponent", () => {
expect(component).toBeTruthy();
});

describe("#onSettingsClick()", () => {
it("should toggle the sideNav", () => {
const toggleSpy = spyOn(component.sideNav, "toggle");

component.onSettingsClick();

expect(toggleSpy).toHaveBeenCalled();
});

it("should not clear the search column if sidenav is open", () => {
component.sideNav.opened = false;
// The opened status is toggled when onSettingsClick is called
component.onSettingsClick();

expect(component.clearColumnSearch).toEqual(false);
});

it("should clear the search column if sidenav is closed", () => {
component.sideNav.opened = true;
// The opened status is toggled when onSettingsClick is called
component.onSettingsClick();

expect(component.clearColumnSearch).toEqual(true);
});
});

describe("#onCloseClick()", () => {
it("should close the sideNav", () => {
const closeSpy = spyOn(component.sideNav, "close");

component.onCloseClick();

expect(closeSpy).toHaveBeenCalled();
});
});

describe("#onSelectColumn()", () => {
const column: TableColumn = {
name: "test",
order: 0,
type: "standard",
enabled: false,
};

it("should dispatch a selectColumnAction if checkBoxChange.checked is true", () => {
dispatchSpy = spyOn(store, "dispatch");

const checkBoxChange = {
checked: true,
} as MatCheckboxChange;

const event: SelectColumnEvent = {
checkBoxChange,
column,
};

component.onSelectColumn(event);

expect(dispatchSpy).toHaveBeenCalledTimes(1);
expect(dispatchSpy).toHaveBeenCalledWith(
selectColumnAction({ name: column.name, columnType: column.type }),
);
});

it("should dispatch a deselectColumnAction if checkBoxChange.checked is false", () => {
dispatchSpy = spyOn(store, "dispatch");

const checkBoxChange = {
checked: false,
} as MatCheckboxChange;

const event: SelectColumnEvent = {
checkBoxChange,
column,
};

component.onSelectColumn(event);

expect(dispatchSpy).toHaveBeenCalledTimes(1);
expect(dispatchSpy).toHaveBeenCalledWith(
deselectColumnAction({ name: column.name, columnType: column.type }),
);
});
});

describe("#onRowClick()", () => {
it("should navigate to a dataset", () => {
component.onRowClick(dataset);
Expand Down Expand Up @@ -296,32 +204,4 @@ describe("DashboardComponent", () => {
);
});
});

describe("#tableColumn$ observable", () => {
it("should show 'select' column when user is logged in", () => {
const testColumn: TableColumn = {
name: "test",
order: 0,
type: "standard",
enabled: false,
};
const selectColumn: TableColumn = {
name: "select",
order: 1,
type: "standard",
enabled: true,
};
selectColumns.setResult([testColumn, selectColumn]);
selectIsLoggedIn.setResult(true);

component.tableColumns$.subscribe((result) => {
expect(result.length).toEqual(2);
});

selectIsLoggedIn.setResult(false);
component.tableColumns$.subscribe((result) =>
expect(result).toEqual([testColumn]),
);
});
});
});
Loading