From bad011451fc3d02db515b2fc235991949621ad1f Mon Sep 17 00:00:00 2001 From: assafchamoy Date: Thu, 7 Apr 2022 18:33:54 +0300 Subject: [PATCH 1/2] fix: new fields implemetation bugs --- src/models/layerMetadata/bestMetadata.ts | 30 ++++++++++---------- src/models/layerMetadata/layer3DMetadata.ts | 2 +- src/models/layerMetadata/layerDEMMetadata.ts | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/models/layerMetadata/bestMetadata.ts b/src/models/layerMetadata/bestMetadata.ts index cbac79a..8830b6f 100644 --- a/src/models/layerMetadata/bestMetadata.ts +++ b/src/models/layerMetadata/bestMetadata.ts @@ -19,9 +19,9 @@ import { DiscreteOrder } from './discreteOrder'; export interface IBestMetadata { productVersion: string | undefined; - resolution: number | undefined; + maxResolutionDeg: number | undefined; rms: number | undefined; - scale: string | undefined; + scale: number | undefined; discretes: DiscreteOrder[] | undefined; } export interface IPropSHPMapping extends IDataMapping, ITsTypesMapping { @@ -349,13 +349,13 @@ export class BestMetadata implements IBestMetadata, IMetadataCommonModel { //#region COMMON: accuracyCE90 @pycsw({ profile: 'mc_best', - xmlElement: 'mc:horizontalAccuracyCE90', - queryableField: 'mc:horizontalAccuracyCE90', + xmlElement: 'mc:minHorizontalAccuracyCE90', + queryableField: 'mc:minHorizontalAccuracyCE90', pycswField: 'pycsw:horizontalAccuracyCE90', }) @catalogDB({ column: { - name: 'horizontal_accuracy_ce_90', + name: 'min_horizontal_accuracy_ce_90', type: 'real', }, }) @@ -374,7 +374,7 @@ export class BestMetadata implements IBestMetadata, IMetadataCommonModel { isAutoGenerated: true, }) //#endregion - public accuracyCE90: number | undefined = undefined; + public minHorizontalAccuracyCE90: number | undefined = undefined; //#region COMMON: sensors @pycsw({ @@ -407,7 +407,7 @@ export class BestMetadata implements IBestMetadata, IMetadataCommonModel { category: FieldCategory.GENERAL, isManuallyEditable: true, isAutoGenerated: true, - infoMsgCode: ['info-field-tooltip.sensorType.tooltip'], + infoMsgCode: ['info-field-tooltip.sensors.tooltip'], }) //#endregion public sensors: string[] | undefined = undefined; @@ -562,17 +562,17 @@ export class BestMetadata implements IBestMetadata, IMetadataCommonModel { //#endregion public srsName: string | undefined = undefined; - //#region BEST: resolution + //#region BEST: maxResolutionDeg @pycsw({ profile: 'mc_best', - xmlElement: 'mc:resolution', - queryableField: 'mc:resolution', + xmlElement: 'mc:maxResolutionDeg', + queryableField: 'mc:maxResolutionDeg', pycswField: 'pycsw:Resolution', }) @catalogDB({ column: { - name: 'resolution', - type: 'real', // check if 'decimal' type is needed + name: 'max_resolution_deg', + type: 'numeric', }, }) @inputDataMapping({ @@ -590,7 +590,7 @@ export class BestMetadata implements IBestMetadata, IMetadataCommonModel { isAutoGenerated: true, }) //#endregion - public resolution: number | undefined = undefined; + public maxResolutionDeg: number | undefined = undefined; //#region BEST: rms @pycsw({ @@ -629,7 +629,7 @@ export class BestMetadata implements IBestMetadata, IMetadataCommonModel { @catalogDB({ column: { name: 'scale', - type: 'text', + type: 'integer', nullable: true, }, }) @@ -644,7 +644,7 @@ export class BestMetadata implements IBestMetadata, IMetadataCommonModel { nullable: true, }) //#endregion - public scale: string | undefined = undefined; + public scale: number | undefined = undefined; //#region BEST: footprint @pycsw({ diff --git a/src/models/layerMetadata/layer3DMetadata.ts b/src/models/layerMetadata/layer3DMetadata.ts index 4ee98f1..51a77f5 100644 --- a/src/models/layerMetadata/layer3DMetadata.ts +++ b/src/models/layerMetadata/layer3DMetadata.ts @@ -665,7 +665,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { }) @fieldConfig({ category: FieldCategory.GENERAL, - infoMsgCode: ['info-field-tooltip.sensorType.tooltip', 'info-general-tooltip.required'], + infoMsgCode: ['info-field-tooltip.sensors.tooltip', 'info-general-tooltip.required'], validation: [ { errorMsgCode: 'validation-general.required', diff --git a/src/models/layerMetadata/layerDEMMetadata.ts b/src/models/layerMetadata/layerDEMMetadata.ts index ddb7142..1ff6de6 100644 --- a/src/models/layerMetadata/layerDEMMetadata.ts +++ b/src/models/layerMetadata/layerDEMMetadata.ts @@ -368,7 +368,7 @@ export class LayerDemMetadata implements ILayerMetadata, IMetadataCommonModel { }) @fieldConfig({ category: FieldCategory.GENERAL, - infoMsgCode: ['info-field-tooltip.sensorType.tooltip'], + infoMsgCode: ['info-field-tooltip.sensors.tooltip'], }) //#endregion public sensors: string[] | undefined = undefined; From 2a17bf3eab6ba9508d890fb5ce80075db6152f73 Mon Sep 17 00:00:00 2001 From: assafchamoy Date: Sun, 10 Apr 2022 14:08:50 +0300 Subject: [PATCH 2/2] fix: new fields implemetation bugs #2 --- src/models/layerMetadata/bestMetadata.ts | 2 +- src/models/layerMetadata/layer3DMetadata.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/models/layerMetadata/bestMetadata.ts b/src/models/layerMetadata/bestMetadata.ts index 8830b6f..7b54cad 100644 --- a/src/models/layerMetadata/bestMetadata.ts +++ b/src/models/layerMetadata/bestMetadata.ts @@ -638,7 +638,7 @@ export class BestMetadata implements IBestMetadata, IMetadataCommonModel { valuePath: 'features[0].properties.Scale', }) @tsTypes({ - mappingType: TsTypes.STRING, + mappingType: TsTypes.NUMBER, }) @graphql({ nullable: true, diff --git a/src/models/layerMetadata/layer3DMetadata.ts b/src/models/layerMetadata/layer3DMetadata.ts index 51a77f5..64e9459 100644 --- a/src/models/layerMetadata/layer3DMetadata.ts +++ b/src/models/layerMetadata/layer3DMetadata.ts @@ -83,9 +83,7 @@ export class Layer3DMetadata implements ILayer3DMetadata, IMetadataCommonModel { @tsTypes({ mappingType: TsTypes.STRING, }) - @graphql({ - nullable: true, - }) + @graphql() @fieldConfig({ category: FieldCategory.MAIN, isAutoGenerated: true,