Skip to content

Commit

Permalink
Merge pull request #464 from geonetwork/refactor-search-client
Browse files Browse the repository at this point in the history
[BIG Refactoring] Add abstraction for search backend client
  • Loading branch information
fgravin authored Aug 25, 2023
2 parents be2a812 + 07c78fe commit ba8b141
Show file tree
Hide file tree
Showing 354 changed files with 5,715 additions and 5,703 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ concurrency:
cancel-in-progress: true

env:
NODE_VERSION: 16.17.0
NODE_VERSION: 18.16.1
# a list of apps to build and publish on releases
APP_NAMES: datafeeder,datahub

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Checks
run-name: 🩺 Quality assurance checks on ${{ github.event_name == 'pull_request' && 'PR' || '🌱' }} ${{ github.event_name == 'pull_request' && github.event.number || github.ref_name }}

env:
NODE_VERSION: 16.17.0
NODE_VERSION: 18.16.1
TEST_HIDE_CONSOLE: true

# This workflow runs for Pull Requests which are not draft,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy
run-name: 🚀 Deploy to GitHub Pages for ${{ github.event_name == 'issue_comment' && 'PR' || '🌱' }} ${{github.event_name == 'issue_comment' && github.event.issue.number || github.ref_name}}

env:
NODE_VERSION: 16.17.0
NODE_VERSION: 18.16.1

# This workflow runs whenever the "deploy affected apps" checkbox is checked (for PR)
# or on every push to main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/webcomponents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
cancel-in-progress: true

env:
NODE_VERSION: 16.17.0
NODE_VERSION: 18.16.1
PUBLISH_BRANCH: wc-dist

jobs:
Expand Down
22 changes: 21 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ There are also many [community plugins](https://nx.dev/nx-community) you could a
To have more flexibility using Nx tools, you should install Nx CLI.

```shell
npm i -g @nrwl/cli
npm i -g @nx/cli
```

This will make the `nx` command available on your system.
Expand Down Expand Up @@ -131,6 +131,26 @@ You'll need manual configuration to make the application running:
}
```

5. Use the following configuration to allow loading custom translations from the config file:

```ts
import {
// ...
TRANSLATE_WITH_OVERRIDES_CONFIG,
} from '@geonetwork-ui/util/app-config'
@NgModule({
// ...
imports: [
// ...
UtilI18nModule,
TranslateModule.forRoot(TRANSLATE_WITH_OVERRIDES_CONFIG),
],
})
export class AppModule {
// ...
```

Please note that the app configuration is available to be used anywhere else in the application in a synchronous
way since it was loaded beforehand.

Expand Down
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,19 @@ Libraries are organized in the following fashion:
- `data-access-gn4` contains an auto-generated API client for the GeoNetwork 4 backend
- `data-access-datafeeder` contains an auto-generated API client for the Datafeeder backend

4. Libraries providing common services or shared models are in the `util` folder:
4. Libraries providing various utilities in the `util` folder:

- `util-i18n` for translation and internationalization
- `util-data-fetcher` for fetching and querying datasets
- `util-app-config` for parsing and validating application configurations
- `util-shared` for shared models and types, test fixtures, app-wide settings etc.
- `util-i18n` for translation and internationalization

5. Libraries providing common services or shared models are in the `util` folder:

- `common-domain` contains many definitions used across the whole project
- `common-fixtures` contains test fixtures

5. Libraries providing low-level functionalities that can be used both in front and backend are in the `api` folder:
6. Libraries providing low-level functionalities that can be used both in front and backend are in the `api` folder:
- `api-metadata-converter` for providing a pivot metadata model and conversion to interoperable formats

#### `webcomponents`: Embeddable webcomponents
Expand Down
2 changes: 1 addition & 1 deletion apps/data-platform/src/app/dataviz/dataviz.model.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { DatavizConfigurationModel } from '@geonetwork-ui/util/types/data/dataviz-configuration.model'
import { DatavizConfigurationModel } from '@geonetwork-ui/common/domain/dataviz-configuration.model'

export type DatavizConfigModel = DatavizConfigurationModel
6 changes: 3 additions & 3 deletions apps/datahub-e2e/src/e2e/datasets.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,18 +186,18 @@ describe('datasets', () => {
expect(dropdownOptions).to.eql([
'Agence wallonne du Patrimoine (SPW - Territoire, Logement, Patrimoine, Énergie - Agence wallonne du Patrimoine) (1)',
'atmo Hauts-de-France (1)',
'Bundesamt für Raumentwicklung (2)',
'Bundesamt für Raumentwicklung (1)',
"Canton du Valais - Service de l'environnement (SEN) - Protection des sols (1)",
'Cellule informatique et géomatique (SPW - Intérieur et Action sociale - Direction fonctionnelle et d’appui) (1)',
"Direction de l'Action sociale (SPW - Intérieur et Action sociale - Département de l'Action sociale - Direction de l'Action sociale) (1)",
'DREAL (1)',
"DREAL HdF (Direction Régionale de l'Environnement de l'Aménagement et du Logement des Hauts de France) (54)",
"DREAL HdF (Direction Régionale de l'Environnement de l'Aménagement et du Logement des Hauts de France) (1)",
'Géo2France (1)',
"Helpdesk carto du SPW (SPW - Secrétariat général - SPW Digital - Département de la Géomatique - Direction de l'Intégration des géodonnées) (2)",
'Métropole Européenne de Lille (1)',
'Région Hauts-de-France (2)',
'Service public de Wallonie (SPW) (2)',
"Société Publique de Gestion de l'Eau (SPGE) (2)",
"Société Publique de Gestion de l'Eau (SPGE) (1)",
])
})
})
Expand Down
20 changes: 10 additions & 10 deletions apps/datahub-e2e/src/e2e/header.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,34 +97,34 @@ describe('header', () => {
})
})

describe('filter search actions', () => {
describe('filter and sort', () => {
beforeEach(() => {
cy.visit('/search')
cy.get('gn-ui-record-preview-row').as('initialList')
cy.visit('/news')
})

it('should create two filter buttons upon loading page', () => {
cy.get('gn-ui-fuzzy-search')
.next()
.find('button')
.should('have.length', 2)
})

beforeEach(() => {
cy.visit('/search')
cy.get('gn-ui-record-preview-row').as('initialList')
cy.visit('/news')
})

it('should filter results by latest date', () => {
it('should sort results by latest date', () => {
cy.get('gn-ui-fuzzy-search').next().find('button').first().click()
cy.get('gn-ui-record-preview-row').should('not.eq', '@initialList')
cy.get('select#sort-by- option:selected').should(
'have.value',
'-createDate'
'desc,createDate'
)
})
it('should filter results by popularity', () => {
cy.get('gn-ui-fuzzy-search').next().find('button').eq(1).click()
cy.get('gn-ui-record-preview-row').should('not.eq', '@initialList')
cy.get('select#sort-by- option:selected').should(
'have.value',
'-userSavedCount'
'desc,userSavedCount'
)
})
})
Expand Down
Loading

0 comments on commit ba8b141

Please sign in to comment.