Skip to content

Commit

Permalink
fix breaking changes from api v2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
TIL-EBP committed Oct 16, 2024
1 parent 841e484 commit 4e846ae
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
</tr>
@for (attribute of attributes; track attribute.name) {
<tr class="dataset-element-table__table__row">
<td class="dataset-element-table__table__row__column">{{ attribute.name }}</td>
<td class="dataset-element-table__table__row__column" [innerHTML]="attribute.description | formatLineBreaks"></td>
<td class="dataset-element-table__table__row__column">{{ attribute.type }}</td>
<td class="dataset-element-table__table__row__column">{{ attribute.unit }}</td>
<td class="dataset-element-table__table__row__column">{{ attribute.name ?? '-' }}</td>
<td class="dataset-element-table__table__row__column" [innerHTML]="attribute.description ?? '-' | formatLineBreaks"></td>
<td class="dataset-element-table__table__row__column">{{ attribute.type ?? '-' }}</td>
<td class="dataset-element-table__table__row__column">{{ attribute.unit ?? '-' }}</td>
</tr>
}
</table>
Expand Down
4 changes: 2 additions & 2 deletions src/app/data-catalogue/utils/data-extraction.utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('DataExtractionUtils', () => {
zipCode: 2222,
poBox: null,
section: null,
url: 'https://www.example.com',
url: {href: 'https://www.example.com'},
};

const result = DataExtractionUtils.extractContactElements(mockContact);
Expand All @@ -36,7 +36,7 @@ describe('DataExtractionUtils', () => {
{title: 'Tel', value: mockContact.phone, type: 'text'},
{title: 'Tel direkt', value: mockContact.phoneDirect, type: 'text'},
{title: 'E-Mail', value: mockContact.email, type: 'url'},
{title: 'www', value: {href: mockContact.url}, type: 'url'},
{title: 'www', value: mockContact.url, type: 'url'},
];
expect(result).toEqual(expected);
});
Expand Down
2 changes: 1 addition & 1 deletion src/app/data-catalogue/utils/data-extraction.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class DataExtractionUtils {
{title: 'Tel', value: contact.phone, type: 'text'},
{title: 'Tel direkt', value: contact.phoneDirect, type: 'text'},
{title: 'E-Mail', value: contact.email, type: 'url'},
{title: 'www', value: {href: contact.url}, type: 'url'},
{title: 'www', value: contact.url, type: 'url'},
];
}
}
4 changes: 2 additions & 2 deletions src/app/shared/interfaces/gb3-metadata.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ export interface DepartmentalContact {
village: string;
phone: string;
phoneDirect: string;
email: LinkObject;
url: string;
email: LinkObject | null;
url: LinkObject | null;
}

interface BaseMetadataInterface {
Expand Down
6 changes: 3 additions & 3 deletions src/app/shared/interfaces/layer-attributes.interface.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface LayerAttributes {
name: string;
description: string;
type: string;
name: string | null;
description: string | null;
type: string | null;
unit: string | null;
}
82 changes: 42 additions & 40 deletions src/app/shared/models/gb3-api-generated.interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,15 @@ export interface MetadataDatasets {
datasets: Dataset[];
}

export interface MetadataGeoshopProducts {
geoshop_products?: {
/** Geoshop product ID */
giszhnr: number;
/** Link auf Geodatashop bei NOGD-Daten */
url_shop: string | null;
}[];
}

export interface MetadataMap {
map: Map;
}
Expand Down Expand Up @@ -421,6 +430,11 @@ export interface PrintNew {
};
}

export interface PrintReport {
/** Link to report file */
report_url: string;
}

export interface ProductsList {
/** Timestamp of product list in ISO8601 format */
timestamp: string;
Expand Down Expand Up @@ -656,9 +670,9 @@ export interface Contact {
/** Telephon direkt */
telephon_direkt: string;
/** E-Mail */
email: LinkObject;
email: LinkObject | null;
/** URL */
weburl: LinkObject;
weburl: LinkObject | null;
}

export interface Dataset {
Expand Down Expand Up @@ -751,13 +765,13 @@ export interface Dataset {
datenbezugart: string;
attribute: {
/** Attributname */
name: string;
name: string | null;
/** Attributtyp */
typ: string;
typ: string | null;
/** Einheit des Attributwerts */
einheit: string | null;
/** Beschreibung des Attributs */
beschreibung: string;
beschreibung: string | null;
}[];
}[];
services: {
Expand Down Expand Up @@ -968,6 +982,10 @@ export interface Map {
name: string;
/** Beschreibung der Karte */
beschreibung: string;
/** Link to the internet version of the current map */
gbkarten_internet_url: LinkObject | null;
/** Link to the intranet version of the current map (only available whether this api is called from intranet) */
gbkarten_intranet_url: LinkObject | null;
/** Link auf GB2-Karte */
gb2_url: LinkObject | null;
/** Links auf weiterführende Verweise */
Expand Down Expand Up @@ -1121,6 +1139,21 @@ export interface Service {
}[];
}

export interface VectorInputGeneral {
/** GeoJSON file containing FeatureCollection or Feature, or KML file */
file: File;
}

export interface VectorInputGeojson {
/** GeoJSON file containing FeatureCollection or Feature */
file: File;
}

export interface VectorInputKml {
/** KML file */
file: File;
}

/** Vector layer */
export interface VectorLayer {
/** Vector layer type */
Expand Down Expand Up @@ -1207,27 +1240,12 @@ export interface VectorLayerWithoutStyles {

export type CantonListData = Canton;

export interface ImportGeojsonCreatePayload {
/** GeoJSON file containing FeatureCollection or Feature */
file: File;
}

export type ImportGeojsonCreateData = VectorLayer;

export type ExportGeojsonCreateData = GenericGeojsonFeatureCollection;

export interface ImportCreatePayload {
/** GeoJSON file containing FeatureCollection or Feature, or KML file */
file: File;
}

export type ImportCreateData = VectorLayer;

export interface ImportKmlCreatePayload {
/** KML file */
file: File;
}

export type ImportKmlCreateData = VectorLayer;

export type ExportKmlCreateData = any;
Expand All @@ -1242,14 +1260,7 @@ export type MetadataDatasetsListData = MetadataDatasets;

export type MetadataDatasetsDetailData = MetadataDataset;

export interface MetadataGeoshopProductsListData {
geoshop_products: {
/** Geoshop product ID */
giszhnr: number;
/** Link auf Geodatashop bei NOGD-Daten */
url_shop: string | null;
}[];
}
export type MetadataGeoshopProductsListData = MetadataGeoshopProducts;

export type MetadataMapsListData = MetadataMaps;

Expand Down Expand Up @@ -1277,20 +1288,11 @@ export type UserFavoritesDetailData = PersonalFavorite;

export type UserFavoritesDeleteData = any;

export interface PrintCreateData {
/** Link to report file */
report_url: string;
}
export type PrintCreateData = PrintReport;

export interface PrintFeatureInfoCreateData {
/** Link to report file */
report_url: string;
}
export type PrintFeatureInfoCreateData = PrintReport;

export interface PrintLegendCreateData {
/** Link to report file */
report_url: string;
}
export type PrintLegendCreateData = PrintReport;

export type PrintDetailData = any;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ const mockMapDetailResponse = {
topic: 'test-topic',
verweise: [],
gb2_url: null,
gbkarten_internet_url: null,
gbkarten_intranet_url: null,
},
} as MetadataMapsDetailData;

Expand Down Expand Up @@ -153,7 +155,7 @@ const mockDatasetDetailResponse = {
} as MetadataDatasetsDetailData;

const expectedMockDepartmentalContact: DepartmentalContact = {
url: mockContact.weburl.href,
url: mockContact.weburl,
email: mockContact.email,
phoneDirect: mockContact.telephon_direkt,
phone: mockContact.telephon,
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/services/apis/gb3/gb3-metadata.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export class Gb3MetadataService extends Gb3ApiService {
department: contact.amt,
division: contact.fachstelle,
section: contact.sektion,
url: contact.weburl.href,
url: contact.weburl,
street: contact.strassenname,
poBox: contact.postfach,
email: contact.email,
Expand Down

0 comments on commit 4e846ae

Please sign in to comment.