diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5a07bd3b9b..9dc59602a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: persist-credentials: false fetch-depth: 0 @@ -49,12 +49,18 @@ jobs: ${{ runner.os }}-build- ${{ runner.os }}- - - run: npm ci - - run: npx nx workspace-lint - - run: npx nx format:check --base=$NX_BASE --head=$NX_HEAD - - run: npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 - - run: npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage - - run: npx nx affected --target=build --parallel=3 + - name: Install + run: npm ci + - name: Workspace lint + run: npx nx workspace-lint + - name: Format check + run: npx nx format:check --base=$NX_BASE --head=$NX_HEAD + - name: Lint affected --quiet + run: npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=lint --parallel=3 --quiet + - name: Test affected + run: npx nx affected --base=$NX_BASE --head=$NX_HEAD --target=test --parallel=3 --ci --code-coverage + - name: Build affected + run: npx nx affected --target=build --parallel=3 gh-pages: runs-on: ubuntu-latest diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ceb935fd21..e39d4ed0e8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,9 +10,19 @@ There are also many [community plugins](https://nx.dev/nx-community) you could a ## Workspace operations +### Get started + +To have more flexibility using Nx tools, you should install Nx CLI. + +```shell +npm i -g @nrwl/cli +``` + +This will make the `Nx` command available on your system. + ### Generate an application -Run `ng g @nrwl/angular:app my-app` to generate an application. +Run `nx g @nrwl/angular:app my-app` to generate an application. > You can use any of the plugins above to generate applications as well. diff --git a/README.md b/README.md index e640783c5b..94de1b9182 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,6 @@ You can start it with `npm run storybook`. You can either try complete applications or showcases of components using the following links: -- [Datahub app](https://geonetwork.github.io/geonetwork-ui/master/apps/datahub/) - [Storybook of UI components](https://geonetwork.github.io/geonetwork-ui/master/storybook/demo/) - [Storybook of Web components](https://geonetwork.github.io/geonetwork-ui/master/storybook-wc/) - [Demo](https://geonetwork.github.io/geonetwork-ui/master/demo/) _(not functional yet, WIP)_ diff --git a/libs/ui/elements/src/lib/metadata-info/metadata-info.component.stories.ts b/libs/ui/elements/src/lib/metadata-info/metadata-info.component.stories.ts index a7a559329c..5292ce6a7c 100644 --- a/libs/ui/elements/src/lib/metadata-info/metadata-info.component.stories.ts +++ b/libs/ui/elements/src/lib/metadata-info/metadata-info.component.stories.ts @@ -6,7 +6,7 @@ import { TranslateModule } from '@ngx-translate/core' import { Meta, moduleMetadata, Story } from '@storybook/angular' import { MetadataInfoComponent } from './metadata-info.component' import { UiElementsModule } from '../ui-elements.module' -import { RECORDS_FULL_FIXTURE } from '@geonetwork-ui/ui/search' +import { RECORDS_FULL_FIXTURE } from '@geonetwork-ui/util/shared' export default { title: 'Elements/MetadataInfoComponent', diff --git a/libs/ui/search/src/lib/record-preview-card/record-preview-card.component.stories.ts b/libs/ui/search/src/lib/record-preview-card/record-preview-card.component.stories.ts index c14926df90..f6c343fc1b 100644 --- a/libs/ui/search/src/lib/record-preview-card/record-preview-card.component.stories.ts +++ b/libs/ui/search/src/lib/record-preview-card/record-preview-card.component.stories.ts @@ -1,8 +1,10 @@ import { moduleMetadata, Story, Meta } from '@storybook/angular' import { RecordPreviewCardComponent } from './record-preview-card.component' -import { RECORDS_SUMMARY_FIXTURE } from '../facets/fixtures' import { RecordThumbnailComponent } from '../record-thumbnail/record-thumbnail.component' -import { UtilSharedModule } from '@geonetwork-ui/util/shared' +import { + RECORDS_SUMMARY_FIXTURE, + UtilSharedModule, +} from '@geonetwork-ui/util/shared' export default { title: 'Search/RecordPreviewCardComponent', diff --git a/libs/ui/search/src/lib/record-preview-list/record-preview-list.component.stories.ts b/libs/ui/search/src/lib/record-preview-list/record-preview-list.component.stories.ts index e8d2272511..df85223ee3 100644 --- a/libs/ui/search/src/lib/record-preview-list/record-preview-list.component.stories.ts +++ b/libs/ui/search/src/lib/record-preview-list/record-preview-list.component.stories.ts @@ -1,8 +1,10 @@ import { moduleMetadata, Story, Meta } from '@storybook/angular' import { RecordPreviewListComponent } from './record-preview-list.component' -import { RECORDS_SUMMARY_FIXTURE } from '../facets/fixtures' import { RecordThumbnailComponent } from '../record-thumbnail/record-thumbnail.component' -import { UtilSharedModule } from '@geonetwork-ui/util/shared' +import { + RECORDS_SUMMARY_FIXTURE, + UtilSharedModule, +} from '@geonetwork-ui/util/shared' export default { title: 'Search/RecordPreviewListComponent', diff --git a/libs/ui/search/src/lib/record-preview-text/record-preview-text.component.stories.ts b/libs/ui/search/src/lib/record-preview-text/record-preview-text.component.stories.ts index a3a1094bce..ce512fc58d 100644 --- a/libs/ui/search/src/lib/record-preview-text/record-preview-text.component.stories.ts +++ b/libs/ui/search/src/lib/record-preview-text/record-preview-text.component.stories.ts @@ -1,8 +1,10 @@ import { moduleMetadata, Story, Meta } from '@storybook/angular' import { RecordPreviewTextComponent } from './record-preview-text.component' -import { RECORDS_SUMMARY_FIXTURE } from '../facets/fixtures' import { RecordThumbnailComponent } from '../record-thumbnail/record-thumbnail.component' -import { UtilSharedModule } from '@geonetwork-ui/util/shared' +import { + RECORDS_SUMMARY_FIXTURE, + UtilSharedModule, +} from '@geonetwork-ui/util/shared' export default { title: 'Search/RecordPreviewTextComponent', diff --git a/libs/ui/search/src/lib/record-preview-title/record-preview-title.component.stories.ts b/libs/ui/search/src/lib/record-preview-title/record-preview-title.component.stories.ts index 3e86c4f965..a0e87084bd 100644 --- a/libs/ui/search/src/lib/record-preview-title/record-preview-title.component.stories.ts +++ b/libs/ui/search/src/lib/record-preview-title/record-preview-title.component.stories.ts @@ -1,8 +1,10 @@ import { moduleMetadata, Story, Meta } from '@storybook/angular' import { RecordPreviewTitleComponent } from './record-preview-title.component' -import { RECORDS_SUMMARY_FIXTURE } from '../facets/fixtures' import { RecordThumbnailComponent } from '../record-thumbnail/record-thumbnail.component' -import { UtilSharedModule } from '@geonetwork-ui/util/shared' +import { + RECORDS_SUMMARY_FIXTURE, + UtilSharedModule, +} from '@geonetwork-ui/util/shared' export default { title: 'Search/RecordPreviewTitleComponent', diff --git a/libs/ui/search/src/lib/results-list/results-list.component.stories.ts b/libs/ui/search/src/lib/results-list/results-list.component.stories.ts index 485af1f24d..9b6af9b57a 100644 --- a/libs/ui/search/src/lib/results-list/results-list.component.stories.ts +++ b/libs/ui/search/src/lib/results-list/results-list.component.stories.ts @@ -1,8 +1,10 @@ import { moduleMetadata, Story, Meta } from '@storybook/angular' import { DEFAULT_RESULTS_LAYOUT_CONFIG } from './results-layout.config' import { ResultsListComponent } from './results-list.component' -import { UtilSharedModule } from '@geonetwork-ui/util/shared' -import { RECORDS_SUMMARY_FIXTURE } from '../facets/fixtures' +import { + RECORDS_SUMMARY_FIXTURE, + UtilSharedModule, +} from '@geonetwork-ui/util/shared' import { RecordPreviewListComponent } from '../record-preview-list/record-preview-list.component' import { RecordPreviewCardComponent } from '../record-preview-card/record-preview-card.component' import { RecordPreviewTextComponent } from '../record-preview-text/record-preview-text.component' diff --git a/libs/util/shared/src/lib/links/link-utils.ts b/libs/util/shared/src/lib/links/link-utils.ts index 0244cad518..c81abbbe51 100644 --- a/libs/util/shared/src/lib/links/link-utils.ts +++ b/libs/util/shared/src/lib/links/link-utils.ts @@ -10,6 +10,15 @@ export const FORMATS = { color: '#559d7f', mimeTypes: ['text/csv', 'application/csv'], }, + excel: { + extensions: ['xls', 'xlsx', 'ms-excel', 'openxmlformats-officedocument'], + priority: 2, + color: '#0f4395', + mimeTypes: [ + 'application/vnd.ms-excel', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', + ], + }, geojson: { extensions: ['geojson'], priority: 3, @@ -39,37 +48,28 @@ export const FORMATS = { }, gpkg: { extensions: ['gpkg', 'geopackage'], - priority: 0, - color: 'var(--color-primary)', + priority: 6, + color: '#ea79ba', mimeTypes: ['application/geopackage+sqlite3'], }, - excel: { - extensions: ['xls', 'xlsx', 'ms-excel', 'openxmlformats-officedocument'], - priority: 2, - color: 'var(--color-primary)', - mimeTypes: [ - 'application/vnd.ms-excel', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - ], + zip: { + extensions: ['zip'], + priority: 7, + color: '#f2bb3a', + mimeTypes: ['application/zip'], }, pdf: { extensions: ['pdf'], - priority: 0, - color: 'var(--color-primary)', + priority: 8, + color: '#db544a', mimeTypes: ['application/vnd.ms-excel'], }, jpg: { extensions: ['jpg', 'jpeg', 'jfif', 'pjpeg', 'pjp'], - priority: 0, - color: 'var(--color-primary)', + priority: 8, + color: '#673ab7', mimeTypes: ['image/jpg'], }, - zip: { - extensions: ['zip'], - priority: 0, - color: 'var(--color-primary)', - mimeTypes: ['application/zip'], - }, } export function sortPriority(link: MetadataLinkValid): number { @@ -138,5 +138,5 @@ export function getBadgeColor(linkFormat: string): string | void { return FORMATS[format].color } } - return 'var(--color-primary)' // Default color ? + return 'var(--color-gray-700)' // Default color ? }