Skip to content

Commit

Permalink
Merge pull request #2 from camptocamp/update-gnui
Browse files Browse the repository at this point in the history
chore: update gnui to last version
  • Loading branch information
fgravin authored Jan 17, 2024
2 parents 82598bc + 1bfb043 commit 1d86867
Show file tree
Hide file tree
Showing 10 changed files with 15,133 additions and 10,926 deletions.
5 changes: 1 addition & 4 deletions apps/datahub/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
"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",
"./node_modules/@angular/material/prebuilt-themes/indigo-pink.css"
],
"styles": ["apps/datahub/src/styles.css"],
"scripts": [],
"preserveSymlinks": true,
"allowedCommonJsDependencies": [
Expand Down
48 changes: 25 additions & 23 deletions apps/datahub/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,38 +1,39 @@
import { importProvidersFrom, isDevMode, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouterModule } from '@angular/router';
import { AppComponent } from './app.component';
import { importProvidersFrom, isDevMode, NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { RouterModule } from '@angular/router'
import { AppComponent } from './app.component'
import {
DefaultRouterModule,
EmbeddedTranslateLoader,
FeatureAuthModule,
FeatureCatalogModule,
FeatureSearchModule,
provideGn4,
provideRepositoryUrl,
RouterService,
ThemeService,
TRANSLATE_DEFAULT_CONFIG,
UiWidgetsModule,
} from 'geonetwork-ui';
} from 'geonetwork-ui'
import {
TranslateLoader,
TranslateModule,
TranslateService,
} from '@ngx-translate/core';
import { StoreModule } from '@ngrx/store';
import { EffectsModule } from '@ngrx/effects';
import { StoreRouterConnectingModule } from '@ngrx/router-store';
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
import { SearchPageComponent } from './search/search-page/search-page.component';
import { DatasetPageComponent } from './dataset/dataset-page/dataset-page.component';
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 { HeaderComponent } from './common/header/header.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';
} from '@ngx-translate/core'
import { StoreModule } from '@ngrx/store'
import { EffectsModule } from '@ngrx/effects'
import { StoreRouterConnectingModule } from '@ngrx/router-store'
import { StoreDevtoolsModule } from '@ngrx/store-devtools'
import { SearchPageComponent } from './search/search-page/search-page.component'
import { DatasetPageComponent } from './dataset/dataset-page/dataset-page.component'
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 { HeaderComponent } from './common/header/header.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'

@NgModule({
declarations: [
Expand Down Expand Up @@ -83,15 +84,16 @@ import { MatIconModule } from '@angular/material/icon';
],
providers: [
importProvidersFrom(FeatureAuthModule),
provideGn4(),
provideRepositoryUrl(() => '/geonetwork/srv/api'),
{ provide: RouterService, useClass: AppRouterService },
],
bootstrap: [AppComponent],
})
export class AppModule {
constructor(translate: TranslateService) {
translate.setDefaultLang('fr');
translate.use('fr');
translate.setDefaultLang('fr')
translate.use('fr')

ThemeService.applyCssVariables(
'#E30513',
Expand All @@ -100,6 +102,6 @@ export class AppModule {
'white',
'Lato',
'Montserrat'
);
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ <h1 class="flex justify-center mel-page-title" translate="">
<gn-ui-fuzzy-search
class="w-[645px] text-[17px] pointer-events-auto"
(itemSelected)="onFuzzySearchSelection($event)"
[autoFocus]="true"
></gn-ui-fuzzy-search>
</div>
<div class="h-32"></div>
Expand Down
12 changes: 6 additions & 6 deletions apps/datahub/src/app/home/home-header/home-header.component.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { RouterFacade, SearchService } from 'geonetwork-ui';
import { CatalogRecord } from 'geonetwork-ui/src/libs/common/domain/src/lib/record';
import { SortByField } from 'geonetwork-ui/libs/common/domain/src/lib/search';
import { ChangeDetectionStrategy, Component } from '@angular/core'
import { RouterFacade, SearchService } from 'geonetwork-ui'
import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/model/record'
import { SortByField } from 'geonetwork-ui/libs/common/domain/src/lib/model/search'

@Component({
selector: 'mel-datahub-home-header',
Expand All @@ -23,9 +23,9 @@ export class HomeHeaderComponent {
) {}

onFuzzySearchSelection(record: CatalogRecord) {
this.routerFacade.goToMetadata(record);
this.routerFacade.goToMetadata(record)
}
clearSearchAndSort(sort: SortByField | string): void {
this.searchService.setSortAndFilters({}, sort as SortByField);
this.searchService.setSortAndFilters({}, sort as SortByField)
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { RouterFacade, SearchService } from 'geonetwork-ui';
import { CatalogRecord } from 'geonetwork-ui/src/libs/common/domain/src/lib/record';
import { SortByField } from 'geonetwork-ui/libs/common/domain/src/lib/search';
import { ChangeDetectionStrategy, Component } from '@angular/core'
import { RouterFacade, SearchService } from 'geonetwork-ui'
import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/model/record'
import { SortByField } from 'geonetwork-ui/libs/common/domain/src/lib/model/search'

@Component({
selector: 'mel-datahub-search-header',
Expand All @@ -16,9 +16,9 @@ export class SearchHeaderComponent {
) {}

onFuzzySearchSelection(record: CatalogRecord) {
this.routerFacade.goToMetadata(record);
this.routerFacade.goToMetadata(record)
}
clearSearchAndSort(sort: SortByField | string): void {
this.searchService.setSortAndFilters({}, sort as SortByField);
this.searchService.setSortAndFilters({}, sort as SortByField)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<div class="mt-8">
<gn-ui-results-list-container
showMore="button"
[metadataQualityDisplay]="metadataQualityDisplay"
[metadataQualityDisplay]="true"
(mdSelect)="onMetadataSelection($event)"
></gn-ui-results-list-container>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'
import {
MetadataQualityDisplay,
RouterFacade,
SearchFacade,
} from 'geonetwork-ui'
import { CatalogRecord } from 'geonetwork-ui/src/libs/common/domain/src/lib/record'
import { RouterFacade, SearchFacade } from 'geonetwork-ui'
import { CatalogRecord } from 'geonetwork-ui/libs/common/domain/src/lib/model/record'

@Component({
selector: 'mel-datahub-search-results',
Expand All @@ -14,17 +10,6 @@ import { CatalogRecord } from 'geonetwork-ui/src/libs/common/domain/src/lib/reco
})
export class SearchResultsComponent implements OnInit {
isQualitySortable = true
metadataQualityDisplay = {
widget: true,
title: true,
description: true,
contact: true,
keywords: true,
legalConstraints: true,
topic: true,
updateFrequency: true,
organisation: true,
} as MetadataQualityDisplay

constructor(
private searchRouter: RouterFacade,
Expand Down
4 changes: 2 additions & 2 deletions apps/datahub/src/styles.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@import 'geonetwork-ui/style.css';

@tailwind base;
@tailwind components;
@tailwind utilities;

@import 'geonetwork-ui/style.css';

@layer components {
.mel-page-title {
@apply text-black text-5xl font-extrabold font-title;
Expand Down
Loading

0 comments on commit 1d86867

Please sign in to comment.