diff --git a/CI/e2e/frontend.config.e2e.json b/CI/e2e/frontend.config.e2e.json index afb6fc3f1..7bdad6c8d 100644 --- a/CI/e2e/frontend.config.e2e.json +++ b/CI/e2e/frontend.config.e2e.json @@ -209,7 +209,6 @@ ], "conditions": [] }, - "labelsLocalization": { "datasetDefault": {}, "datasetCustom": { @@ -237,5 +236,217 @@ "Metadata": "Additional Information" } }, - "dateFormat": "yyyy-MM-dd HH:mm" + "dateFormat": "yyyy-MM-dd HH:mm", + "datasetDetailComponent": { + "enableCustomizedComponent": false, + "customization": [ + { + "type": "regular", + "label": "General Information", + "order": 0, + "row": 1, + "col": 8, + "fields": [ + { + "element": "text", + "source": "scientificMetadata.start_time", + "order": 0 + }, + { + "element": "copy", + "source": "scientificMetadata.run_number.value", + "order": 1 + }, + { + "element": "text", + "source": "creationTime", + "order": 2 + }, + { + "element": "text", + "source": "type", + "order": 3 + }, + { + "element": "text", + "source": "datasetName", + "order": 4 + }, + { + "element": "tag", + "source": "keywords", + "order": 5 + } + ] + }, + { + "type": "attachments", + "label": "Gallery", + "order": 1, + "col": 2, + "row": 2, + "options": { + "limit": 5, + "size": "medium" + } + }, + { + "type": "regular", + "label": "Contact Information", + "order": 2, + "col": 2, + "row": 1, + "fields": [ + { + "element": "text", + "source": "principalInvestigator", + "order": 0 + }, + { + "element": "linky", + "source": "contactEmail", + "order": 1 + } + ] + }, + { + "type": "regular", + "label": "Files Information", + "order": 3, + "col": 2, + "row": 1, + "fields": [ + { + "element": "text", + "source": "scientificMetadata.runnumber", + "order": 0 + }, + { + "element": "text", + "source": "sourceFolderHost", + "order": 1 + }, + { + "element": "text", + "source": "numberOfFiles", + "order": 2 + }, + { + "element": "text", + "source": "size", + "order": 3 + }, + { + "element": "text", + "source": "numberOfFilesArchived", + "order": 4 + }, + { + "element": "text", + "source": "packedSize", + "order": 5 + } + ] + }, + { + "type": "regular", + "label": "Related Documents", + "order": 4, + "col": 4, + "row": 1, + "fields": [ + { + "element": "internalLink", + "source": "proposalIds", + "order": 0 + }, + { + "element": "internalLink", + "source": "instrumentIds", + "order": 1 + }, + { + "element": "tag", + "source": "sampleIds", + "order": 2 + }, + { + "element": "tag", + "source": "inputDatasets", + "order": 3 + }, + { + "element": "internalLink", + "source": "creationLocation", + "order": 4 + } + ] + }, + { + "type": "attachments", + "label": "Gallery", + "order": 5, + "col": 1, + "row": 1, + "options": { + "limit": 2, + "size": "small" + } + }, + { + "type": "scientificMetadata", + "label": "Scientific Metadata Table", + "viewMode": "table", + "order": 6, + "col": 9, + "row": 1 + }, + { + "type": "scientificMetadata", + "label": "Scientific Metadata JSON", + "viewMode": "json", + "order": 6 + }, + { + "type": "scientificMetadata", + "label": "Scientific Metadata Tree", + "viewMode": "tree", + "order": 6 + }, + { + "type": "datasetJsonView", + "label": "Dataset Json View", + "order": 7, + "col": 10, + "row": 2 + } + ] + }, + "defaultMainPage": { + "nonAuthenticatedUser": "DATASETS", + "authenticatedUser": "PROPOSALS" + }, + "siteHeaderLogoUrl": "https://my.facility.site", + "mainMenu": { + "nonAuthenticatedUser": { + "datasets": true, + "files": false, + "instruments": true, + "jobs": false, + "policies": false, + "proposals": true, + "publishedData": true, + "samples": false + }, + "authenticatedUser": { + "datasets": true, + "files": true, + "instruments": true, + "jobs": true, + "policies": false, + "proposals": true, + "publishedData": true, + "samples": true + } + } } diff --git a/cypress/e2e/mainPage/main-page.cy.js b/cypress/e2e/mainPage/main-page.cy.js new file mode 100644 index 000000000..ee8705c52 --- /dev/null +++ b/cypress/e2e/mainPage/main-page.cy.js @@ -0,0 +1,98 @@ +import { testData } from "../../fixtures/testData"; + +describe("Main Page", () => { + beforeEach(() => { + cy.login(Cypress.env("username"), Cypress.env("password")); + cy.createDataset( + "raw", + "Main Page Dataset Public", + "20150729", + "small", + true, + ); + cy.createDataset( + "raw", + "Main Page Dataset Non Public", + "20150729", + "small", + false, + ); + }); + + after(() => { + cy.removeDatasets(); + }); + + describe("Main page configuration as non authenticated user", () => { + it("should visit main page correctly configured", () => { + const username = Cypress.env("username"); + + cy.visit("/"); + cy.finishedLoading(); + + cy.get(".user-button").should("contain.text", username).click(); + + cy.get("[data-cy=logout-button]").click(); + + cy.finishedLoading(); + cy.visit("/"); + + cy.finishedLoading(); + + cy.get("breadcrumb > div > span > a").should('contain', "Datasets"); + + cy.get("div.header mat-toolbar.mat-toolbar.mat-elevation-z1.mat-primary.mat-toolbar-single-row a").eq(0).should('have.attr','href','/datasets'); + cy.get("div.header mat-toolbar.mat-toolbar.mat-elevation-z1.mat-primary.mat-toolbar-single-row a").eq(1).should('have.attr','href','https://my.facility.site'); + + cy.get("div.main-menu").click() + + cy.get('button.mat-mdc-menu-item:nth-child(1) > span:nth-child(2) > span:nth-child(1)').should('contain','Datasets') + cy.get('button.mat-mdc-menu-item:nth-child(4) > span:nth-child(2) > span:nth-child(1)').should('contain','Published Data') + + cy.get('[data-cy="login-button"]').should('exist'); + + //cy.get("mat-row").contains("Main Page Dataset Public").click(); + }); + }); + + describe("Main page configuration as authenticated user", () => { + it("should visit main page correctly configured", () => { + const username = Cypress.env("username"); + const password = Cypress.env("password"); + + // cy.visit("/login"); + + // cy.finishedLoading(); + + // cy.url().should("include", "/login"); + + // cy.get('mat-tab-group [role="tab"]').contains("Local").click(); + + // cy.get("#usernameInput").type(username).should("have.value", username); + // cy.get("#passwordInput").type(password).should("have.value", password); + + // cy.get("button[type=submit]").click(); + + cy.visit("/"); + cy.finishedLoading(); + + cy.url().should("include", "/proposals"); + + cy.get("breadcrumb > div > span > a").should('contain', "Proposals"); + + cy.get("div.header mat-toolbar.mat-toolbar.mat-elevation-z1.mat-primary.mat-toolbar-single-row a").eq(0).should('have.attr','href','/proposals'); + cy.get("div.header mat-toolbar.mat-toolbar.mat-elevation-z1.mat-primary.mat-toolbar-single-row a").eq(1).should('have.attr','href','https://my.facility.site'); + + cy.get("div.main-menu").click() + + cy.get('button.mat-mdc-menu-item:nth-child(2) > span:nth-child(2) > span:nth-child(1)').should('contain','Files') + + cy.get("div.main-menu").click() + + cy.get('[data-cy="login-button"]').should('not.exist'); + cy.get('.user-button').should('exist'); + + }); + }); + +}); diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 3c4da2539..46a9ce813 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -113,13 +113,19 @@ Cypress.Commands.add( datasetName = testData.rawDataset.datasetName, proposalId = "20170266", dataFileSize = "small", + isPublished = false, ) => { cy.getCookie("user").then((userCookie) => { const user = JSON.parse(decodeURIComponent(userCookie.value)); cy.getToken().then((token) => { if (type === "raw") { - const dataset = { ...testData.rawDataset, datasetName, proposalId }; + const dataset = { + ...testData.rawDataset, + datasetName, + proposalId, + isPublished, + }; cy.log("Raw Dataset 1: " + JSON.stringify(dataset, null, 2)); cy.log("User: " + JSON.stringify(user, null, 2)); diff --git a/docs/configuration/configuration.md b/docs/configuration/configuration.md new file mode 100644 index 000000000..6b8b9bee9 --- /dev/null +++ b/docs/configuration/configuration.md @@ -0,0 +1,307 @@ +# SciCat Frontend Configuration +SciCat frontend can be configured using a json object containing the entries listed below. +The json configuration object can be provided together with the app or through a URL. +Most of the time it is provided upon request directly from SciCat BE through the endpoint `/admin/config` + +## Configuration Options +- skipSciCatLoginPageEnabled: + - Type: boolean; + - Description: +- accessTokenPrefix: + - Type: string; + - Description: +- addDatasetEnabled: + - Type: boolean; + - Description: +- archiveWorkflowEnabled: + - Type: boolean; + - Description: +- datasetJsonScientificMetadata: + - Type: boolean; + - Description: +- datasetReduceEnabled: + - Type: boolean; + - Description: +- datasetDetailsShowMissingProposalId: + - Type: boolean; + - Description: +- datafilesActionsEnabled: + - Type: boolean; + - Description: +- datafilesActions: + - Type: any[]; + - Description: +- editDatasetEnabled: + - Type: boolean; + - Description: +- editDatasetSampleEnabled: + - Type: boolean; + - Description: +- editMetadataEnabled: + - Type: boolean; + - Description: +- editPublishedData: + - Type: boolean; + - Description: +- addSampleEnabled: + - Type: boolean; + - Description: +- externalAuthEndpoint: + - Type: string | null; + - Description: +- facility: + - Type: string | null; + - Description: +- loginFacilityLabel: + - Type: string | null; + - Description: +- loginLdapLabel: + - Type: string | null; + - Description: +- loginLocalLabel: + - Type: string | null; + - Description: +- loginFacilityEnabled: + - Type: boolean; + - Description: +- loginLdapEnabled: + - Type: boolean; + - Description: +- loginLocalEnabled: + - Type: boolean; + - Description: +- fileColorEnabled: + - Type: boolean; + - Description: +- fileDownloadEnabled: + - Type: boolean; + - Description: +- gettingStarted: + - Type: string | null; + - Description: +- ingestManual: + - Type: string | null; + - Description: +- jobsEnabled: + - Type: boolean; + - Description: +- jsonMetadataEnabled: + - Type: boolean; + - Description: +- jupyterHubUrl: + - Type: string | null; + - Description: +- landingPage: + - Type: string | null; + - Description: +- lbBaseURL: + - Type: string; + - Description: +- localColumns?: + - Type: TableColumn[]; // localColumns is deprecated and should be removed in the future + - Description: +- logbookEnabled: + - Type: boolean; + - Description: +- loginFormEnabled: + - Type: boolean; + - Description: +- maxDirectDownloadSize: + - Type: number | null; + - Description: +- metadataPreviewEnabled: + - Type: boolean; + - Description: +- metadataStructure: + - Type: string; + - Description: +- multipleDownloadAction: + - Type: string | null; + - Description: +- multipleDownloadEnabled: + - Type: boolean; + - Description: +- multipleDownloadUseAuthToken: + - Type: boolean; + - Description: +- oAuth2Endpoints: + - Type: OAuth2Endpoint[]; + - Description: +- policiesEnabled: + - Type: boolean; + - Description: +- retrieveDestinations?: + - Type: RetrieveDestinations[]; + - Description: +- riotBaseUrl: + - Type: string | null; + - Description: +- scienceSearchEnabled: + - Type: boolean; + - Description: +- scienceSearchUnitsEnabled: + - Type: boolean; + - Description: +- searchPublicDataEnabled: + - Type: boolean; + - Description: +- searchSamples: + - Type: boolean; + - Description: +- sftpHost: + - Type: string | null; + - Description: +- sourceFolder?: + - Type: string; + - Description: +- maxFileSizeWarning?: + - Type: string; + - Description: +- shareEnabled: + - Type: boolean; + - Description: +- shoppingCartEnabled: + - Type: boolean; + - Description: +- shoppingCartOnHeader: + - Type: boolean; + - Description: +### siteTitle: + - Type: string | null; + - Description: String shown at the center of the header. If left empty, no string is presented. + - Default: None +### siteSciCatLogo: + - Type: string | null; + - Options: icon, full + - Description: Type of SciCat logo shown in the app header. + If `icon` is selected, the compact logo of SciCat is shown, which is contained in the file `src/assets/images/scicat-header-logo-icon.png`. + If `full` is selected, the full SciCat logo is shown. The full logo is saved in the file `src/assets/images/scicat-header-logo-full.png`. + - Required +### siteHeaderLogo: + - Type: string | null; + - Description: Name of the file with that contains the logo of the facility/lab/company/legal entity that runs the instance of scicat. This shuld be only the name of the file. The path is relative to _`src/assets/images`_. + If SciCat FE is run in a container using the official release image, the file should be mounted in the container under the path just mentioned. + - Example: assets/images/ess-logo-small.png + - Default: None + - Required +### siteHeaderLogoLink: + - Type: string; + - Description: This string will tell which url should be shown when th euser click on the side logo in the header. It can be an in-app path or a full URL. + - Examples: + If we want to show the datasets list when the user click on the site logo, the value should be set to _`/datasets`_. + If we want to link to the main facility web site, the value should be set to the public facing website of the facility: _`https://my.facility.site`_ + - Optional +- siteLoginBackground: + - Type: string | null; + - Description: +- siteLoginLogo: + - Type: string | null; + - Description: +- tableSciDataEnabled: + - Type: boolean; + - Description: +- fileserverBaseURL: + - Type: string; + - Description: +- fileserverButtonLabel: + - Type: string | undefined; + - Description: +- helpMessages?: + - Type: HelpMessages; + - Description: +- notificationInterceptorEnabled: + - Type: boolean; + - Description: +- pidSearchMethod?: + - Type: string; + - Description: +- metadataEditingUnitListDisabled?: + - Type: boolean; + - Description: +- defaultDatasetsListSettings: + - Type: DatasetsListSettings; + - Description: +- labelMaps: + - Type: LabelMaps; + - Description: +- thumbnailFetchLimitPerPage: + - Type: number; + - Description: +- maxFileUploadSizeInMb?: + - Type: string; + - Description: +- datasetDetailComponent?: + - Type: DatasetDetailComponentConfig; + - Description: +- labelsLocalization?: + - Type: LabelsLocalization; + - Description: +- dateFormat?: + - Type: string; + - Description: +### defaultMainPage: + - Type: MainPageConfiguration; + - Definition: + ``` + { + nonAuthenticatedUser: keyof typeof MainPageOptions; + authenticatedUser: keyof typeof MainPageOptions; + } + ``` + - Description: esplicitly configure which is the in-app page that the users are redirected to when visiting the main FE url. As you can see from the structure, sites can define different main pages for authenticated and non-authenticated users. + - Options: DATASETS, PROPOSALS, INSTRUMENTS, SAMPLES (as defined in enum `MainPagesOptions`) + - Default: DATASETS + - Optional +### mainMenu: + - Type: MainMenuConfiguration; + - Definitions: + ``` + MainMenuConfiguration { + nonAuthenticatedUser: MainMenuOptions; + authenticatedUser: MainMenuOptions; + } + + MainMenuOptions { + datasets: boolean; + files: boolean; + instruments: boolean; + jobs: boolean; + policies: boolean; + proposals: boolean; + publishedData: boolean; + samples: boolean; + } + ``` + - Description: + Main menu configuration which controls which menu items are active. There are two configurations, one for authenticated and one for non-auhtenticated users. If not configured, the FE will show a `No menu items configured` element. Each menu item might have additional conditions to be visible. + - Example: + The following example will instruct the FE to show a menu with items datasets, instruments, proposals, and samples to non authenticated users. While for authenticated users, the menu will have all the items enabled, except for policies. + ``` + "mainMenu": { + "nonAuthenticatedUser": { + "datasets": true, + "files": false, + "instruments": true, + "jobs": false, + "policies": false, + "proposals": true, + "publishedData": true, + "samples": false + }, + "authenticatedUser": { + "datasets": true, + "files": true, + "instruments": true, + "jobs": true, + "policies": false, + "proposals": true, + "publishedData": true, + "samples": true + } + } + ``` + - Optional +### supportEmail: + - Type: string; + - Description: + - Optional \ No newline at end of file diff --git a/src/app/_layout/app-header/_app-header-theme.scss b/src/app/_layout/app-header/_app-header-theme.scss index 046d393f3..604d21c03 100644 --- a/src/app/_layout/app-header/_app-header-theme.scss +++ b/src/app/_layout/app-header/_app-header-theme.scss @@ -7,10 +7,11 @@ .header { mat-toolbar { - background-color: mat.m2-get-color-from-palette($primary, "darker"); + background-color: mat.m2-get-color-from-palette($primary, "default-contrast"); + border-bottom: 2px solid mat.m2-get-color-from-palette($primary, "default"); } - a { - color: mat.m2-get-color-from-palette($primary, "default-contrast"); + a, h3, div { + color: mat.m2-get-color-from-palette($primary, "default"); } } } diff --git a/src/app/_layout/app-header/app-header.component.html b/src/app/_layout/app-header/app-header.component.html index c19064f56..57402c029 100644 --- a/src/app/_layout/app-header/app-header.component.html +++ b/src/app/_layout/app-header/app-header.component.html @@ -1,49 +1,73 @@
- - + + + + + - + + + - + + + - - - + + + - - - + + + - + + + - + + + - + + + + + + + + + + + @@ -111,7 +145,7 @@
diff --git a/src/app/_layout/app-header/app-header.component.scss b/src/app/_layout/app-header/app-header.component.scss index 1e4dd4f46..a064ecd30 100644 --- a/src/app/_layout/app-header/app-header.component.scss +++ b/src/app/_layout/app-header/app-header.component.scss @@ -7,7 +7,7 @@ mat-toolbar { height: 3.5rem; - a { + a, .main-menu { height: 2.5rem; padding: 0.5rem; @@ -16,11 +16,20 @@ margin-right: 0.5rem; } } + .main-menu mat-icon { + font-size: 32px; + padding-top: 5px; + cursor: pointer; + } - .spacer { + .spacer, .title { flex: 1 1 auto; } + .title h3 { + text-align: center; + } + .toplink { padding: 0.5rem 1rem; font: bold; diff --git a/src/app/_layout/app-header/app-header.component.ts b/src/app/_layout/app-header/app-header.component.ts index 543e4a6de..570d79351 100644 --- a/src/app/_layout/app-header/app-header.component.ts +++ b/src/app/_layout/app-header/app-header.component.ts @@ -1,5 +1,5 @@ import { DOCUMENT } from "@angular/common"; -import { Component, OnInit, Inject } from "@angular/core"; +import { Component, OnInit, Inject, OnDestroy } from "@angular/core"; import { APP_CONFIG, AppConfig } from "app-config.module"; import { Store } from "@ngrx/store"; import { @@ -12,8 +12,15 @@ import { selectThumbnailPhoto, } from "state-management/selectors/user.selectors"; import { selectDatasetsInBatchIndicator } from "state-management/selectors/datasets.selectors"; -import { AppConfigService, OAuth2Endpoint } from "app-config.service"; +import { + AppConfigService, + MainMenuOptions, + MainPageOptions, + OAuth2Endpoint, +} from "app-config.service"; import { Router } from "@angular/router"; +import { AppState } from "state-management/state/app.store"; +import { Subscription } from "rxjs"; @Component({ selector: "app-app-header", @@ -21,17 +28,30 @@ import { Router } from "@angular/router"; styleUrls: ["./app-header.component.scss"], standalone: false, }) -export class AppHeaderComponent implements OnInit { +export class AppHeaderComponent implements OnInit, OnDestroy { + private sub: Subscription; + config = this.appConfigService.getConfig(); facility = this.config.facility ?? ""; - status = this.appConfig.production ? "" : "test"; + siteTitle = this.config.siteTitle ?? "Vanilla SciCat"; + siteSciCatLogo = + this.config.siteSciCatLogo == "icon" + ? "scicat-header-logo-icon.png" + : "scicat-header-logo-full.png"; siteHeaderLogo = this.config.siteHeaderLogo ?? "site-header-logo.png"; oAuth2Endpoints: OAuth2Endpoint[] = []; username$ = this.store.select(selectCurrentUserName); profileImage$ = this.store.select(selectThumbnailPhoto); inBatchIndicator$ = this.store.select(selectDatasetsInBatchIndicator); - loggedIn$ = this.store.select(selectIsLoggedIn); + //loggedIn$ = this.store.select(selectIsLoggedIn); + isLoggedIn = false; + + mainMenuConfig: MainMenuOptions | null = + this.config.mainMenu?.nonAuthenticatedUser || null; + defaultMainPage: MainPageOptions = MainPageOptions.DATASETS; + siteHeaderLogoUrl = "/datasets"; + isSiteHeaderLogoUrlExternal = false; constructor( public appConfigService: AppConfigService, @@ -59,5 +79,35 @@ export class AppHeaderComponent implements OnInit { ngOnInit() { this.store.dispatch(fetchCurrentUserAction()); this.oAuth2Endpoints = this.config.oAuth2Endpoints; + + this.sub = this.store.select(selectIsLoggedIn).subscribe((isLoggedIn) => { + this.isLoggedIn = isLoggedIn; + if (this.isLoggedIn) { + this.mainMenuConfig = this.config.mainMenu?.authenticatedUser || null; + this.defaultMainPage = + MainPageOptions[ + this.config.defaultMainPage?.authenticatedUser || "DATASETS" + ]; + } else { + this.mainMenuConfig = + this.config.mainMenu?.nonAuthenticatedUser || null; + this.defaultMainPage = + MainPageOptions[ + this.config.defaultMainPage?.nonAuthenticatedUser || "DATASETS" + ]; + } + this.siteHeaderLogoUrl = this.config.siteHeaderLogoUrl + ? this.config.siteHeaderLogoUrl + : this.defaultMainPage; + this.isSiteHeaderLogoUrlExternal = this.isFullUrl(this.siteHeaderLogoUrl); + }); + } + + ngOnDestroy(): void { + this.sub.unsubscribe(); + } + + isFullUrl(url: string): boolean { + return url.startsWith("http://") || url.startsWith("https://"); } } diff --git a/src/app/app-config.service.spec.ts b/src/app/app-config.service.spec.ts index ccc01beea..3ab11c600 100644 --- a/src/app/app-config.service.spec.ts +++ b/src/app/app-config.service.spec.ts @@ -69,6 +69,8 @@ const appConfig: AppConfigInterface = { shareEnabled: true, shoppingCartEnabled: true, shoppingCartOnHeader: true, + siteTitle: "Local Ng Testing", + siteSciCatLogo: "full", tableSciDataEnabled: true, fileserverBaseURL: "", fileserverButtonLabel: "", diff --git a/src/app/app-config.service.ts b/src/app/app-config.service.ts index f363027f8..a31c5e63a 100644 --- a/src/app/app-config.service.ts +++ b/src/app/app-config.service.ts @@ -47,6 +47,22 @@ export class MainPageConfiguration { authenticatedUser: keyof typeof MainPageOptions; } +export class MainMenuOptions { + datasets: boolean; + files: boolean; + instruments: boolean; + jobs: boolean; + policies: boolean; + proposals: boolean; + publishedData: boolean; + samples: boolean; +} + +export class MainMenuConfiguration { + nonAuthenticatedUser: MainMenuOptions; + authenticatedUser: MainMenuOptions; +} + export interface AppConfigInterface { skipSciCatLoginPageEnabled?: boolean; accessTokenPrefix: string; @@ -102,6 +118,8 @@ export interface AppConfigInterface { shareEnabled: boolean; shoppingCartEnabled: boolean; shoppingCartOnHeader: boolean; + siteTitle: string | null; + siteSciCatLogo: string | null; siteHeaderLogo: string | null; siteLoginBackground: string | null; siteLoginLogo: string | null; @@ -120,6 +138,8 @@ export interface AppConfigInterface { labelsLocalization?: LabelsLocalization; dateFormat?: string; defaultMainPage?: MainPageConfiguration; + siteHeaderLogoUrl?: string; + mainMenu?: MainMenuConfiguration; supportEmail?: string; } diff --git a/src/app/datasets/dashboard/full-text-search/full-text-search-bar.component.html b/src/app/datasets/dashboard/full-text-search/full-text-search-bar.component.html index c31289539..8c95a1dc8 100644 --- a/src/app/datasets/dashboard/full-text-search/full-text-search-bar.component.html +++ b/src/app/datasets/dashboard/full-text-search/full-text-search-bar.component.html @@ -13,6 +13,16 @@ />
+ -
diff --git a/src/app/datasets/dashboard/full-text-search/full-text-search-bar.component.scss b/src/app/datasets/dashboard/full-text-search/full-text-search-bar.component.scss index 2404756ed..c01453aeb 100644 --- a/src/app/datasets/dashboard/full-text-search/full-text-search-bar.component.scss +++ b/src/app/datasets/dashboard/full-text-search/full-text-search-bar.component.scss @@ -1,6 +1,6 @@ mat-card { padding: 0.4em; - margin: 1.5em 0.5em 0.5em; + margin: 0.5em 0.5em 0.5em; .search-card-container { display: flex; @@ -20,4 +20,5 @@ mat-card { .full-text-clear-button { margin:0 2px; } + } diff --git a/src/app/datasets/datasets-filter/datasets-filter.component.html b/src/app/datasets/datasets-filter/datasets-filter.component.html index 7886cfd33..3f7d8ba37 100644 --- a/src/app/datasets/datasets-filter/datasets-filter.component.html +++ b/src/app/datasets/datasets-filter/datasets-filter.component.html @@ -41,23 +41,23 @@
diff --git a/src/app/datasets/datasets-filter/datasets-filter.component.spec.ts b/src/app/datasets/datasets-filter/datasets-filter.component.spec.ts index 8aec69bdf..5607bc276 100644 --- a/src/app/datasets/datasets-filter/datasets-filter.component.spec.ts +++ b/src/app/datasets/datasets-filter/datasets-filter.component.spec.ts @@ -186,7 +186,7 @@ describe("DatasetsFilterComponent", () => { it("should contain a clear all button", () => { const compiled = fixture.debugElement.nativeElement; const btn = compiled.querySelector(".datasets-filters-clear-all-button"); - expect(btn.textContent).toContain("undo Reset"); + expect(btn.textContent).toContain("undo Clear"); }); it("should contain a search button", () => { diff --git a/src/app/shared/modules/breadcrumb/breadcrumb.component.scss b/src/app/shared/modules/breadcrumb/breadcrumb.component.scss index 428fc9406..6868502e7 100644 --- a/src/app/shared/modules/breadcrumb/breadcrumb.component.scss +++ b/src/app/shared/modules/breadcrumb/breadcrumb.component.scss @@ -1,11 +1,11 @@ .breadcrumb { - margin: 1rem 0; + margin: 0.1rem 0; padding-left: 1rem; .container { border-top: 1px solid; border-bottom: 1px solid; - padding: 0.3em 0; + padding: 0.1em 0; .active { font-weight: bold; diff --git a/src/app/state-management/selectors/user.selectors.ts b/src/app/state-management/selectors/user.selectors.ts index 4ec3c4702..b32a9e63e 100644 --- a/src/app/state-management/selectors/user.selectors.ts +++ b/src/app/state-management/selectors/user.selectors.ts @@ -40,7 +40,7 @@ export const selectThumbnailPhoto = createSelector(selectProfile, (profile) => { return profile.thumbnailPhoto; } - return "assets/images/user.png"; + return "assets/images/user_main_color.png"; }); export const selectIsAdmin = createSelector( diff --git a/src/assets/config.json b/src/assets/config.json index 2397246a9..42ef255d8 100644 --- a/src/assets/config.json +++ b/src/assets/config.json @@ -12,6 +12,8 @@ "externalAuthEndpoint": "/auth/msad", "facility": "Local", "siteIcon": "site-header-logo.png", + "sitetitle" : "", + "siteSciCatLogo" : "", "loginFacilityLabel": "ESS", "loginLdapLabel": "Ldap", "loginLocalLabel": "Local", @@ -29,7 +31,6 @@ "lbBaseURL": "http://127.0.0.1:3000", "logbookEnabled": true, "loginFormEnabled": true, - "maxDirectDownloadSize": 5000000000, "metadataPreviewEnabled": true, "metadataStructure": "", "multipleDownloadAction": "http://localhost:3012/zip", @@ -49,15 +50,20 @@ "searchSamples": true, "sftpHost": "login.esss.dk", "shareEnabled": true, + "sourceFolder": "/data/ess", + "maxDirectDownloadSize": 5000000000, + "maxFileSizeWarning": "Some files are above and cannot be downloaded directly. These file can be downloaded via sftp host: in directory: ", "shoppingCartEnabled": true, "shoppingCartOnHeader": true, "tableSciDataEnabled": true, "datasetDetailsShowMissingProposalId": false, "notificationInterceptorEnabled": true, + "metadataEditingUnitListDisabled": true, "datafilesActionsEnabled": true, "datafilesActions": [ { "id": "eed8efec-4354-11ef-a3b5-d75573a5d37f", + "description": "This action let users download all files using the zip service", "order": 5, "label": "Download All", "files": "all", @@ -70,6 +76,7 @@ }, { "id": "3072fafc-4363-11ef-b9f9-ebf568222d26", + "description": "This action let users download selected files using the zip service", "order": 4, "label": "Download Selected", "files": "selected", @@ -82,6 +89,7 @@ }, { "id": "4f974f0e-4364-11ef-9c63-03d19f813f4e", + "description": "This action let users download jupyter notebook properly populated with dataset pid and all files using an instance of sciwyrm", "order": 2, "label": "Notebook All (Form)", "files": "all", @@ -93,6 +101,7 @@ }, { "id": "0cd5b592-0b1a-11f0-a42c-23e177127ee7", + "description": "This action let users download jupyter notebook properly populated with dataset pid and selected files using an instance of sciwyrm", "order": 3, "label": "Notebook All (Download JSON)", "files": "all", @@ -221,37 +230,244 @@ "conditions": [] }, "labelsLocalization": { - "currentLabelSet": "ess", - "labelSets": { - "ess": { - "dataset-default": {}, - "dataset-custom": { - "pid": "PID", - "description": "Description", - "principalInvestigator": "Principal Investigator", - "keywords": "Keywords", - "creationTime": "Creation Time", - "scientificMetadata": "Scientific Metadata", - "metadataJsonView": "Metadata JsonView" - }, - "proposal": { - "General Information": "Proposal Information", - "Abstract": "Abstract", - "Proposal Id": "Proposal Id", - "Proposal Type": "Proposal Type", - "Parent Proposal": "Parent Proposal", - "Start Time": "Start Time", - "End Time": "End Time", - "Creator Information": "People", - "Main Proposer": "Proposal Submitted By", - "Principal Investigator": "Principal Investigator", - "Metadata": "Additional Information" + "datasetDefault": {}, + "datasetCustom": { + "pid": "PID", + "description": "Description", + "principalInvestigator": "Principal Investigator", + "keywords": "Keywords", + "creationTime": "Creation Time", + "scientificMetadata": "Scientific Metadata", + "metadataJsonView": "Metadata Json View", + "datasetName": "Dataset Name", + "scientificMetadata.run_number.value": "Run Number", + "scientificMetadata.start_time": "Start Time" + }, + "proposalDefault": { + "General Information": "Proposal Information", + "Title": "Proposal Title", + "Abstract": "Abstract", + "Proposal Id": "Proposal Id", + "Proposal Type": "Proposal Type", + "Parent Proposal": "Parent Proposal", + "Start Time": "Start Time", + "End Time": "End Time", + "Creator Information": "People", + "Main Proposer": "Proposal Submitted By", + "Principal Investigator": "Principal Investigator", + "Metadata": "Additional Information" + } + }, + "dateFormat": "yyyy-MM-dd HH:mm", + "datasetDetailComponent": { + "enableCustomizedComponent": false, + "customization": [ + { + "type": "regular", + "label": "General Information", + "order": 0, + "row": 1, + "col": 8, + "fields": [ + { + "element": "text", + "source": "scientificMetadata.start_time", + "order": 0 + }, + { + "element": "copy", + "source": "scientificMetadata.run_number.value", + "order": 1 + }, + { + "element": "text", + "source": "creationTime", + "order": 2 + }, + { + "element": "text", + "source": "type", + "order": 3 + }, + { + "element": "text", + "source": "datasetName", + "order": 4 + }, + { + "element": "tag", + "source": "keywords", + "order": 5 + } + ] + }, + { + "type": "attachments", + "label": "Gallery", + "order": 1, + "col": 2, + "row": 2, + "options": { + "limit": 5, + "size": "medium" } + }, + { + "type": "regular", + "label": "Contact Information", + "order": 2, + "col": 2, + "row": 1, + "fields": [ + { + "element": "text", + "source": "principalInvestigator", + "order": 0 + }, + { + "element": "linky", + "source": "contactEmail", + "order": 1 + } + ] + }, + { + "type": "regular", + "label": "Files Information", + "order": 3, + "col": 2, + "row": 1, + "fields": [ + { + "element": "text", + "source": "scientificMetadata.runnumber", + "order": 0 + }, + { + "element": "text", + "source": "sourceFolderHost", + "order": 1 + }, + { + "element": "text", + "source": "numberOfFiles", + "order": 2 + }, + { + "element": "text", + "source": "size", + "order": 3 + }, + { + "element": "text", + "source": "numberOfFilesArchived", + "order": 4 + }, + { + "element": "text", + "source": "packedSize", + "order": 5 + } + ] + }, + { + "type": "regular", + "label": "Related Documents", + "order": 4, + "col": 4, + "row": 1, + "fields": [ + { + "element": "internalLink", + "source": "proposalIds", + "order": 0 + }, + { + "element": "internalLink", + "source": "instrumentIds", + "order": 1 + }, + { + "element": "tag", + "source": "sampleIds", + "order": 2 + }, + { + "element": "tag", + "source": "inputDatasets", + "order": 3 + }, + { + "element": "internalLink", + "source": "creationLocation", + "order": 4 + } + ] + }, + { + "type": "attachments", + "label": "Gallery", + "order": 5, + "col": 1, + "row": 1, + "options": { + "limit": 2, + "size": "small" + } + }, + { + "type": "scientificMetadata", + "label": "Scientific Metadata Table", + "viewMode": "table", + "order": 6, + "col": 9, + "row": 1 + }, + { + "type": "scientificMetadata", + "label": "Scientific Metadata JSON", + "viewMode": "json", + "order": 6 + }, + { + "type": "scientificMetadata", + "label": "Scientific Metadata Tree", + "viewMode": "tree", + "order": 6 + }, + { + "type": "datasetJsonView", + "label": "Dataset Json View", + "order": 7, + "col": 10, + "row": 2 } - } + ] }, "defaultMainPage": { "nonAuthenticatedUser": "DATASETS", "authenticatedUser": "DATASETS" + }, + "mainMenu": { + "nonAuthenticatedUser": { + "datasets": true, + "files": false, + "instruments": true, + "jobs": false, + "policies": false, + "proposals": true, + "publishedData": true, + "samples": false + }, + "authenticatedUser": { + "datasets": true, + "files": true, + "instruments": true, + "jobs": true, + "policies": false, + "proposals": true, + "publishedData": true, + "samples": true + } } } diff --git a/src/assets/images/scicat-header-logo.png b/src/assets/images/scicat-header-logo-full.png similarity index 100% rename from src/assets/images/scicat-header-logo.png rename to src/assets/images/scicat-header-logo-full.png diff --git a/src/assets/images/scicat-header-logo-icon.png b/src/assets/images/scicat-header-logo-icon.png new file mode 100644 index 000000000..a86129237 Binary files /dev/null and b/src/assets/images/scicat-header-logo-icon.png differ diff --git a/src/assets/images/user_main_color.png b/src/assets/images/user_main_color.png new file mode 100644 index 000000000..b4ebb1781 Binary files /dev/null and b/src/assets/images/user_main_color.png differ