Skip to content

Commit

Permalink
Merge pull request #277 from geonetwork/gh-actions
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
fgravin authored Jun 21, 2022
2 parents f2d4e90 + 44e794a commit 61f507d
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 41 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
Expand Down Expand Up @@ -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
Expand Down
12 changes: 11 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)_
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
42 changes: 21 additions & 21 deletions libs/util/shared/src/lib/links/link-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 ?
}

0 comments on commit 61f507d

Please sign in to comment.