Skip to content

Commit

Permalink
Mise à jour C2C 20 Novembre
Browse files Browse the repository at this point in the history
  • Loading branch information
cdebarros committed Nov 20, 2024
2 parents 55ede83 + de52fb9 commit 59a7ff7
Show file tree
Hide file tree
Showing 113 changed files with 2,381 additions and 482 deletions.
6 changes: 3 additions & 3 deletions apps/datahub-e2e/src/e2e/datasetDetailPage.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ beforeEach(() => {
)
cy.intercept(
'GET',
'/geoserver/insee/ows?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=insee%3Arectangles_200m_menage_erbm&OUTPUTFORMAT=application%2Fjson*',
'/geoserver/insee/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=insee%3Arectangles_200m_menage_erbm&OUTPUTFORMAT=application%2Fjson*',
{
fixture: 'insee-rectangles_200m_menage_erbm.json',
}
)
cy.intercept(
'GET',
'/geoserver/insee/ows?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=insee%3Arectangles_200m_menage_erbm&OUTPUTFORMAT=csv',
'/geoserver/insee/wfs?SERVICE=WFS&REQUEST=GetFeature&VERSION=2.0.0&TYPENAMES=insee%3Arectangles_200m_menage_erbm&OUTPUTFORMAT=csv',
{
fixture: 'insee-rectangles_200m_menage_erbm.csv',
}
Expand Down Expand Up @@ -489,7 +489,7 @@ describe('dataset pages', () => {
.find('gn-ui-download-item')
.first()
.click()
cy.readFile(path.join('cypress/downloads', 'ows.csv')).as(
cy.readFile(path.join('cypress/downloads', 'wfs.csv')).as(
'downloadedFile'
)
cy.get('@downloadedFile').should('exist')
Expand Down
10 changes: 5 additions & 5 deletions apps/datahub-e2e/src/e2e/datasets.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ describe('datasets', () => {
.should('have.length', 1)
cy.screenshot({ capture: 'viewport' })
})
it('should sort by relevance initially', () => {
it('should sort by change date initially', () => {
cy.get('@sortBy')
.getActiveDropdownOption()
.invoke('attr', 'data-cy-value')
.should('equal', 'desc,_score')
.should('equal', 'desc,changeDate')
})
})

Expand Down Expand Up @@ -345,7 +345,7 @@ describe('datasets', () => {

describe('isSpatial filter', () => {
beforeEach(() => {
cy.get('@filters').eq(4).click()
cy.get('@filters').eq(5).click()
getFilterOptions()
})
it('should have options', () => {
Expand Down Expand Up @@ -473,7 +473,7 @@ describe('datasets', () => {
cy.intercept('GET', '/assets/configuration/default.toml', {
fixture: 'config-with-geometry.toml',
})
cy.visit('/search')
cy.visit('/search?_sort=-_score')
})
it('boosts records in the provided geometry', () => {
cy.get('gn-ui-results-list-item')
Expand Down Expand Up @@ -541,7 +541,7 @@ describe('datasets', () => {
cy.get('.cdk-overlay-container')
.find('[role=listbox]')
.find('button')
.should('have.length', 3)
.should('have.length', 4)
})
})

Expand Down
11 changes: 7 additions & 4 deletions apps/datahub/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
FeatureRecordModule,
GN_UI_VERSION,
WEB_COMPONENT_EMBEDDER_URL,
RecordMetaComponent,
} from '@geonetwork-ui/feature/record'
import {
DefaultRouterModule,
Expand Down Expand Up @@ -111,12 +112,12 @@ import {
matCloseOutline,
matEditOutline,
matExpandMoreOutline,
matLocationSearchingOutline,
matMenuOutline,
matMoreHorizOutline,
matRemoveOutline,
matStarOutline,
matMyLocationOutline,
matSendOutline,
matStarOutline,
} from '@ng-icons/material-icons/outline'
import { NgIconsModule, provideNgIconsConfig } from '@ng-icons/core'
import { MatButtonToggleModule } from '@angular/material/button-toggle'
Expand Down Expand Up @@ -194,6 +195,7 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : []
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({
Expand All @@ -206,7 +208,7 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : []
matEditOutline,
matAccountBoxOutline,
matStarOutline,
matMyLocationOutline,
matLocationSearchingOutline,
matSendOutline,
}),
MatButtonToggleModule,
Expand Down Expand Up @@ -284,7 +286,8 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : []
{
provide: BASEMAP_LAYERS,
useFactory: () =>
getOptionalMapConfig()?.MAP_LAYERS.map(getMapContextLayerFromConfig),
getOptionalMapConfig()?.MAP_LAYERS.map(getMapContextLayerFromConfig) ??
[],
},
{
provide: MAP_VIEW_CONSTRAINTS,
Expand Down
23 changes: 17 additions & 6 deletions apps/datahub/src/app/home/home-header/home-header.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
></datahub-navigation-menu>
</div>-->
<div
class="container-lg h-full mx-auto flex flex-col-reverse justify-between sm:flex-col sm:justify-end"
class="container-lg relative h-full mx-auto flex flex-col-reverse justify-between sm:flex-col sm:justify-end"
>
<div
class="py-8 relative z-50 mb-[184px] sm:mb-0"
Expand All @@ -29,7 +29,10 @@
(itemSelected)="onFuzzySearchSelection($event)"
[autoFocus]="true"
></gn-ui-fuzzy-search>
<div class="flex h-0 py-5 gap-3" [style.opacity]="-0.6 + expandRatio * 2">
<div
class="flex flex-wrap h-0 py-5 gap-3"
[style.opacity]="-0.6 + expandRatio * 2"
>
<datahub-header-badge-button
[routerLink]="ROUTE_SEARCH"
*ngIf="isAuthenticated$ | async"
Expand Down Expand Up @@ -77,9 +80,17 @@
></datahub-header-badge-button>
</div>
-->
<!--<div [style.opacity]="-0.6 + expandRatio * 5">
<datahub-navigation-menu
class="tabs flex justify-between font-medium -mx-5 sm:mx-0 sm:mt-32 inset-x-0 bottom-0 z-50"></datahub-navigation-menu>
</div>-->
<gn-ui-language-switcher
*ngIf="showLanguageSwitcher"
class="language-switcher absolute top-3.5 right-6 text-[13px]"
[style.--color-main]="foregroundColor"
[style.--color-gray-300]="foregroundColor"
[style.--color-primary-darker]="foregroundColor"
[style.--color-primary-black]="foregroundColor"
></gn-ui-language-switcher>
</div>
<gn-ui-language-switcher
*ngIf="showLanguageSwitcher"
class="language-switcher absolute top-2.5 left-2.5 text-[13px]"
></gn-ui-language-switcher>
</header>
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class HomeHeaderComponent {
SORT_BY_PARAMS = SortByEnum
searchConfig: SearchConfig = getOptionalSearchConfig()
showLanguageSwitcher = getGlobalConfig().LANGUAGES?.length > 0
foregroundColor = getThemeConfig().HEADER_FOREGROUND_COLOR || '#ffffff'

constructor(
public routerFacade: RouterFacade,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div id="home-page">
<gn-ui-sticky-header [fullHeightPx]="260" [minHeightPx]="90">
<gn-ui-sticky-header [fullHeightPx]="260" [minHeightPx]="150">
<ng-template let-expandRatio>
<datahub-home-header [expandRatio]="expandRatio"></datahub-home-header>
</ng-template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h2 class="text-xl mr-4 font-title" translate>
[ngClass]="{ 'sm:col-span-3 lg:col-span-2': !isOpen }"
>
<div
class="flex flex-row"
class="flex flex-row gap-7 sm:gap-4"
[ngClass]="
isOpen
? 'justify-start sm:justify-end'
Expand Down Expand Up @@ -122,6 +122,7 @@ <h2 class="text-xl mr-4 font-title" translate>
></ng-icon>
</button>
<gn-ui-sort-by
class="overflow-hidden"
[ngClass]="isOpen ? 'block text-white mb-1' : 'hidden sm:block'"
[isQualitySortable]="false"
></gn-ui-sort-by>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
class="language-switcher text-[13px] mt-0.5"
[style.--color-main]="foregroundColor"
[style.--color-gray-300]="foregroundColor"
[style.--color-primary-darker]="foregroundColor"
[style.--color-primary-black]="foregroundColor"
></gn-ui-language-switcher>
</div>
</div>
Expand All @@ -38,18 +40,23 @@
{{ metadata.title }}
</div>
<div
class="flex flex-row flex-wrap gap-4 mb-4 ml-4 sm:mr-[332px]"
class="flex flex-row flex-wrap items-center gap-4 mb-4 ml-4 sm:mr-[332px]"
[style.color]="foregroundColor"
>
<gn-ui-badge
*ngIf="(isGeodata$ | async) === true"
[style.--gn-ui-badge-padding]="'0.5em 0.75em'"
[style.--gn-ui-badge-padding]="'2px 8px'"
[style.--gn-ui-badge-background-color]="'var(--color-primary-darker)'"
[style.--gn-ui-badge-opacity]="'1'"
[style.font-size]="'0.85em'"
class="leading-[1.4em]"
>
<ng-icon class="mr-2" name="matMyLocationOutline"> </ng-icon>
<span class="font-semibold" translate>record.metadata.type</span>
<ng-icon
class="mr-[5px] text-[1em]"
name="matLocationSearchingOutline"
></ng-icon>
<span class="font-semibold text-[12px]" translate
>record.metadata.type</span
>
</gn-ui-badge>
<div *ngIf="metadata.recordUpdated">
<p translate [translateParams]="{ date: lastUpdate }">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/* TODO(mdc-migration): The following rule targets internal classes of tabs that may no longer apply for the MDC version. */
::ng-deep .mat-mdc-tab-labels {
/* move tabs on the right to let the title show */
margin-left: 140px;
}
::ng-deep .mat-mdc-tab.mdc-tab {
letter-spacing: 0.88px;
}
Expand All @@ -16,6 +21,9 @@
}
@media only screen and (max-width: 639px) {
/* TODO(mdc-migration): The following rule targets internal classes of tabs that may no longer apply for the MDC version. */
::ng-deep .mat-mdc-tab-labels {
margin-left: 0px;
}
::ng-deep .mat-mdc-tab.mdc-tab {
padding: 0px !important;
margin-right: 24px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div *ngIf="(metadataViewFacade.error$ | async) === null">
<div
id="about"
class="container-lg px-4 mb-9 mt-8 sm:mb-16 sm:mt-10 lg:mx-auto"
class="container-lg px-4 mb-9 mt-8 sm:mb-16 sm:mt-[51px] lg:mx-auto"
>
<gn-ui-metadata-info
class="sm:block"
Expand All @@ -23,8 +23,9 @@
>
</gn-ui-metadata-info>
</div>
<div class="sm:-mt-44">
<div class="sm:mt-[-185px]">
<gn-ui-image-overlay-preview
class="block h-[185px] mb-5"
[imageUrl]="thumbnailUrl$ | async"
(isPlaceholderShown)="showOverlay = !$event"
*ngIf="showOverlay"
Expand All @@ -44,7 +45,10 @@
[metadataQualityDisplay]="metadataQualityDisplay"
></gn-ui-metadata-quality>
</div>
<gn-ui-metadata-catalog [sourceLabel]="sourceLabel$ | async">
<gn-ui-metadata-catalog
*ngIf="sourceLabel$ | async as sourceLabel"
[sourceLabel]="sourceLabel"
>
</gn-ui-metadata-catalog>
</div>
</div>
Expand All @@ -63,7 +67,6 @@
<div
class="text-[28px] text-title font-title transform sm:translate-y-10"
translate
id="preview"
>
record.metadata.preview
</div>
Expand All @@ -76,9 +79,7 @@
>
<mat-tab [disabled]="(displayMap$ | async) === false">
<ng-template mat-tab-label>
<span class="tab-header-label sm:ml-32" translate
>record.tab.map</span
>
<span class="tab-header-label" translate>record.tab.map</span>
</ng-template>
<div
class="block"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<div id="record-page" class="overflow-hidden">
<gn-ui-record-meta
[metadata]="mdViewFacade.metadata$ | async"
></gn-ui-record-meta>
<datahub-header-record
[metadata]="mdViewFacade.metadata$ | async"
></datahub-header-record>
Expand Down
7 changes: 2 additions & 5 deletions apps/metadata-editor-e2e/src/e2e/dashboard.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,8 @@ describe('dashboard (authenticated)', () => {
.as('abstractField')
.focus()
cy.get('@abstractField').type('draft abstract')
cy.editor_readFormUniqueIdentifier().then((recordUuid) => {
cy.window()
.its('localStorage')
.invoke('getItem', `geonetwork-ui-draft-${recordUuid}`)
.should('contain', 'draft abstract')
cy.editor_findDraftInLocalStorage().then((value) => {
expect(value).to.contain('draft abstract')
})
cy.visit('/my-space/my-draft')
cy.get('gn-ui-results-table').find('[data-cy="table-row"]').as('draft')
Expand Down
Loading

0 comments on commit 59a7ff7

Please sign in to comment.