diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 41022495..e913a646 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,9 +48,12 @@ jobs: - name: Install dependencies run: npm i - - name: Run docker-build + - name: Run docker-build for datahub run: npx nx docker-build mel-datahub + - name: Run docker-build for home + run: npx nx docker-build home + - uses: docker/login-action@v1 name: Login to GitHub Container Registry with: @@ -58,10 +61,11 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: 'Pushing the image onto ghcr.io' + - name: 'Pushing the images onto ghcr.io' if: github.ref == 'refs/heads/main' run: | - docker push ghcr.io/camptocamp/mel-dataplatform/datahub:latest + docker push ghcr.io/camptocamp/mel-dataplatform/catalogue:latest + docker push ghcr.io/camptocamp/mel-dataplatform/accueil:latest cypress-run: name: End-to-end tests @@ -86,9 +90,12 @@ jobs: - name: Install dependencies run: npm i - - name: Run tests + - name: Run tests for datahub run: npx nx e2e mel-datahub-e2e + - name: Run tests for home + run: npx nx e2e home-e2e + agents: name: Nx Cloud - Agents uses: nrwl/ci/.github/workflows/nx-cloud-agents.yml@v0.13.1 diff --git a/apps/datahub/project.json b/apps/datahub/project.json index ae6ed703..884fef24 100644 --- a/apps/datahub/project.json +++ b/apps/datahub/project.json @@ -15,8 +15,15 @@ "browser": "apps/datahub/src/main.ts", "polyfills": ["zone.js"], "tsConfig": "apps/datahub/tsconfig.app.json", - "assets": ["apps/datahub/src/favicon.ico", "apps/datahub/src/assets"], - "styles": ["apps/datahub/src/styles.css"], + "assets": [ + "apps/datahub/src/favicon.ico", + { + "glob": "**/*", + "input": "resources/assets", + "output": "./assets" + } + ], + "styles": ["resources/styles.css"], "scripts": [], "preserveSymlinks": true, "allowedCommonJsDependencies": [ @@ -99,7 +106,7 @@ "options": { "commands": [ "nx build mel-datahub --base-href='/catalogue/'", - "docker build --build-arg APP_NAME=catalogue -f ./tools/docker/Dockerfile . -t ghcr.io/camptocamp/mel-dataplatform/datahub:latest" + "docker build --build-arg APP_NAME=catalogue -f ./tools/docker/Dockerfile . -t ghcr.io/camptocamp/mel-dataplatform/catalogue:latest" ], "parallel": false } diff --git a/apps/datahub/src/app/app.module.ts b/apps/datahub/src/app/app.module.ts index 88f142df..486566ae 100644 --- a/apps/datahub/src/app/app.module.ts +++ b/apps/datahub/src/app/app.module.ts @@ -13,7 +13,6 @@ import { LOGIN_URL, provideGn4, provideRepositoryUrl, - RouterService, ThemeService, TRANSLATE_DEFAULT_CONFIG, UiElementsModule, @@ -37,32 +36,12 @@ import { DatasetPageComponent } from './dataset/dataset-page/dataset-page.compon import { SearchHeaderComponent } from './search/search-header/search-header.component' import { BrowserAnimationsModule } from '@angular/platform-browser/animations' import { SearchResultsComponent } from './search/search-results/search-results.component' -import { HomePageComponent } from './home/home-page/home-page.component' -import { AppRouterService } from './app.router.service' -import { HomeHeaderComponent } from './home/home-header/home-header.component' import { MatIconModule } from '@angular/material/icon' -import { MelEmbeddedTranslateLoader } from './common/embedded.translate.loader' -import { ResultsListComponent } from './common/results-list/results-list.component' -import { ResultsListItemComponent } from './common/results-list-item/results-list-item.component' -import { ResultsListCarouselComponent } from './common/results-list/results-list-carousel/results-list-carousel.component' -import { ResultsListGridComponent } from './common/results-list/results-list-grid/results-list-grid.component' -import { ResultsCardFavoriteComponent } from './common/results-list-item/results-card-favorite/results-card-favorite.component' -import { ResultsCardLastCreatedComponent } from './common/results-list-item/results-card-last-created/results-card-last-created.component' -import { ResultsCardSearchComponent } from './common/results-list-item/results-card-search/results-card-search.component' import { MatTabsModule } from '@angular/material/tabs' import { DatasetApisComponent } from './dataset/dataset-apis/dataset-apis.component' -import { MelDatahubMetadataQualityComponent } from './common/metadata-quality/mel-datahub-metadata-quality.component' import { DatasetHeaderComponent } from './dataset/dataset-header/dataset-header.component' -import { ButtonComponent } from './common/button/button.component' import { DatasetDownloadsComponent } from './dataset/dataset-downloads/dataset-downloads.component' -import { FavoriteHeartComponent } from './common/favorites/favorite-heart/favorite-heart.component' -import { HeartToggleComponent } from './common/favorites/heart-toggle/heart-toggle.component' -import { TextExpandComponent } from './common/text-expand/text-expand.component' -import { MelDatahubFooterComponent } from './common/footer/mel-datahub-footer.component' -import { CustomCarouselComponent } from './common/custom-carousel/custom-carousel.component' import { DatasetInformationComponent } from './dataset/dataset-information/dataset-information.component' -import { MelFuzzySearchComponent } from './common/fuzzy-search/fuzzy-search.component' -import { MelAutocompleteComponent } from './common/autocomplete/autocomplete.component' import { ReactiveFormsModule } from '@angular/forms' import { MatAutocompleteModule } from '@angular/material/autocomplete' import { SearchFormComponent } from './search/search-form/search-form.component' @@ -80,7 +59,7 @@ import { DatasetVisualisationComponent } from './dataset/dataset-visualisation/d import { MelMapViewComponent } from './dataset/dataset-visualisation/map-view/map-view.component' import { MelDataViewComponent } from './dataset/dataset-visualisation/data-view/data-view.component' import { environment } from '../environments/environnment' -import { StripHtmlPipe } from './common/strip-html.pipe' +import { MelModule, MelEmbeddedTranslateLoader } from '@mel-dataplatform/mel' @NgModule({ declarations: [ @@ -88,29 +67,11 @@ import { StripHtmlPipe } from './common/strip-html.pipe' SearchPageComponent, SearchHeaderComponent, SearchResultsComponent, - HomePageComponent, - HomeHeaderComponent, - ResultsListComponent, - ResultsListCarouselComponent, - ResultsListGridComponent, - ResultsListItemComponent, - ResultsCardFavoriteComponent, - ResultsCardLastCreatedComponent, - ResultsCardSearchComponent, DatasetPageComponent, DatasetApisComponent, - MelDatahubMetadataQualityComponent, DatasetHeaderComponent, - ButtonComponent, DatasetDownloadsComponent, - FavoriteHeartComponent, - HeartToggleComponent, - TextExpandComponent, - MelDatahubFooterComponent, - CustomCarouselComponent, DatasetInformationComponent, - MelFuzzySearchComponent, - MelAutocompleteComponent, SearchFormComponent, SearchFiltersComponent, MelFilterDropdownComponent, @@ -122,9 +83,9 @@ import { StripHtmlPipe } from './common/strip-html.pipe' DatasetVisualisationComponent, MelMapViewComponent, MelDataViewComponent, - StripHtmlPipe, ], imports: [ + MelModule, BrowserModule, BrowserAnimationsModule, UiWidgetsModule, @@ -186,7 +147,6 @@ import { StripHtmlPipe } from './common/strip-html.pipe' provide: LOGIN_URL, useFactory: () => '${current_url}?login', }, - { provide: RouterService, useClass: AppRouterService }, ], bootstrap: [AppComponent], }) diff --git a/apps/datahub/src/app/app.router.service.ts b/apps/datahub/src/app/app.router.service.ts deleted file mode 100644 index b372bc4e..00000000 --- a/apps/datahub/src/app/app.router.service.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { Injectable } from '@angular/core' -import { Routes } from '@angular/router' -import { RouterService } from 'geonetwork-ui' -import { HomePageComponent } from './home/home-page/home-page.component' - -@Injectable() -export class AppRouterService extends RouterService { - override buildRoutes(): Routes { - const routes = super.buildRoutes() - const routesWithoutRoot = routes.filter((route) => route.path !== '') - return [ - ...routesWithoutRoot, - { - path: '', - component: HomePageComponent, - data: { - shouldDetach: true, - }, - }, - { path: '**', redirectTo: '', pathMatch: 'full' }, - ] - } -} diff --git a/apps/datahub/tsconfig.editor.json b/apps/datahub/tsconfig.editor.json index 8ae117d9..8f6f4a8f 100644 --- a/apps/datahub/tsconfig.editor.json +++ b/apps/datahub/tsconfig.editor.json @@ -1,6 +1,6 @@ { "extends": "./tsconfig.json", - "include": ["src/**/*.ts"], + "include": ["src/**/*.ts", "../../libs/mel/src/lib/strip-html.pipe.ts"], "compilerOptions": { "types": ["jest", "node"] } diff --git a/apps/home-e2e/.eslintrc.json b/apps/home-e2e/.eslintrc.json new file mode 100644 index 00000000..696cb8b1 --- /dev/null +++ b/apps/home-e2e/.eslintrc.json @@ -0,0 +1,10 @@ +{ + "extends": ["plugin:cypress/recommended", "../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/apps/home-e2e/cypress.config.ts b/apps/home-e2e/cypress.config.ts new file mode 100644 index 00000000..2f427118 --- /dev/null +++ b/apps/home-e2e/cypress.config.ts @@ -0,0 +1,10 @@ +import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset' + +import { defineConfig } from 'cypress' + +export default defineConfig({ + e2e: { + ...nxE2EPreset(__filename, { cypressDir: 'src' }), + baseUrl: 'http://localhost:4200', + }, +}) diff --git a/apps/home-e2e/project.json b/apps/home-e2e/project.json new file mode 100644 index 00000000..354b26b1 --- /dev/null +++ b/apps/home-e2e/project.json @@ -0,0 +1,30 @@ +{ + "name": "home-e2e", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "projectType": "application", + "sourceRoot": "apps/home-e2e/src", + "targets": { + "e2e": { + "executor": "@nx/cypress:cypress", + "options": { + "cypressConfig": "apps/home-e2e/cypress.config.ts", + "testingType": "e2e", + "devServerTarget": "home:serve:development" + }, + "configurations": { + "production": { + "devServerTarget": "home:serve:production" + }, + "ci": { + "devServerTarget": "home:serve-static" + } + } + }, + "lint": { + "executor": "@nx/eslint:lint", + "outputs": ["{options.outputFile}"] + } + }, + "tags": [], + "implicitDependencies": ["home"] +} diff --git a/apps/datahub-e2e/src/e2e/home.cy.ts b/apps/home-e2e/src/e2e/home.cy.ts similarity index 84% rename from apps/datahub-e2e/src/e2e/home.cy.ts rename to apps/home-e2e/src/e2e/home.cy.ts index 240ebc6f..19b92d43 100644 --- a/apps/datahub-e2e/src/e2e/home.cy.ts +++ b/apps/home-e2e/src/e2e/home.cy.ts @@ -9,10 +9,9 @@ describe('home', () => { cy.get('mel-datahub-fuzzy-search').should('be.visible') cy.get('mel-datahub-autocomplete').should('have.length.gt', 0) }) - it('should navigate to search and display results when executing a search', () => { + it('should create correct url to navigate to search', () => { cy.get('mel-datahub-fuzzy-search').type('test{enter}') - cy.url().should('include', 'search') - cy.get('mel-datahub-results-card-search').should('have.length.gt', 0) + cy.url().should('include', 'catalogue/search?q=test') }) }) @@ -53,10 +52,16 @@ describe('home', () => { .first() .as('firstResult') }) - it('should open the dataset page in the same application on click', () => { + it('should create correct url to open the dataset page in the same application on click', () => { cy.get('@firstResult').click() - cy.url().should('include', 'dataset') - cy.get('mel-datahub-dataset-page').should('be.visible') + cy.url().should( + 'include', + 'catalogue/dataset/9e1ea778-d0ce-4b49-90b7-37bc0e448300' + ) + }) + it('should create correct url to navigate to search on keyword click', () => { + cy.get('@firstResult').find('.mel-badge-button-primary').first().click() + cy.url().should('include', 'catalogue/search?q=administration') }) }) }) diff --git a/apps/home-e2e/src/fixtures/example.json b/apps/home-e2e/src/fixtures/example.json new file mode 100644 index 00000000..02e42543 --- /dev/null +++ b/apps/home-e2e/src/fixtures/example.json @@ -0,0 +1,5 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io", + "body": "Fixtures are a great way to mock data for responses to routes" +} diff --git a/apps/home-e2e/src/support/app.po.ts b/apps/home-e2e/src/support/app.po.ts new file mode 100644 index 00000000..00f556e1 --- /dev/null +++ b/apps/home-e2e/src/support/app.po.ts @@ -0,0 +1 @@ +export const getGreeting = () => cy.get('h1') diff --git a/apps/home-e2e/src/support/commands.ts b/apps/home-e2e/src/support/commands.ts new file mode 100644 index 00000000..7fbd07ee --- /dev/null +++ b/apps/home-e2e/src/support/commands.ts @@ -0,0 +1,35 @@ +/// + +// *********************************************** +// This example commands.ts shows you how to +// create various custom commands and overwrite +// existing commands. +// +// For more comprehensive examples of custom +// commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** + +// eslint-disable-next-line @typescript-eslint/no-namespace +declare namespace Cypress { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + interface Chainable { + login(email: string, password: string): void + } +} + +// -- This is a parent command -- +Cypress.Commands.add('login', (email, password) => { + console.log('Custom command example: Login', email, password) +}) +// +// -- This is a child command -- +// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) +// +// +// -- This is a dual command -- +// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) +// +// +// -- This will overwrite an existing command -- +// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) diff --git a/apps/home-e2e/src/support/e2e.ts b/apps/home-e2e/src/support/e2e.ts new file mode 100644 index 00000000..a00021c4 --- /dev/null +++ b/apps/home-e2e/src/support/e2e.ts @@ -0,0 +1,17 @@ +// *********************************************************** +// This example support/e2e.ts is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.ts using ES2015 syntax: +import './commands' diff --git a/apps/home-e2e/tsconfig.json b/apps/home-e2e/tsconfig.json new file mode 100644 index 00000000..2a012dc1 --- /dev/null +++ b/apps/home-e2e/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + "allowJs": true, + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "types": ["cypress", "node"], + "sourceMap": false, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "include": [ + "**/*.ts", + "**/*.js", + "cypress.config.ts", + "**/*.cy.ts", + "**/*.cy.js", + "**/*.d.ts" + ] +} diff --git a/apps/home/.eslintrc.json b/apps/home/.eslintrc.json new file mode 100644 index 00000000..b383f7ed --- /dev/null +++ b/apps/home/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "extends": [ + "plugin:@nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "melDataplatform", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "mel-datahub", + "style": "kebab-case" + } + ] + } + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/apps/home/jest.config.ts b/apps/home/jest.config.ts new file mode 100644 index 00000000..9dc3f5bd --- /dev/null +++ b/apps/home/jest.config.ts @@ -0,0 +1,22 @@ +/* eslint-disable */ +export default { + displayName: 'home', + preset: '../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: '../../coverage/apps/home', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/tsconfig.spec.json', + stringifyContentPathRegex: '\\.(html|svg)$', + }, + ], + }, + transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], + snapshotSerializers: [ + 'jest-preset-angular/build/serializers/no-ng-attributes', + 'jest-preset-angular/build/serializers/ng-snapshot', + 'jest-preset-angular/build/serializers/html-comment', + ], +} diff --git a/apps/home/project.json b/apps/home/project.json new file mode 100644 index 00000000..0d96ec13 --- /dev/null +++ b/apps/home/project.json @@ -0,0 +1,115 @@ +{ + "name": "home", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "projectType": "application", + "prefix": "mel-datahub", + "sourceRoot": "apps/home/src", + "tags": [], + "targets": { + "build": { + "executor": "@angular-devkit/build-angular:application", + "outputs": ["{options.outputPath}"], + "options": { + "outputPath": "dist/apps/home", + "index": "apps/home/src/index.html", + "browser": "apps/home/src/main.ts", + "polyfills": ["zone.js"], + "tsConfig": "apps/home/tsconfig.app.json", + "assets": [ + "apps/home/src/favicon.ico", + { + "glob": "**/*", + "input": "resources/assets", + "output": "./assets" + } + ], + "styles": ["resources/styles.css"], + "scripts": [], + "preserveSymlinks": true, + "allowedCommonJsDependencies": [ + "duration-relativetimeformat", + "papaparse", + "xlsx", + "chroma-js", + "@rgrove/parse-xml", + "@messageformat/core", + "rbush", + "@camptocamp/ogc-client", + "pbf", + "alasql", + "moment" + ] + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "initial", + "maximumWarning": "2Mb", + "maximumError": "4mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "2kb", + "maximumError": "4kb" + } + ], + "outputHashing": "all" + }, + "development": { + "optimization": false, + "extractLicenses": false, + "sourceMap": true + } + }, + "defaultConfiguration": "production" + }, + "serve": { + "executor": "@angular-devkit/build-angular:dev-server", + "configurations": { + "production": { + "buildTarget": "home:build:production" + }, + "development": { + "buildTarget": "home:build:development", + "proxyConfig": "proxy-config.js" + } + }, + "defaultConfiguration": "development" + }, + "extract-i18n": { + "executor": "@angular-devkit/build-angular:extract-i18n", + "options": { + "buildTarget": "home:build" + } + }, + "lint": { + "executor": "@nx/eslint:lint", + "outputs": ["{options.outputFile}"] + }, + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "apps/home/jest.config.ts" + } + }, + "serve-static": { + "executor": "@nx/web:file-server", + "options": { + "buildTarget": "home:build", + "staticFilePath": "dist/apps/home/browser" + } + }, + "docker-build": { + "executor": "nx:run-commands", + "options": { + "commands": [ + "nx build home --base-href='/accueil/'", + "docker build --build-arg APP_NAME=accueil -f ./tools/docker/Dockerfile . -t ghcr.io/camptocamp/mel-dataplatform/accueil:latest" + ], + "parallel": false + } + } + } +} diff --git a/apps/datahub/src/assets/.gitkeep b/apps/home/src/app/app.component.css similarity index 100% rename from apps/datahub/src/assets/.gitkeep rename to apps/home/src/app/app.component.css diff --git a/apps/home/src/app/app.component.html b/apps/home/src/app/app.component.html new file mode 100644 index 00000000..2df188fa --- /dev/null +++ b/apps/home/src/app/app.component.html @@ -0,0 +1,6 @@ +
+
+ +
+ +
diff --git a/apps/home/src/app/app.component.ts b/apps/home/src/app/app.component.ts new file mode 100644 index 00000000..6068ddb0 --- /dev/null +++ b/apps/home/src/app/app.component.ts @@ -0,0 +1,10 @@ +import { Component } from '@angular/core' + +@Component({ + selector: 'mel-datahub-home-root', + templateUrl: './app.component.html', + styleUrl: './app.component.css', +}) +export class AppComponent { + title = 'home' +} diff --git a/apps/home/src/app/app.module.ts b/apps/home/src/app/app.module.ts new file mode 100644 index 00000000..f315a276 --- /dev/null +++ b/apps/home/src/app/app.module.ts @@ -0,0 +1,80 @@ +import { importProvidersFrom, isDevMode, NgModule } from '@angular/core' +import { BrowserModule } from '@angular/platform-browser' +import { AppComponent } from './app.component' +import { + FeatureAuthModule, + FeatureCatalogModule, + FeatureSearchModule, + LOGIN_URL, + provideGn4, + provideRepositoryUrl, + ThemeService, + TRANSLATE_DEFAULT_CONFIG, +} from 'geonetwork-ui' +import { + TranslateLoader, + TranslateModule, + TranslateService, +} from '@ngx-translate/core' +import { StoreModule } from '@ngrx/store' +import { EffectsModule } from '@ngrx/effects' +import { StoreDevtoolsModule } from '@ngrx/store-devtools' +import { BrowserAnimationsModule } from '@angular/platform-browser/animations' +import { MelModule, MelEmbeddedTranslateLoader } from '@mel-dataplatform/mel' +import { HomeHeaderComponent } from './home/home-header/home-header.component' +import { HomePageComponent } from './home/home-page/home-page.component' + +@NgModule({ + declarations: [AppComponent, HomeHeaderComponent, HomePageComponent], + imports: [ + MelModule, + BrowserModule, + BrowserAnimationsModule, + FeatureSearchModule, + FeatureCatalogModule, + TranslateModule.forRoot({ + ...TRANSLATE_DEFAULT_CONFIG, + loader: { + provide: TranslateLoader, + useClass: MelEmbeddedTranslateLoader, + }, + }), + StoreModule.forRoot( + {}, + { + metaReducers: [], + runtimeChecks: { + strictActionImmutability: false, + strictStateImmutability: false, + }, + } + ), + EffectsModule.forRoot([]), + StoreDevtoolsModule.instrument({ logOnly: !isDevMode() }), + ], + providers: [ + importProvidersFrom(FeatureAuthModule), + provideGn4(), + provideRepositoryUrl(() => '/geonetwork/srv/api'), + { + provide: LOGIN_URL, + useFactory: () => '${current_url}?login', + }, + ], + bootstrap: [AppComponent], +}) +export class AppModule { + constructor(translate: TranslateService) { + translate.setDefaultLang('fr') + translate.use('fr') + + ThemeService.applyCssVariables( + '#E30513', + '#007A80', + '#212029', + 'white', + 'Lato', + 'Montserrat' + ) + } +} diff --git a/apps/datahub/src/app/home/home-header/home-header.component.html b/apps/home/src/app/home/home-header/home-header.component.html similarity index 88% rename from apps/datahub/src/app/home/home-header/home-header.component.html rename to apps/home/src/app/home/home-header/home-header.component.html index 47dbe395..dee8fd1a 100644 --- a/apps/datahub/src/app/home/home-header/home-header.component.html +++ b/apps/home/src/app/home/home-header/home-header.component.html @@ -6,11 +6,12 @@

-
+
@@ -23,7 +24,7 @@

>

- + + + + + dataMEL + + + + + + + + + + + diff --git a/apps/home/src/main.ts b/apps/home/src/main.ts new file mode 100644 index 00000000..616cf5a0 --- /dev/null +++ b/apps/home/src/main.ts @@ -0,0 +1,6 @@ +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic' +import { AppModule } from './app/app.module' + +platformBrowserDynamic() + .bootstrapModule(AppModule) + .catch((err) => console.error(err)) diff --git a/apps/home/src/test-setup.ts b/apps/home/src/test-setup.ts new file mode 100644 index 00000000..a5e675ac --- /dev/null +++ b/apps/home/src/test-setup.ts @@ -0,0 +1,8 @@ +// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment +globalThis.ngJest = { + testEnvironmentOptions: { + errorOnUnknownElements: true, + errorOnUnknownProperties: true, + }, +} +import 'jest-preset-angular/setup-jest' diff --git a/apps/home/tailwind.config.js b/apps/home/tailwind.config.js new file mode 100644 index 00000000..85bd5a06 --- /dev/null +++ b/apps/home/tailwind.config.js @@ -0,0 +1,38 @@ +const baseConfig = require('../../node_modules/geonetwork-ui/tailwind.base.config') +const { createGlobPatternsForDependencies } = require('@nx/angular/tailwind') +const { join } = require('path') + +/** @type {import('tailwindcss').Config} */ +module.exports = { + presets: [baseConfig], + content: [ + './node_modules/geonetwork-ui/**/*.mjs', + join(__dirname, 'src/**/!(*.stories|*.spec).{ts,html}'), + ...createGlobPatternsForDependencies(__dirname), + ], + theme: { + extend: { + colors: { + primary: '#E30513', + 'primary-dark': '#AB0107', + 'primary-light': '#FACED2', + beige: '#F7F5F0', + secondary: '#007A80', + 'secondary-dark': '#004E52', + 'secondary-light': '#A1DBDE', + 'gray-1': '#000000', + 'gray-2': '#4C4C4C', + 'gray-3': '#646464', + 'gray-4': '#7C7C7C', + 'gray-5': '#A1A1A1', + 'gray-6': '#CCCDD2', + 'gray-7': '#EEEEEE', + 'gray-8': '#FFFFFF', + }, + fontFamily: { + title: ['Montserrat'], + }, + }, + }, + plugins: [], +} diff --git a/apps/home/tsconfig.app.json b/apps/home/tsconfig.app.json new file mode 100644 index 00000000..fff4a41d --- /dev/null +++ b/apps/home/tsconfig.app.json @@ -0,0 +1,10 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "types": [] + }, + "files": ["src/main.ts"], + "include": ["src/**/*.d.ts"], + "exclude": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts"] +} diff --git a/apps/home/tsconfig.editor.json b/apps/home/tsconfig.editor.json new file mode 100644 index 00000000..8ae117d9 --- /dev/null +++ b/apps/home/tsconfig.editor.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.json", + "include": ["src/**/*.ts"], + "compilerOptions": { + "types": ["jest", "node"] + } +} diff --git a/apps/home/tsconfig.json b/apps/home/tsconfig.json new file mode 100644 index 00000000..44decba5 --- /dev/null +++ b/apps/home/tsconfig.json @@ -0,0 +1,33 @@ +{ + "compilerOptions": { + "target": "es2022", + "useDefineForClassFields": false, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.spec.json" + }, + { + "path": "./tsconfig.editor.json" + } + ], + "extends": "../../tsconfig.base.json", + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +} diff --git a/apps/home/tsconfig.spec.json b/apps/home/tsconfig.spec.json new file mode 100644 index 00000000..53fbfcdc --- /dev/null +++ b/apps/home/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "target": "es2016", + "types": ["jest", "node"] + }, + "files": ["src/test-setup.ts"], + "include": [ + "jest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +} diff --git a/libs/mel/.eslintrc.json b/libs/mel/.eslintrc.json new file mode 100644 index 00000000..b383f7ed --- /dev/null +++ b/libs/mel/.eslintrc.json @@ -0,0 +1,36 @@ +{ + "extends": ["../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts"], + "extends": [ + "plugin:@nx/angular", + "plugin:@angular-eslint/template/process-inline-templates" + ], + "rules": { + "@angular-eslint/directive-selector": [ + "error", + { + "type": "attribute", + "prefix": "melDataplatform", + "style": "camelCase" + } + ], + "@angular-eslint/component-selector": [ + "error", + { + "type": "element", + "prefix": "mel-datahub", + "style": "kebab-case" + } + ] + } + }, + { + "files": ["*.html"], + "extends": ["plugin:@nx/angular-template"], + "rules": {} + } + ] +} diff --git a/libs/mel/README.md b/libs/mel/README.md new file mode 100644 index 00000000..c768beb2 --- /dev/null +++ b/libs/mel/README.md @@ -0,0 +1,7 @@ +# mel + +This library was generated with [Nx](https://nx.dev). + +## Running unit tests + +Run `nx test mel` to execute the unit tests. diff --git a/libs/mel/jest.config.ts b/libs/mel/jest.config.ts new file mode 100644 index 00000000..747c9ee6 --- /dev/null +++ b/libs/mel/jest.config.ts @@ -0,0 +1,22 @@ +/* eslint-disable */ +export default { + displayName: 'mel', + preset: '../../jest.preset.js', + setupFilesAfterEnv: ['/src/test-setup.ts'], + coverageDirectory: '../../coverage/libs/mel', + transform: { + '^.+\\.(ts|mjs|js|html)$': [ + 'jest-preset-angular', + { + tsconfig: '/tsconfig.spec.json', + stringifyContentPathRegex: '\\.(html|svg)$', + }, + ], + }, + transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'], + snapshotSerializers: [ + 'jest-preset-angular/build/serializers/no-ng-attributes', + 'jest-preset-angular/build/serializers/ng-snapshot', + 'jest-preset-angular/build/serializers/html-comment', + ], +} diff --git a/libs/mel/project.json b/libs/mel/project.json new file mode 100644 index 00000000..55bd1c41 --- /dev/null +++ b/libs/mel/project.json @@ -0,0 +1,21 @@ +{ + "name": "mel", + "$schema": "../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/mel/src", + "prefix": "mel-datahub", + "tags": [], + "projectType": "library", + "targets": { + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/mel/jest.config.ts" + } + }, + "lint": { + "executor": "@nx/eslint:lint", + "outputs": ["{options.outputFile}"] + } + } +} diff --git a/libs/mel/src/index.ts b/libs/mel/src/index.ts new file mode 100644 index 00000000..e56c4a05 --- /dev/null +++ b/libs/mel/src/index.ts @@ -0,0 +1,3 @@ +export * from './lib/mel.module' +export * from './lib/embedded.translate.loader' +export * from './lib/route.utils' diff --git a/apps/datahub/src/app/common/autocomplete/autocomplete.component.html b/libs/mel/src/lib/autocomplete/autocomplete.component.html similarity index 100% rename from apps/datahub/src/app/common/autocomplete/autocomplete.component.html rename to libs/mel/src/lib/autocomplete/autocomplete.component.html diff --git a/apps/datahub/src/app/common/autocomplete/autocomplete.component.ts b/libs/mel/src/lib/autocomplete/autocomplete.component.ts similarity index 100% rename from apps/datahub/src/app/common/autocomplete/autocomplete.component.ts rename to libs/mel/src/lib/autocomplete/autocomplete.component.ts diff --git a/apps/datahub/src/app/common/button/button.component.html b/libs/mel/src/lib/button/button.component.html similarity index 100% rename from apps/datahub/src/app/common/button/button.component.html rename to libs/mel/src/lib/button/button.component.html diff --git a/apps/datahub/src/app/common/button/button.component.ts b/libs/mel/src/lib/button/button.component.ts similarity index 100% rename from apps/datahub/src/app/common/button/button.component.ts rename to libs/mel/src/lib/button/button.component.ts diff --git a/apps/datahub/src/app/common/custom-carousel/custom-carousel.component.html b/libs/mel/src/lib/custom-carousel/custom-carousel.component.html similarity index 100% rename from apps/datahub/src/app/common/custom-carousel/custom-carousel.component.html rename to libs/mel/src/lib/custom-carousel/custom-carousel.component.html diff --git a/apps/datahub/src/app/common/custom-carousel/custom-carousel.component.ts b/libs/mel/src/lib/custom-carousel/custom-carousel.component.ts similarity index 100% rename from apps/datahub/src/app/common/custom-carousel/custom-carousel.component.ts rename to libs/mel/src/lib/custom-carousel/custom-carousel.component.ts diff --git a/apps/datahub/src/app/common/embedded.translate.loader.ts b/libs/mel/src/lib/embedded.translate.loader.ts similarity index 76% rename from apps/datahub/src/app/common/embedded.translate.loader.ts rename to libs/mel/src/lib/embedded.translate.loader.ts index d185a248..13e21c8d 100644 --- a/apps/datahub/src/app/common/embedded.translate.loader.ts +++ b/libs/mel/src/lib/embedded.translate.loader.ts @@ -1,7 +1,8 @@ +/* eslint-disable @nx/enforce-module-boundaries */ import { TranslateLoader } from '@ngx-translate/core' import { Observable, map, of } from 'rxjs' -import en_MEL from '../../assets/i18n/en_MEL.json' -import fr_MEL from '../../assets/i18n/fr_MEL.json' +import en_MEL from '../../../../resources/translations/en_MEL.json' +import fr_MEL from '../../../../resources/translations/fr_MEL.json' import en from 'node_modules/geonetwork-ui/translations/en.json' import fr from 'node_modules/geonetwork-ui/translations/fr.json' import { dropEmptyTranslations } from 'geonetwork-ui' diff --git a/apps/datahub/src/app/common/favorites/favorite-heart/favorite-heart.component.html b/libs/mel/src/lib/favorites/favorite-heart/favorite-heart.component.html similarity index 100% rename from apps/datahub/src/app/common/favorites/favorite-heart/favorite-heart.component.html rename to libs/mel/src/lib/favorites/favorite-heart/favorite-heart.component.html diff --git a/apps/datahub/src/app/common/favorites/favorite-heart/favorite-heart.component.ts b/libs/mel/src/lib/favorites/favorite-heart/favorite-heart.component.ts similarity index 100% rename from apps/datahub/src/app/common/favorites/favorite-heart/favorite-heart.component.ts rename to libs/mel/src/lib/favorites/favorite-heart/favorite-heart.component.ts diff --git a/apps/datahub/src/app/common/favorites/heart-toggle/heart-toggle.component.html b/libs/mel/src/lib/favorites/heart-toggle/heart-toggle.component.html similarity index 100% rename from apps/datahub/src/app/common/favorites/heart-toggle/heart-toggle.component.html rename to libs/mel/src/lib/favorites/heart-toggle/heart-toggle.component.html diff --git a/apps/datahub/src/app/common/favorites/heart-toggle/heart-toggle.component.ts b/libs/mel/src/lib/favorites/heart-toggle/heart-toggle.component.ts similarity index 100% rename from apps/datahub/src/app/common/favorites/heart-toggle/heart-toggle.component.ts rename to libs/mel/src/lib/favorites/heart-toggle/heart-toggle.component.ts diff --git a/apps/datahub/src/app/common/footer/mel-datahub-footer.component.html b/libs/mel/src/lib/footer/mel-datahub-footer.component.html similarity index 100% rename from apps/datahub/src/app/common/footer/mel-datahub-footer.component.html rename to libs/mel/src/lib/footer/mel-datahub-footer.component.html diff --git a/apps/datahub/src/app/common/footer/mel-datahub-footer.component.ts b/libs/mel/src/lib/footer/mel-datahub-footer.component.ts similarity index 100% rename from apps/datahub/src/app/common/footer/mel-datahub-footer.component.ts rename to libs/mel/src/lib/footer/mel-datahub-footer.component.ts diff --git a/apps/datahub/src/app/common/fuzzy-search/fuzzy-search.component.html b/libs/mel/src/lib/fuzzy-search/fuzzy-search.component.html similarity index 100% rename from apps/datahub/src/app/common/fuzzy-search/fuzzy-search.component.html rename to libs/mel/src/lib/fuzzy-search/fuzzy-search.component.html diff --git a/apps/datahub/src/app/common/fuzzy-search/fuzzy-search.component.ts b/libs/mel/src/lib/fuzzy-search/fuzzy-search.component.ts similarity index 100% rename from apps/datahub/src/app/common/fuzzy-search/fuzzy-search.component.ts rename to libs/mel/src/lib/fuzzy-search/fuzzy-search.component.ts diff --git a/libs/mel/src/lib/mel.module.ts b/libs/mel/src/lib/mel.module.ts new file mode 100644 index 00000000..77f2a12c --- /dev/null +++ b/libs/mel/src/lib/mel.module.ts @@ -0,0 +1,79 @@ +import { NgModule } from '@angular/core' +import { CommonModule } from '@angular/common' +import { ResultsListComponent } from './results-list/results-list.component' +import { ResultsListCarouselComponent } from './results-list/results-list-carousel/results-list-carousel.component' +import { ResultsListGridComponent } from './results-list/results-list-grid/results-list-grid.component' +import { ResultsListItemComponent } from './results-list-item/results-list-item.component' +import { ResultsCardFavoriteComponent } from './results-list-item/results-card-favorite/results-card-favorite.component' +import { ResultsCardLastCreatedComponent } from './results-list-item/results-card-last-created/results-card-last-created.component' +import { ResultsCardSearchComponent } from './results-list-item/results-card-search/results-card-search.component' +import { MelDatahubMetadataQualityComponent } from './metadata-quality/mel-datahub-metadata-quality.component' +import { ButtonComponent } from './button/button.component' +import { FavoriteHeartComponent } from './favorites/favorite-heart/favorite-heart.component' +import { HeartToggleComponent } from './favorites/heart-toggle/heart-toggle.component' +import { TextExpandComponent } from './text-expand/text-expand.component' +import { MelDatahubFooterComponent } from './footer/mel-datahub-footer.component' +import { CustomCarouselComponent } from './custom-carousel/custom-carousel.component' +import { MelFuzzySearchComponent } from './fuzzy-search/fuzzy-search.component' +import { MelAutocompleteComponent } from './autocomplete/autocomplete.component' +import { + UiElementsModule, + UiLayoutModule, + UiWidgetsModule, +} from 'geonetwork-ui' +import { MatAutocompleteModule } from '@angular/material/autocomplete' +import { MatIconModule } from '@angular/material/icon' +import { ReactiveFormsModule } from '@angular/forms' +import { TranslateModule } from '@ngx-translate/core' +import { StripHtmlPipe } from './strip-html.pipe' + +@NgModule({ + imports: [ + CommonModule, + UiWidgetsModule, + UiElementsModule, + UiLayoutModule, + MatAutocompleteModule, + MatIconModule, + TranslateModule, + ReactiveFormsModule, + ], + declarations: [ + ResultsListComponent, + ResultsListCarouselComponent, + ResultsListGridComponent, + ResultsListItemComponent, + ResultsCardFavoriteComponent, + ResultsCardLastCreatedComponent, + ResultsCardSearchComponent, + MelDatahubMetadataQualityComponent, + ButtonComponent, + FavoriteHeartComponent, + HeartToggleComponent, + TextExpandComponent, + MelDatahubFooterComponent, + CustomCarouselComponent, + MelFuzzySearchComponent, + MelAutocompleteComponent, + StripHtmlPipe, + ], + exports: [ + ResultsListComponent, + ResultsListCarouselComponent, + ResultsListGridComponent, + ResultsListItemComponent, + ResultsCardFavoriteComponent, + ResultsCardLastCreatedComponent, + ResultsCardSearchComponent, + MelDatahubMetadataQualityComponent, + ButtonComponent, + FavoriteHeartComponent, + HeartToggleComponent, + TextExpandComponent, + MelDatahubFooterComponent, + CustomCarouselComponent, + MelFuzzySearchComponent, + MelAutocompleteComponent, + ], +}) +export class MelModule {} diff --git a/apps/datahub/src/app/common/metadata-quality/mel-datahub-metadata-quality.component.html b/libs/mel/src/lib/metadata-quality/mel-datahub-metadata-quality.component.html similarity index 100% rename from apps/datahub/src/app/common/metadata-quality/mel-datahub-metadata-quality.component.html rename to libs/mel/src/lib/metadata-quality/mel-datahub-metadata-quality.component.html diff --git a/apps/datahub/src/app/common/metadata-quality/mel-datahub-metadata-quality.component.ts b/libs/mel/src/lib/metadata-quality/mel-datahub-metadata-quality.component.ts similarity index 100% rename from apps/datahub/src/app/common/metadata-quality/mel-datahub-metadata-quality.component.ts rename to libs/mel/src/lib/metadata-quality/mel-datahub-metadata-quality.component.ts diff --git a/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.html b/libs/mel/src/lib/results-list-item/results-card-favorite/results-card-favorite.component.html similarity index 100% rename from apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.html rename to libs/mel/src/lib/results-list-item/results-card-favorite/results-card-favorite.component.html diff --git a/apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.ts b/libs/mel/src/lib/results-list-item/results-card-favorite/results-card-favorite.component.ts similarity index 100% rename from apps/datahub/src/app/common/results-list-item/results-card-favorite/results-card-favorite.component.ts rename to libs/mel/src/lib/results-list-item/results-card-favorite/results-card-favorite.component.ts diff --git a/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.html b/libs/mel/src/lib/results-list-item/results-card-last-created/results-card-last-created.component.html similarity index 100% rename from apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.html rename to libs/mel/src/lib/results-list-item/results-card-last-created/results-card-last-created.component.html diff --git a/apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.ts b/libs/mel/src/lib/results-list-item/results-card-last-created/results-card-last-created.component.ts similarity index 100% rename from apps/datahub/src/app/common/results-list-item/results-card-last-created/results-card-last-created.component.ts rename to libs/mel/src/lib/results-list-item/results-card-last-created/results-card-last-created.component.ts diff --git a/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.html b/libs/mel/src/lib/results-list-item/results-card-search/results-card-search.component.html similarity index 100% rename from apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.html rename to libs/mel/src/lib/results-list-item/results-card-search/results-card-search.component.html diff --git a/apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.ts b/libs/mel/src/lib/results-list-item/results-card-search/results-card-search.component.ts similarity index 100% rename from apps/datahub/src/app/common/results-list-item/results-card-search/results-card-search.component.ts rename to libs/mel/src/lib/results-list-item/results-card-search/results-card-search.component.ts diff --git a/apps/datahub/src/app/common/results-list-item/results-list-item.component.ts b/libs/mel/src/lib/results-list-item/results-list-item.component.ts similarity index 100% rename from apps/datahub/src/app/common/results-list-item/results-list-item.component.ts rename to libs/mel/src/lib/results-list-item/results-list-item.component.ts diff --git a/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.html b/libs/mel/src/lib/results-list/results-list-carousel/results-list-carousel.component.html similarity index 100% rename from apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.html rename to libs/mel/src/lib/results-list/results-list-carousel/results-list-carousel.component.html diff --git a/apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.ts b/libs/mel/src/lib/results-list/results-list-carousel/results-list-carousel.component.ts similarity index 100% rename from apps/datahub/src/app/common/results-list/results-list-carousel/results-list-carousel.component.ts rename to libs/mel/src/lib/results-list/results-list-carousel/results-list-carousel.component.ts diff --git a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.html b/libs/mel/src/lib/results-list/results-list-grid/results-list-grid.component.html similarity index 100% rename from apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.html rename to libs/mel/src/lib/results-list/results-list-grid/results-list-grid.component.html diff --git a/apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.ts b/libs/mel/src/lib/results-list/results-list-grid/results-list-grid.component.ts similarity index 100% rename from apps/datahub/src/app/common/results-list/results-list-grid/results-list-grid.component.ts rename to libs/mel/src/lib/results-list/results-list-grid/results-list-grid.component.ts diff --git a/apps/datahub/src/app/common/results-list/results-list.component.ts b/libs/mel/src/lib/results-list/results-list.component.ts similarity index 77% rename from apps/datahub/src/app/common/results-list/results-list.component.ts rename to libs/mel/src/lib/results-list/results-list.component.ts index 02d9b1d9..8494c9b6 100644 --- a/apps/datahub/src/app/common/results-list/results-list.component.ts +++ b/libs/mel/src/lib/results-list/results-list.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnDestroy, OnInit } from '@angular/core' +import { Component, Input, OnDestroy, OnInit, Optional } from '@angular/core' import { Store } from '@ngrx/store' import { FIELDS_BRIEF, @@ -13,6 +13,7 @@ import { Keyword, } from 'geonetwork-ui/libs/common/domain/src/lib/model/record' import { Subscription } from 'rxjs' +import { goFromHomeToRecord, goFromHomeToSearch } from '../route.utils' @Component({ selector: 'mel-datahub-results-list', @@ -30,7 +31,7 @@ export class ResultsListComponent implements OnInit, OnDestroy { constructor( protected searchService: SearchService, protected searchFacade: SearchFacade, - protected routerFacade: RouterFacade, + @Optional() protected routerFacade: RouterFacade, protected favoritesService: FavoritesService, protected store: Store ) {} @@ -57,10 +58,14 @@ export class ResultsListComponent implements OnInit, OnDestroy { } onInfoKeywordClick(keyword: Keyword) { - this.routerFacade.updateSearch({ q: keyword.label }) + this.routerFacade + ? this.routerFacade.updateSearch({ q: keyword.label }) + : goFromHomeToSearch(keyword.label) } onMetadataSelection(metadata: CatalogRecord): void { - this.routerFacade.goToMetadata(metadata) + this.routerFacade + ? this.routerFacade.goToMetadata(metadata) + : goFromHomeToRecord(metadata) } } diff --git a/libs/mel/src/lib/route.utils.ts b/libs/mel/src/lib/route.utils.ts new file mode 100644 index 00000000..3bdfb7c0 --- /dev/null +++ b/libs/mel/src/lib/route.utils.ts @@ -0,0 +1,13 @@ +import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/model/record' + +export const DATAHUB_ROOT = '/catalogue' +export const DATAHUB_ROUTE_DATASET = 'dataset' +export const DATAHUB_ROUTE_SEARCH = 'search' + +export function goFromHomeToRecord(record: CatalogRecord) { + window.location.href = `${DATAHUB_ROOT}/${DATAHUB_ROUTE_DATASET}/${record.uniqueIdentifier}` +} + +export function goFromHomeToSearch(query: string) { + window.location.href = `${DATAHUB_ROOT}/${DATAHUB_ROUTE_SEARCH}?q=${query}` +} diff --git a/apps/datahub/src/app/common/strip-html.pipe.ts b/libs/mel/src/lib/strip-html.pipe.ts similarity index 100% rename from apps/datahub/src/app/common/strip-html.pipe.ts rename to libs/mel/src/lib/strip-html.pipe.ts diff --git a/apps/datahub/src/app/common/text-expand/text-expand.component.html b/libs/mel/src/lib/text-expand/text-expand.component.html similarity index 100% rename from apps/datahub/src/app/common/text-expand/text-expand.component.html rename to libs/mel/src/lib/text-expand/text-expand.component.html diff --git a/apps/datahub/src/app/common/text-expand/text-expand.component.ts b/libs/mel/src/lib/text-expand/text-expand.component.ts similarity index 100% rename from apps/datahub/src/app/common/text-expand/text-expand.component.ts rename to libs/mel/src/lib/text-expand/text-expand.component.ts diff --git a/libs/mel/src/test-setup.ts b/libs/mel/src/test-setup.ts new file mode 100644 index 00000000..a5e675ac --- /dev/null +++ b/libs/mel/src/test-setup.ts @@ -0,0 +1,8 @@ +// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment +globalThis.ngJest = { + testEnvironmentOptions: { + errorOnUnknownElements: true, + errorOnUnknownProperties: true, + }, +} +import 'jest-preset-angular/setup-jest' diff --git a/libs/mel/tsconfig.json b/libs/mel/tsconfig.json new file mode 100644 index 00000000..92049739 --- /dev/null +++ b/libs/mel/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "target": "es2022", + "useDefineForClassFields": false, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + }, + { + "path": "./tsconfig.spec.json" + } + ], + "extends": "../../tsconfig.base.json", + "angularCompilerOptions": { + "enableI18nLegacyMessageIdFormat": false, + "strictInjectionParameters": true, + "strictInputAccessModifiers": true, + "strictTemplates": true + } +} diff --git a/libs/mel/tsconfig.lib.json b/libs/mel/tsconfig.lib.json new file mode 100644 index 00000000..063e5257 --- /dev/null +++ b/libs/mel/tsconfig.lib.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "declaration": true, + "declarationMap": true, + "inlineSources": true, + "types": [] + }, + "exclude": [ + "src/**/*.spec.ts", + "src/test-setup.ts", + "jest.config.ts", + "src/**/*.test.ts" + ], + "include": ["src/**/*.ts"] +} diff --git a/libs/mel/tsconfig.spec.json b/libs/mel/tsconfig.spec.json new file mode 100644 index 00000000..53fbfcdc --- /dev/null +++ b/libs/mel/tsconfig.spec.json @@ -0,0 +1,16 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "../../dist/out-tsc", + "module": "commonjs", + "target": "es2016", + "types": ["jest", "node"] + }, + "files": ["src/test-setup.ts"], + "include": [ + "jest.config.ts", + "src/**/*.test.ts", + "src/**/*.spec.ts", + "src/**/*.d.ts" + ] +} diff --git a/package-lock.json b/package-lock.json index 6f97865f..3068722d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "@ngx-translate/core": "^15.0.0", "@nx/angular": "17.2.8", "@vendure/ngx-translate-extract": "^9.0.3", - "geonetwork-ui": "^2.2.0-dev.9d7dfa2e", + "geonetwork-ui": "^2.2.0-dev.1b3d9896", "rxjs": "~7.8.0", "tippy.js": "^6.3.7", "tslib": "^2.3.0", @@ -10386,14 +10386,6 @@ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, - "node_modules/buffer-writer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/buffer-writer/-/buffer-writer-2.0.0.tgz", - "integrity": "sha512-a7ZpuTZU1TRtnwyCNW3I5dc0wWNC3VR9S++Ewyk2HHZdrO3CQJqSpd+95Us590V6AL7JqUAH2IwZ/398PmNFgw==", - "engines": { - "node": ">=4" - } - }, "node_modules/builtins": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", @@ -12585,9 +12577,9 @@ "integrity": "sha512-osHqhtjojpCsACVnuD11xO5g9xaCyw7Qqn/C2KParkMv42i8jrJJgx3g7mkHfpxwhy9MnOJr8+pKOdZ7qzgizg==" }, "node_modules/embla-carousel": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/embla-carousel/-/embla-carousel-8.0.0.tgz", - "integrity": "sha512-ecixcyqS6oKD2nh5Nj5MObcgoSILWNI/GtBxkidn5ytFaCCmwVHo2SecksaQZHcARMMpIR2dWOlSIdA1LkZFUA==" + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/embla-carousel/-/embla-carousel-8.0.1.tgz", + "integrity": "sha512-RsaMRyBCd144N95gb3XoI+H9zj3RI4y0qcfvKYEh2tIAIEenL9CW9vwzltCeoYkWYipGdkvup+HGT9ewG1YTEw==" }, "node_modules/emittery": { "version": "0.13.1", @@ -14201,9 +14193,9 @@ } }, "node_modules/geonetwork-ui": { - "version": "2.2.0-dev.9d7dfa2e", - "resolved": "https://registry.npmjs.org/geonetwork-ui/-/geonetwork-ui-2.2.0-dev.9d7dfa2e.tgz", - "integrity": "sha512-PBBkHAWwBprxE5oJVdgBHSJefDSnfuTACroOpy5L77N5Yr+g7T9wBY95dHn6waBmjGmYaR4JkaRLIK8H1iwk8g==", + "version": "2.2.0-dev.1b3d9896", + "resolved": "https://registry.npmjs.org/geonetwork-ui/-/geonetwork-ui-2.2.0-dev.1b3d9896.tgz", + "integrity": "sha512-gGw7ZpV1tg5zmBUDVbRicekOtaV4aC0iBTxbRPj1EYvx75k720Z7LCPl3wL0Qxxuw8uZqym+Se9plbtUgSAKOg==", "dependencies": { "@biesbjerg/ngx-translate-extract-marker": "^1.0.0", "@camptocamp/ogc-client": "^0.4.0", @@ -15658,6 +15650,32 @@ } } }, + "node_modules/geonetwork-ui/node_modules/@nx/angular/node_modules/@typescript-eslint/type-utils": { + "version": "5.62.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", + "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", + "dependencies": { + "@typescript-eslint/typescript-estree": "5.62.0", + "@typescript-eslint/utils": "5.62.0", + "debug": "^4.3.4", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/geonetwork-ui/node_modules/@nx/angular/node_modules/magic-string": { "version": "0.26.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.26.7.tgz", @@ -16270,9 +16288,9 @@ } }, "node_modules/geonetwork-ui/node_modules/@types/node": { - "version": "16.18.91", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.91.tgz", - "integrity": "sha512-h8Q4klc8xzc9kJKr7UYNtJde5TU2qEePVyH3WyzJaUC+3ptyc5kPQbWOIUcn8ZsG5+KSkq+P0py0kC0VqxgAXw==", + "version": "16.18.96", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.96.tgz", + "integrity": "sha512-84iSqGXoO+Ha16j8pRZ/L90vDMKX04QTYMTfYeE1WrjWaZXuchBehGUZEpNgx7JnmlrIHdnABmpjrQjhCnNldQ==", "optional": true, "peer": true }, @@ -16292,32 +16310,6 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/geonetwork-ui/node_modules/@typescript-eslint/type-utils": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.62.0.tgz", - "integrity": "sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==", - "dependencies": { - "@typescript-eslint/typescript-estree": "5.62.0", - "@typescript-eslint/utils": "5.62.0", - "debug": "^4.3.4", - "tsutils": "^3.21.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "*" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, "node_modules/geonetwork-ui/node_modules/@typescript-eslint/types": { "version": "5.62.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.62.0.tgz", @@ -22169,9 +22161,9 @@ "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==" }, "node_modules/ng-table-virtual-scroll": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/ng-table-virtual-scroll/-/ng-table-virtual-scroll-1.6.0.tgz", - "integrity": "sha512-2fDtwa6SEqBym6RNXo9WHq514yrwMOlBPoYk2NTB9+AgKDKyOTAQMNJTG4AyEjyyjhAD0jlrZcKjvS6qRIcgIQ==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/ng-table-virtual-scroll/-/ng-table-virtual-scroll-1.6.1.tgz", + "integrity": "sha512-HXcRoPPHBBHU47HPsdegGoLKbu0UYnrIVVHLwwdtje1AduEKNY2ZCUK/T4nuX3biImSrKoydUa7/vbFtmYx86Q==", "dependencies": { "tslib": "^2.0.0" }, @@ -23101,11 +23093,6 @@ "node": ">=6" } }, - "node_modules/packet-reader": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", - "integrity": "sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ==" - }, "node_modules/pacote": { "version": "17.0.4", "resolved": "https://registry.npmjs.org/pacote/-/pacote-17.0.4.tgz", @@ -23280,11 +23267,11 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-scurry": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.1.tgz", - "integrity": "sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ==", + "version": "1.10.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.10.2.tgz", + "integrity": "sha512-7xTavNy5RQXnsjANvVvMkEjvloOinkAjv/Z6Ildz9v2RinZ4SBKTWFOVRbaF8p0vpHnyjV/UwNDdKuUv6M5qcA==", "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", + "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { @@ -23295,9 +23282,9 @@ } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.1.0.tgz", - "integrity": "sha512-/1clY/ui8CzjKFyjdvwPWJUYKiFVXG2I2cY0ssG7h4+hwk+XOIX7ZSG9Q7TW8TW3Kp3BUSqgFWBLgL4PJ+Blag==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.0.tgz", + "integrity": "sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q==", "engines": { "node": "14 || >=16.14" } @@ -23340,15 +23327,13 @@ "devOptional": true }, "node_modules/pg": { - "version": "8.11.3", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.3.tgz", - "integrity": "sha512-+9iuvG8QfaaUrrph+kpF24cXkH1YOOUeArRNYIxq1viYHZagBxrTno7cecY1Fa44tJeZvaoG+Djpkc3JwehN5g==", - "dependencies": { - "buffer-writer": "2.0.0", - "packet-reader": "1.0.0", - "pg-connection-string": "^2.6.2", - "pg-pool": "^3.6.1", - "pg-protocol": "^1.6.0", + "version": "8.11.5", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.5.tgz", + "integrity": "sha512-jqgNHSKL5cbDjFlHyYsCXmQDrfIX/3RsNwYqpd4N0Kt8niLuNoRNH+aazv6cOd43gPh9Y4DjQCtb+X0MH0Hvnw==", + "dependencies": { + "pg-connection-string": "^2.6.4", + "pg-pool": "^3.6.2", + "pg-protocol": "^1.6.1", "pg-types": "^2.1.0", "pgpass": "1.x" }, @@ -23374,9 +23359,9 @@ "optional": true }, "node_modules/pg-connection-string": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.2.tgz", - "integrity": "sha512-ch6OwaeaPYcova4kKZ15sbJ2hKb/VP48ZD2gE7i1J+L4MspCtBMAx8nMgz7bksc7IojCIIWuEhHibSMFH8m8oA==" + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.4.tgz", + "integrity": "sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA==" }, "node_modules/pg-int8": { "version": "1.0.1", @@ -23387,17 +23372,17 @@ } }, "node_modules/pg-pool": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.1.tgz", - "integrity": "sha512-jizsIzhkIitxCGfPRzJn1ZdcosIt3pz9Sh3V01fm1vZnbnCMgmGl5wvGGdNN2EL9Rmb0EcFoCkixH4Pu+sP9Og==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.2.tgz", + "integrity": "sha512-Htjbg8BlwXqSBQ9V8Vjtc+vzf/6fVUuak/3/XXKA9oxZprwW3IMDQTGHP+KDmVL7rtd+R1QjbnCFPuTHm3G4hg==", "peerDependencies": { "pg": ">=8.0" } }, "node_modules/pg-protocol": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.0.tgz", - "integrity": "sha512-M+PDm637OY5WM307051+bsDia5Xej6d9IR4GwJse1qA1DIhiKlksvrneZOYQq42OM+spubpcNYEo2FcKQrDk+Q==" + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.1.tgz", + "integrity": "sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==" }, "node_modules/pg-types": { "version": "2.2.0", @@ -27227,15 +27212,15 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/typeorm/node_modules/glob": { - "version": "10.3.10", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", - "integrity": "sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g==", + "version": "10.3.12", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.12.tgz", + "integrity": "sha512-TCNv8vJ+xz4QiqTpfOJA7HvYv+tNIRHKfUWw/q+v2jdgN4ebz+KY9tGx5J4rHP0o84mNP+ApH66HRX8us3Khqg==", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", + "jackspeak": "^2.3.6", "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" + "minipass": "^7.0.4", + "path-scurry": "^1.10.2" }, "bin": { "glob": "dist/esm/bin.mjs" @@ -27256,9 +27241,9 @@ } }, "node_modules/typeorm/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", "dependencies": { "brace-expansion": "^2.0.1" }, @@ -27284,9 +27269,9 @@ } }, "node_modules/typeorm/node_modules/reflect-metadata": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.1.tgz", - "integrity": "sha512-i5lLI6iw9AU3Uu4szRNPPEkomnkjRTaVt9hy/bn5g/oSzekBSMeLZblcjP74AW0vBabqERLLIrz+gR8QYR54Tw==" + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.2.2.tgz", + "integrity": "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==" }, "node_modules/typeorm/node_modules/supports-color": { "version": "7.2.0", diff --git a/package.json b/package.json index f39fa662..c5ec2736 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,15 @@ "license": "MIT", "scripts": { "start": "nx serve mel-datahub", + "home": "nx serve home --port 4201", "format": "nx format:write", "format:check": "nx format:check", "lint:all": "nx run-many --target=lint", "e2e:all": "nx run-many --target=e2e", "e2e:datahub": "nx e2e mel-datahub-e2e", "e2e:datahub-dev": "nx e2e mel-datahub-e2e --watch", + "e2e:home": "nx e2e home-e2e", + "e2e:home-dev": "nx e2e home-e2e --watch", "i18n:extract": "ngx-translate-extract -s --fi ' ' --input ./apps --output ./apps/datahub/src/assets/i18n/{en_MEL,fr_MEL}.json --clean --format json && npm run format" }, "private": true, @@ -34,7 +37,7 @@ "@ngx-translate/core": "^15.0.0", "@nx/angular": "17.2.8", "@vendure/ngx-translate-extract": "^9.0.3", - "geonetwork-ui": "^2.2.0-dev.9d7dfa2e", + "geonetwork-ui": "^2.2.0-dev.1b3d9896", "rxjs": "~7.8.0", "tippy.js": "^6.3.7", "tslib": "^2.3.0", diff --git a/resources/assets/.gitkeep b/resources/assets/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/apps/datahub/src/assets/icons/api.svg b/resources/assets/icons/api.svg similarity index 100% rename from apps/datahub/src/assets/icons/api.svg rename to resources/assets/icons/api.svg diff --git a/apps/datahub/src/assets/icons/arrow-back.svg b/resources/assets/icons/arrow-back.svg similarity index 100% rename from apps/datahub/src/assets/icons/arrow-back.svg rename to resources/assets/icons/arrow-back.svg diff --git a/apps/datahub/src/assets/icons/arrow-up.svg b/resources/assets/icons/arrow-up.svg similarity index 100% rename from apps/datahub/src/assets/icons/arrow-up.svg rename to resources/assets/icons/arrow-up.svg diff --git a/apps/datahub/src/assets/icons/arrow.svg b/resources/assets/icons/arrow.svg similarity index 100% rename from apps/datahub/src/assets/icons/arrow.svg rename to resources/assets/icons/arrow.svg diff --git a/apps/datahub/src/assets/icons/bg-footer.png b/resources/assets/icons/bg-footer.png similarity index 100% rename from apps/datahub/src/assets/icons/bg-footer.png rename to resources/assets/icons/bg-footer.png diff --git a/apps/datahub/src/assets/icons/carousel-arrow-left.svg b/resources/assets/icons/carousel-arrow-left.svg similarity index 100% rename from apps/datahub/src/assets/icons/carousel-arrow-left.svg rename to resources/assets/icons/carousel-arrow-left.svg diff --git a/apps/datahub/src/assets/icons/carousel-arrow-right.svg b/resources/assets/icons/carousel-arrow-right.svg similarity index 100% rename from apps/datahub/src/assets/icons/carousel-arrow-right.svg rename to resources/assets/icons/carousel-arrow-right.svg diff --git a/apps/datahub/src/assets/icons/copy.svg b/resources/assets/icons/copy.svg similarity index 100% rename from apps/datahub/src/assets/icons/copy.svg rename to resources/assets/icons/copy.svg diff --git a/apps/datahub/src/assets/icons/download.svg b/resources/assets/icons/download.svg similarity index 100% rename from apps/datahub/src/assets/icons/download.svg rename to resources/assets/icons/download.svg diff --git a/apps/datahub/src/assets/icons/email.svg b/resources/assets/icons/email.svg similarity index 100% rename from apps/datahub/src/assets/icons/email.svg rename to resources/assets/icons/email.svg diff --git a/apps/datahub/src/assets/icons/facebook.svg b/resources/assets/icons/facebook.svg similarity index 100% rename from apps/datahub/src/assets/icons/facebook.svg rename to resources/assets/icons/facebook.svg diff --git a/apps/datahub/src/assets/icons/finance_ue.png b/resources/assets/icons/finance_ue.png similarity index 100% rename from apps/datahub/src/assets/icons/finance_ue.png rename to resources/assets/icons/finance_ue.png diff --git a/apps/datahub/src/assets/icons/france_relance.jpg b/resources/assets/icons/france_relance.jpg similarity index 100% rename from apps/datahub/src/assets/icons/france_relance.jpg rename to resources/assets/icons/france_relance.jpg diff --git a/apps/datahub/src/assets/icons/france_relance.png b/resources/assets/icons/france_relance.png similarity index 100% rename from apps/datahub/src/assets/icons/france_relance.png rename to resources/assets/icons/france_relance.png diff --git a/apps/datahub/src/assets/icons/heart-filled-red.svg b/resources/assets/icons/heart-filled-red.svg similarity index 100% rename from apps/datahub/src/assets/icons/heart-filled-red.svg rename to resources/assets/icons/heart-filled-red.svg diff --git a/apps/datahub/src/assets/icons/heart-filled.svg b/resources/assets/icons/heart-filled.svg similarity index 100% rename from apps/datahub/src/assets/icons/heart-filled.svg rename to resources/assets/icons/heart-filled.svg diff --git a/apps/datahub/src/assets/icons/heart-red.svg b/resources/assets/icons/heart-red.svg similarity index 100% rename from apps/datahub/src/assets/icons/heart-red.svg rename to resources/assets/icons/heart-red.svg diff --git a/apps/datahub/src/assets/icons/heart.svg b/resources/assets/icons/heart.svg similarity index 100% rename from apps/datahub/src/assets/icons/heart.svg rename to resources/assets/icons/heart.svg diff --git a/apps/datahub/src/assets/icons/info.svg b/resources/assets/icons/info.svg similarity index 100% rename from apps/datahub/src/assets/icons/info.svg rename to resources/assets/icons/info.svg diff --git a/apps/datahub/src/assets/icons/linkedin.svg b/resources/assets/icons/linkedin.svg similarity index 100% rename from apps/datahub/src/assets/icons/linkedin.svg rename to resources/assets/icons/linkedin.svg diff --git a/apps/datahub/src/assets/icons/search.svg b/resources/assets/icons/search.svg similarity index 100% rename from apps/datahub/src/assets/icons/search.svg rename to resources/assets/icons/search.svg diff --git a/apps/datahub/src/assets/icons/twitter.svg b/resources/assets/icons/twitter.svg similarity index 100% rename from apps/datahub/src/assets/icons/twitter.svg rename to resources/assets/icons/twitter.svg diff --git a/apps/datahub/src/styles.css b/resources/styles.css similarity index 100% rename from apps/datahub/src/styles.css rename to resources/styles.css diff --git a/apps/datahub/src/assets/i18n/en_MEL.json b/resources/translations/en_MEL.json similarity index 100% rename from apps/datahub/src/assets/i18n/en_MEL.json rename to resources/translations/en_MEL.json diff --git a/apps/datahub/src/assets/i18n/fr_MEL.json b/resources/translations/fr_MEL.json similarity index 100% rename from apps/datahub/src/assets/i18n/fr_MEL.json rename to resources/translations/fr_MEL.json diff --git a/tsconfig.base.json b/tsconfig.base.json index 82b25ec3..c230e2e4 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -20,7 +20,9 @@ "noImplicitAny": false, "resolveJsonModule": true, "esModuleInterop": true, - "paths": {} + "paths": { + "@mel-dataplatform/mel": ["libs/mel/src/index.ts"] + } }, "exclude": ["node_modules", "tmp"] }