Skip to content

Commit

Permalink
update datahub avec le main
Browse files Browse the repository at this point in the history
  • Loading branch information
cdebarros committed Jan 10, 2025
2 parents 59a7ff7 + 17894ab commit 235e384
Show file tree
Hide file tree
Showing 374 changed files with 6,011 additions and 3,270 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ Please only check items relevant to your contribution. Thank you very much for y
Please give credit to the sponsor of this work if possible.
-->

**This work is sponsored by [Organization ABC](xx)**.
<!-- **This work is sponsored by [Organization ABC](xx)**. -->
6 changes: 5 additions & 1 deletion apps/datafeeder/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { BrowserModule } from '@angular/platform-browser'
import { importProvidersFrom, NgModule } from '@angular/core'
import { ApiModule, Configuration } from '@geonetwork-ui/data-access/datafeeder'
import { UiWidgetsModule } from '@geonetwork-ui/ui/widgets'
import {
ProgressBarComponent,
UiWidgetsModule,
} from '@geonetwork-ui/ui/widgets'
import { StoreModule } from '@ngrx/store'
import { StoreDevtoolsModule } from '@ngrx/store-devtools'
import { environment } from '../environments/environment'
Expand Down Expand Up @@ -84,6 +87,7 @@ export function apiConfigurationFactory() {
[DATAFEEDER_STATE_KEY]: reducer,
}),
!environment.production ? StoreDevtoolsModule.instrument() : [],
ProgressBarComponent,
],
providers: [importProvidersFrom(FeatureAuthModule)],
bootstrap: [AppComponent],
Expand Down
8 changes: 5 additions & 3 deletions apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,12 @@ describe('dataset pages', () => {
.children('button')
.should('have.length.gt', 1)
})
it('should display the map', () => {
it('should display the map and the legend', () => {
cy.get('@previewSection')
.find('gn-ui-map-container')
.should('be.visible')

cy.get('@previewSection').find('gn-ui-map-legend').should('be.visible')
})
it('should display the table', () => {
cy.get('@previewSection')
Expand Down Expand Up @@ -529,12 +531,12 @@ describe('dataset pages', () => {
})
it('should not display carousel dot button for 4 link cards', () => {
cy.get('datahub-record-otherlinks')
.find('.carousel-step-dot')
.find('.pagination-dot')
.should('exist')
})
it('should not display carousel dot button for 2 API cards', () => {
cy.get('datahub-record-apis')
.find('.carousel-step-dot')
.find('.pagination-dot')
.should('not.exist')
})
})
Expand Down
50 changes: 9 additions & 41 deletions apps/datahub/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { BrowserModule } from '@angular/platform-browser'
import { Router, RouterModule } from '@angular/router'
import {
FeatureCatalogModule,
OrganisationsComponent,
ORGANIZATION_PAGE_URL_TOKEN,
ORGANIZATION_URL_TOKEN,
} from '@geonetwork-ui/feature/catalog'
Expand All @@ -29,19 +30,11 @@ import {
RECORD_URL_TOKEN,
} from '@geonetwork-ui/feature/search'
import {
LinkCardComponent,
THUMBNAIL_PLACEHOLDER,
UiElementsModule,
} from '@geonetwork-ui/ui/elements'
import {
PreviousNextButtonsComponent,
UiInputsModule,
} from '@geonetwork-ui/ui/inputs'
import {
BlockListComponent,
CarouselComponent,
UiLayoutModule,
} from '@geonetwork-ui/ui/layout'
import { UiInputsModule } from '@geonetwork-ui/ui/inputs'
import { UiLayoutModule } from '@geonetwork-ui/ui/layout'
import { UiSearchModule } from '@geonetwork-ui/ui/search'
import { IgnApiDlComponent } from '@geonetwork-ui/feature/record'

Expand Down Expand Up @@ -76,29 +69,25 @@ import { NewsPageComponent } from './home/news-page/news-page.component'
import { OrganisationsPageComponent } from './home/organisations-page/organisations-page.component'
import { SearchPageComponent } from './home/search/search-page/search-page.component'
import { SearchFiltersComponent } from './home/search/search-filters/search-filters.component'
import { HeaderRecordComponent } from './record/header-record/header-record.component'
import { NavigationBarComponent } from './record/navigation-bar/navigation-bar.component'
import { RecordPageComponent } from './record/record-page/record-page.component'
import { DatahubRouterService } from './router/datahub-router.service'
import { NavigationMenuComponent } from './home/navigation-menu/navigation-menu.component'
import { FormsModule } from '@angular/forms'
import { UiDatavizModule } from '@geonetwork-ui/ui/dataviz'
import { LANGUAGES_LIST, UiCatalogModule } from '@geonetwork-ui/ui/catalog'
import {
LANGUAGES_LIST,
LanguageSwitcherComponent,
} from '@geonetwork-ui/ui/catalog'
import {
LOGIN_URL,
METADATA_LANGUAGE,
provideGn4,
provideRepositoryUrl,
} from '@geonetwork-ui/api/repository'
import { BrowserAnimationsModule } from '@angular/platform-browser/animations'
import { RecordRelatedRecordsComponent } from './record/record-related-records/record-related-records.component'
import { RecordMetadataComponent } from './record/record-metadata/record-metadata.component'
import { RecordOtherlinksComponent } from './record/record-otherlinks/record-otherlinks.component'
import { RecordDownloadsComponent } from './record/record-downloads/record-downloads.component'
import { RecordApisComponent } from './record/record-apis/record-apis.component'
import { MatTabsModule } from '@angular/material/tabs'
import { UiWidgetsModule } from '@geonetwork-ui/ui/widgets'
import { RecordUserFeedbacksComponent } from './record/record-user-feedbacks/record-user-feedbacks.component'
import { LetDirective } from '@ngrx/component'
import { OrganizationPageComponent } from './organization/organization-page/organization-page.component'
import {
Expand All @@ -107,16 +96,11 @@ import {
MAP_VIEW_CONSTRAINTS,
} from '@geonetwork-ui/ui/map'
import {
matAccountBoxOutline,
matAddOutline,
matCloseOutline,
matEditOutline,
matExpandMoreOutline,
matLocationSearchingOutline,
matMenuOutline,
matMoreHorizOutline,
matRemoveOutline,
matSendOutline,
matStarOutline,
} from '@ng-icons/material-icons/outline'
import { NgIconsModule, provideNgIconsConfig } from '@ng-icons/core'
Expand All @@ -134,8 +118,6 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : []
HomePageComponent,
HomeHeaderComponent,
HeaderBadgeButtonComponent,
HeaderRecordComponent,
RecordPageComponent,
SearchFiltersComponent,
NavigationBarComponent,
NewsPageComponent,
Expand All @@ -144,12 +126,6 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : []
LastCreatedComponent,
KeyFiguresComponent,
NavigationMenuComponent,
RecordRelatedRecordsComponent,
RecordUserFeedbacksComponent,
RecordMetadataComponent,
RecordOtherlinksComponent,
RecordDownloadsComponent,
RecordApisComponent,
],
imports: [
BrowserModule,
Expand Down Expand Up @@ -188,29 +164,21 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : []
UiDatavizModule,
FormsModule,
UiInputsModule,
UiCatalogModule,
MatTabsModule,
UiWidgetsModule,
LinkCardComponent,
CarouselComponent,
BlockListComponent,
PreviousNextButtonsComponent,
RecordMetaComponent,
LetDirective,
// FIXME: these imports are required by non-standalone components and should be removed once all components have been made standalone
NgIconsModule.withIcons({
matMenuOutline,
matRemoveOutline,
matCloseOutline,
matMoreHorizOutline,
matAddOutline,
matExpandMoreOutline,
matEditOutline,
matAccountBoxOutline,
matStarOutline,
matLocationSearchingOutline,
matSendOutline,
}),
OrganisationsComponent,
LanguageSwitcherComponent,
MatButtonToggleModule,
MatIconModule,
DsfrHeaderModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@
<gn-ui-previous-next-buttons
data-test="orgDetailsNavBtn"
*ngIf="hasPagination"
[isFirst]="isFirstPage"
[isLast]="isLastPage"
(directionButtonClicked)="changeStepOrPage($event)"
[listComponent]="this"
></gn-ui-previous-next-buttons>
<div class="ml-auto">
<a
Expand Down Expand Up @@ -107,20 +105,11 @@
[extraClass]="'w-[300px]'"
></gn-ui-related-record-card>
</div>
<div
*ngIf="totalPages > 1"
class="flex flex-row justify-center gap-[14px] p-1 mx-auto"
[ngClass]="paginationContainerClass"
<gn-ui-pagination-dots
[listComponent]="this"
[containerClass]="paginationContainerClass"
>
<button
*ngFor="let page of pages"
class="list-page-dot"
(click)="goToPage(page)"
[ngClass]="
currentPage === page ? 'bg-primary' : 'bg-gray-400'
"
></button>
</div>
</gn-ui-pagination-dots>
</ng-container>

<ng-container *ngIf="isSearchFacadeLoading">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
DebugElement,
NO_ERRORS_SCHEMA,
} from '@angular/core'
import { ChangeDetectionStrategy, DebugElement } from '@angular/core'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { SearchFacade } from '@geonetwork-ui/feature/search'
import { TranslateModule } from '@ngx-translate/core'
Expand All @@ -14,33 +9,13 @@ import {
datasetRecordsFixture,
someOrganizationsFixture,
} from '@geonetwork-ui/common/fixtures'
import { AsyncPipe, NgForOf, NgIf } from '@angular/common'
import {
ButtonComponent,
PreviousNextButtonsComponent,
} from '@geonetwork-ui/ui/inputs'
import {
BlockListComponent,
CarouselComponent,
MaxLinesComponent,
} from '@geonetwork-ui/ui/layout'
import { LetDirective } from '@ngrx/component'
import { LinkCardComponent, UiElementsModule } from '@geonetwork-ui/ui/elements'
import { UiSearchModule } from '@geonetwork-ui/ui/search'
import { UiDatavizModule } from '@geonetwork-ui/ui/dataviz'
import { RouterLink } from '@angular/router'
import { UiWidgetsModule } from '@geonetwork-ui/ui/widgets'
import { Organization } from '@geonetwork-ui/common/domain/model/record'
import { RouterTestingModule } from '@angular/router/testing'
import { By } from '@angular/platform-browser'
import { ROUTER_ROUTE_SEARCH } from '@geonetwork-ui/feature/router'

let getHTMLElement: (dataTest: string) => HTMLElement | undefined

const changeDetectorRefMock: Partial<ChangeDetectorRef> = {
markForCheck: jest.fn(),
}

class OrganisationsServiceMock {
getFiltersForOrgs = jest.fn((orgs) =>
of({
Expand All @@ -58,7 +33,7 @@ const manyDatasets = datasetRecordsFixture().concat(datasetRecordsFixture()[0])

const organizationIsLoading = new BehaviorSubject(false)
const totalPages = new BehaviorSubject(10)
const currentPage = new BehaviorSubject(0)
const currentPage = new BehaviorSubject(1)
const results = new BehaviorSubject(manyDatasets)

const desiredPageSize = 3
Expand All @@ -72,11 +47,9 @@ class SearchFacadeMock {
results$ = results.asObservable()
isLoading$ = organizationIsLoading.asObservable()
totalPages$ = totalPages.asObservable()
isBeginningOfResults$ = of(currentPage.getValue() === 1)
isEndOfResults$ = of(totalPages.getValue() === currentPage.getValue())
currentPage$ = currentPage.asObservable()
paginate = jest.fn(() => {
currentPage.next(currentPage.getValue() + 1)
paginate = jest.fn((newPage) => {
currentPage.next(newPage)
return new SearchFacadeMock()
})
}
Expand All @@ -89,25 +62,8 @@ describe('OrganizationDetailsComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [],
schemas: [NO_ERRORS_SCHEMA],
imports: [
AsyncPipe,
NgIf,
ButtonComponent,
TranslateModule,
CarouselComponent,
BlockListComponent,
LetDirective,
LinkCardComponent,
NgForOf,
PreviousNextButtonsComponent,
UiElementsModule,
UiSearchModule,
MaxLinesComponent,
UiDatavizModule,
RouterLink,
UiWidgetsModule,
OrganizationDetailsComponent,
TranslateModule.forRoot(),
RouterTestingModule,
],
Expand All @@ -120,10 +76,6 @@ describe('OrganizationDetailsComponent', () => {
provide: SearchFacade,
useClass: SearchFacadeMock,
},
{
provide: ChangeDetectorRef,
useValue: changeDetectorRefMock,
},
],
})
.overrideComponent(OrganizationDetailsComponent, {
Expand Down
Loading

0 comments on commit 235e384

Please sign in to comment.