Skip to content

Commit

Permalink
feat: set standalone comp, remove template
Browse files Browse the repository at this point in the history
  • Loading branch information
f-necas committed Nov 19, 2024
1 parent 542b3e9 commit c8b3943
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
2 changes: 2 additions & 0 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 @@ -188,6 +189,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 Down
1 change: 1 addition & 0 deletions libs/feature/record/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export * from './lib/data-view-share/data-view-share.component'
export * from './lib/data-view-web-component/data-view-web-component.component'
export * from './lib/external-viewer-button/external-viewer-button.component'
export * from './lib/map-view/map-view.component'
export * from './lib/record-meta/record-meta.component'
3 changes: 0 additions & 3 deletions libs/feature/record/src/lib/feature-record.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import { DataViewWebComponentComponent } from './data-view-web-component/data-vi
import { DataViewShareComponent } from './data-view-share/data-view-share.component'
import { NgIconsModule, provideNgIconsConfig } from '@ng-icons/core'
import { matClose, matOpenInNew } from '@ng-icons/material-icons/baseline'
import { RecordMetaComponent } from './record-meta/record-meta.component'

@NgModule({
declarations: [
Expand All @@ -43,7 +42,6 @@ import { RecordMetaComponent } from './record-meta/record-meta.component'
DataViewPermalinkComponent,
DataViewWebComponentComponent,
DataViewShareComponent,
RecordMetaComponent,
],
imports: [
CommonModule,
Expand Down Expand Up @@ -82,7 +80,6 @@ import { RecordMetaComponent } from './record-meta/record-meta.component'
DataViewWebComponentComponent,
DataViewShareComponent,
ExternalViewerButtonComponent,
RecordMetaComponent,
],
})
export class FeatureRecordModule {}
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { ComponentFixture, TestBed } from '@angular/core/testing'
import { RecordMetaComponent } from './record-meta.component'
import { MockBuilder } from 'ng-mocks'

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

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [RecordMetaComponent],
imports: [],
declarations: [],
imports: [RecordMetaComponent],
providers: [],
}).compileComponents()
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
import {
AfterViewInit,
ChangeDetectionStrategy,
Component,
Input,
OnChanges,
OnDestroy,
} from '@angular/core'
import { Meta } from '@angular/platform-browser'
import {
DatasetRecord,
ServiceRecord,
} from '@geonetwork-ui/common/domain/model/record'
import { DatasetRecord } from '@geonetwork-ui/common/domain/model/record'

@Component({
selector: 'gn-ui-record-meta',
template: '<>',
template: '',
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
})
export class RecordMetaComponent implements OnDestroy, OnChanges {
@Input() metadata: DatasetRecord
Expand Down

0 comments on commit c8b3943

Please sign in to comment.