Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ronitjadhav committed Dec 3, 2024
2 parents 0287f7c + a731fc6 commit 2c360a2
Show file tree
Hide file tree
Showing 199 changed files with 1,414 additions and 1,552 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
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 {
getGlobalConfig,
Expand Down Expand Up @@ -74,29 +67,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 @@ -105,16 +94,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 @@ -128,8 +112,6 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : []
HomePageComponent,
HomeHeaderComponent,
HeaderBadgeButtonComponent,
HeaderRecordComponent,
RecordPageComponent,
SearchFiltersComponent,
NavigationBarComponent,
NewsPageComponent,
Expand All @@ -138,12 +120,6 @@ export const metaReducers: MetaReducer[] = !environment.production ? [] : []
LastCreatedComponent,
KeyFiguresComponent,
NavigationMenuComponent,
RecordRelatedRecordsComponent,
RecordUserFeedbacksComponent,
RecordMetadataComponent,
RecordOtherlinksComponent,
RecordDownloadsComponent,
RecordApisComponent,
],
imports: [
BrowserModule,
Expand Down Expand Up @@ -182,29 +158,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,
],
providers: [
provideNgIconsConfig({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
OnInit,
ViewChild,
} from '@angular/core'
import { AsyncPipe, NgClass, NgForOf, NgIf } from '@angular/common'
import { CommonModule } from '@angular/common'
import {
CatalogRecord,
Organization,
Expand All @@ -23,8 +23,10 @@ import {
} from '@geonetwork-ui/ui/layout'
import { LetDirective } from '@ngrx/component'
import {
ErrorComponent,
ErrorType,
LinkCardComponent,
RelatedRecordCardComponent,
UiElementsModule,
} from '@geonetwork-ui/ui/elements'
import { UiSearchModule } from '@geonetwork-ui/ui/search'
Expand All @@ -41,7 +43,10 @@ import { UiDatavizModule } from '@geonetwork-ui/ui/dataviz'
import { RouterLink } from '@angular/router'
import { ROUTER_ROUTE_SEARCH } from '@geonetwork-ui/feature/router'
import { OrganizationsServiceInterface } from '@geonetwork-ui/common/domain/organizations.service.interface'
import { UiWidgetsModule } from '@geonetwork-ui/ui/widgets'
import {
SpinningLoaderComponent,
UiWidgetsModule,
} from '@geonetwork-ui/ui/widgets'
import { startWith } from 'rxjs/operators'

@Component({
Expand All @@ -51,23 +56,23 @@ import { startWith } from 'rxjs/operators'
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
AsyncPipe,
NgIf,
CommonModule,
ButtonComponent,
TranslateModule,
CarouselComponent,
BlockListComponent,
LetDirective,
LinkCardComponent,
NgForOf,
PreviousNextButtonsComponent,
UiElementsModule,
UiSearchModule,
MaxLinesComponent,
UiDatavizModule,
RouterLink,
UiWidgetsModule,
NgClass,
ErrorComponent,
SpinningLoaderComponent,
RelatedRecordCardComponent,
],
})
export class OrganizationDetailsComponent implements OnInit, OnDestroy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'
import { OrganizationHeaderComponent } from './organization-header.component'
import { UiInputsModule } from '@geonetwork-ui/ui/inputs'
import { TranslateModule } from '@ngx-translate/core'
import { UiCatalogModule } from '@geonetwork-ui/ui/catalog'
import { AsyncPipe, Location, NgIf } from '@angular/common'
import { someOrganizationsFixture } from '@geonetwork-ui/common/fixtures'

Expand Down Expand Up @@ -33,7 +32,6 @@ describe('OrganizationHeaderComponent', () => {
OrganizationHeaderComponent,
UiInputsModule,
TranslateModule,
UiCatalogModule,
NgIf,
AsyncPipe,
TranslateModule.forRoot(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
import { getGlobalConfig, getThemeConfig } from '@geonetwork-ui/util/app-config'
import { TranslateModule } from '@ngx-translate/core'
import { UiInputsModule } from '@geonetwork-ui/ui/inputs'
import { UiCatalogModule } from '@geonetwork-ui/ui/catalog'
import {
NavigationButtonComponent,
UiInputsModule,
} from '@geonetwork-ui/ui/inputs'
import { Organization } from '@geonetwork-ui/common/domain/model/record'
import { AsyncPipe, Location, NgIf } from '@angular/common'
import { ErrorType, UiElementsModule } from '@geonetwork-ui/ui/elements'
Expand All @@ -16,6 +18,8 @@ import {
matFolderOutline,
matOpenInNewOutline,
} from '@ng-icons/material-icons/outline'
import { LanguageSwitcherComponent } from '@geonetwork-ui/ui/catalog'
import { matArrowBack } from '@ng-icons/material-icons/baseline'

@Component({
selector: 'datahub-organization-header',
Expand All @@ -26,14 +30,15 @@ import {
imports: [
UiInputsModule,
TranslateModule,
UiCatalogModule,
NgIf,
AsyncPipe,
UiElementsModule,
NgIconComponent,
LanguageSwitcherComponent,
NavigationButtonComponent,
],
providers: [
provideIcons({ matFolderOutline, matOpenInNewOutline }),
provideIcons({ matFolderOutline, matOpenInNewOutline, matArrowBack }),
provideNgIconsConfig({
size: '1.5em',
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { NO_ERRORS_SCHEMA } from '@angular/core'
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { datasetRecordsFixture } from '@geonetwork-ui/common/fixtures'
import { MdViewFacade } from '@geonetwork-ui/feature/record'
import { SearchService } from '@geonetwork-ui/feature/search'
import { TranslateModule } from '@ngx-translate/core'
import { BehaviorSubject } from 'rxjs'

import { HeaderRecordComponent } from './header-record.component'
import { MockBuilder, MockProvider } from 'ng-mocks'
import { DatasetRecord } from '@geonetwork-ui/common/domain/model/record'
import { MdViewFacade } from '@geonetwork-ui/feature/record'

jest.mock('@geonetwork-ui/util/app-config', () => ({
getThemeConfig: () => ({
Expand All @@ -20,30 +20,20 @@ jest.mock('@geonetwork-ui/util/app-config', () => ({
},
}))

const searchServiceMock = {
updateFilters: jest.fn(),
}

class MdViewFacadeMock {
mapApiLinks$ = new BehaviorSubject([])
geoDataLinks$ = new BehaviorSubject([])
}

describe('HeaderRecordComponent', () => {
let component: HeaderRecordComponent
let fixture: ComponentFixture<HeaderRecordComponent>

beforeEach(() => MockBuilder(HeaderRecordComponent))

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [HeaderRecordComponent],
imports: [TranslateModule.forRoot()],
schemas: [NO_ERRORS_SCHEMA],
providers: [
{ provide: SearchService, useValue: searchServiceMock },
{
provide: MdViewFacade,
useClass: MdViewFacadeMock,
},
MockProvider(MdViewFacade),
MockProvider(SearchService, {
updateFilters: jest.fn(),
}),
],
}).compileComponents()
})
Expand All @@ -53,7 +43,7 @@ describe('HeaderRecordComponent', () => {
component = fixture.componentInstance
component.metadata = {
...datasetRecordsFixture()[0],
}
} as DatasetRecord
fixture.detectChanges()
})

Expand All @@ -63,8 +53,9 @@ describe('HeaderRecordComponent', () => {

describe('#back', () => {
it('searchFilter updateSearch', () => {
const searchService = TestBed.inject(SearchService)
component.back()
expect(searchServiceMock.updateFilters).toHaveBeenCalledWith({})
expect(searchService.updateFilters).toHaveBeenCalledWith({})
})
})
})
Original file line number Diff line number Diff line change
@@ -1,16 +1,39 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'
import { SearchService } from '@geonetwork-ui/feature/search'
import {
FavoriteStarComponent,
SearchService,
} from '@geonetwork-ui/feature/search'
import { getGlobalConfig, getThemeConfig } from '@geonetwork-ui/util/app-config'
import { DatasetRecord } from '@geonetwork-ui/common/domain/model/record'
import { MdViewFacade } from '@geonetwork-ui/feature/record'
import { combineLatest, map } from 'rxjs'
import { TranslateService } from '@ngx-translate/core'
import { TranslateModule, TranslateService } from '@ngx-translate/core'
import {
BadgeComponent,
NavigationButtonComponent,
} from '@geonetwork-ui/ui/inputs'
import { LanguageSwitcherComponent } from '@geonetwork-ui/ui/catalog'
import { CommonModule } from '@angular/common'
import { NgIcon, provideIcons } from '@ng-icons/core'
import { matLocationSearchingOutline } from '@ng-icons/material-icons/outline'
import { matArrowBack } from '@ng-icons/material-icons/baseline'

@Component({
selector: 'datahub-header-record',
templateUrl: './header-record.component.html',
styleUrls: ['./header-record.component.css'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
CommonModule,
NavigationButtonComponent,
LanguageSwitcherComponent,
TranslateModule,
FavoriteStarComponent,
BadgeComponent,
NgIcon,
],
viewProviders: [provideIcons({ matLocationSearchingOutline, matArrowBack })],
})
export class HeaderRecordComponent {
@Input() metadata: DatasetRecord
Expand Down
Loading

0 comments on commit 2c360a2

Please sign in to comment.