File
Methods
|
Private
disaggParams
|
disaggParams()
|
|
|
|
Returns : Params
|
|
Private
dynamicParams
|
dynamicParams()
|
|
|
|
Returns : Params
|
|
Private
modelMapsParams
|
modelMapsParams()
|
|
|
|
Returns : Params
|
|
Private
ratesParams
|
ratesParams()
|
|
|
|
Returns : Params
|
|
Private
rtgmParams
|
rtgmParams()
|
|
|
|
Returns : Params
|
|
connectedApplications
|
Type : ConnectedApplication[]
|
Default value : [
{
application: apps().hazard.dynamic,
description: 'Open the dynamic hazard application using the current NSHM',
queryParams: () => this.dynamicParams(),
},
{
application: apps().hazard.disagg,
description: 'Open the disaggregation application using the current NSHM',
queryParams: () => this.disaggParams(),
},
{
application: apps().designMaps.rtgm,
description: 'Open the RTGM application using the current NSHM',
queryParams: () => this.rtgmParams(),
},
{
application: apps().source.modelMaps,
description: 'Open the model maps application using the current NSHM',
queryParams: () => this.modelMapsParams(),
},
{
application: apps().source.rateAndProbability,
description: 'Open the rates and probabilities application using the current NSHM',
queryParams: () => this.ratesParams(),
},
]
|
|
|
|
Private
formGroup
|
Default value : this.service.formGroup
|
|
|
|
Private
service
|
Default value : inject(AppService)
|
|
|
import {ChangeDetectionStrategy, Component, inject} from '@angular/core';
import {Params} from '@angular/router';
import {ConnectedApplication, NshmpConnectedApplicationsComponent} from '@ghsc/nshmp-lib-ng/nshmp';
import {ControlType} from 'projects/nshmp-apps/src/app/designmaps/rtgm/models/control-type.model';
import {RtgmDynamicHazardQuey} from 'projects/nshmp-apps/src/app/designmaps/rtgm/models/rtgm-query.model';
import {DisaggQuery} from 'projects/nshmp-apps/src/app/hazard/disagg/models/disagg-query.model';
import {DynamicHazardQuery} from 'projects/nshmp-apps/src/app/hazard/dynamic/models/query.model';
import {apps} from 'projects/nshmp-apps/src/shared/utils/applications.utils';
import {ModelMapsQuery} from '../../../model-maps/models/model-maps-query.model';
import {RatesControlForm} from '../../../rates/models/control-form.model';
import {AppService} from '../../services/app.service';
@Component({
changeDetection: ChangeDetectionStrategy.OnPush,
imports: [NshmpConnectedApplicationsComponent],
selector: 'app-connected-applications',
styleUrl: './connected-applications.component.scss',
templateUrl: './connected-applications.component.html',
})
export class ConnectedApplicationsComponent {
private service = inject(AppService);
private formGroup = this.service.formGroup;
connectedApplications: ConnectedApplication[] = [
{
application: apps().hazard.dynamic,
description: 'Open the dynamic hazard application using the current NSHM',
queryParams: () => this.dynamicParams(),
},
{
application: apps().hazard.disagg,
description: 'Open the disaggregation application using the current NSHM',
queryParams: () => this.disaggParams(),
},
{
application: apps().designMaps.rtgm,
description: 'Open the RTGM application using the current NSHM',
queryParams: () => this.rtgmParams(),
},
{
application: apps().source.modelMaps,
description: 'Open the model maps application using the current NSHM',
queryParams: () => this.modelMapsParams(),
},
{
application: apps().source.rateAndProbability,
description: 'Open the rates and probabilities application using the current NSHM',
queryParams: () => this.ratesParams(),
},
];
private disaggParams(): Params {
const values = this.formGroup.getRawValue();
const queryParams: Partial<DisaggQuery> = {
model: values.model,
};
return queryParams;
}
private dynamicParams(): Params {
const values = this.formGroup.getRawValue();
const params: Partial<DynamicHazardQuery> = {
model: values.model,
};
return params;
}
private modelMapsParams(): Params {
const values = this.formGroup.getRawValue();
const params: Partial<ModelMapsQuery> = {
model: values.model,
};
return params;
}
private ratesParams(): Params {
const values = this.formGroup.getRawValue();
const params: Partial<RatesControlForm> = {
model: values.model,
};
return params;
}
private rtgmParams(): Params {
const values = this.formGroup.getRawValue();
const params: Partial<RtgmDynamicHazardQuey> = {
controlType: ControlType.DYNAMIC_HAZARD,
model: values.model,
};
return params;
}
}
<nshmp-connected-applications [applications]="connectedApplications" />
Legend
Html element with directive