Skip to content

Commit 375166a

Browse files
authored
fix(resource): reinit representationsToDisplay array to fix undefined issue in template (#813)
1 parent c97c569 commit 375166a

5 files changed

Lines changed: 72 additions & 0 deletions

File tree

‎angular.json‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,22 @@
122122
"vendorChunk": false,
123123
"buildOptimizer": false,
124124
"budgets": []
125+
},
126+
"staging-server": {
127+
"fileReplacements": [
128+
{
129+
"replace": "src/environments/environment.ts",
130+
"with": "src/environments/environment.staging-server.ts"
131+
}
132+
],
133+
"optimization": false,
134+
"sourceMap": true,
135+
"namedChunks": true,
136+
"aot": true,
137+
"extractLicenses": false,
138+
"vendorChunk": false,
139+
"buildOptimizer": false,
140+
"budgets": []
125141
}
126142
}
127143
},
@@ -142,6 +158,9 @@
142158
},
143159
"ls-test-server": {
144160
"browserTarget": "dsp-app:build:ls-test-server"
161+
},
162+
"staging-server": {
163+
"browserTarget": "dsp-app:build:staging-server"
145164
}
146165
}
147166
},
@@ -198,6 +217,9 @@
198217
},
199218
"ls-test-server": {
200219
"devServerTarget": "dsp-app:serve:ls-test-server"
220+
},
221+
"staging-server": {
222+
"devServerTarget": "dsp-app:serve:staging-server"
201223
}
202224
}
203225
}

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"start": "ng serve",
1111
"start-with-test-server": "ng serve --configuration test-server",
1212
"start-with-ls-test-server": "ng serve --configuration ls-test-server",
13+
"start-with-staging-server": "ng serve --configuration staging-server",
1314
"lint-ci": "eslint --color -c .eslintrc.js --ext .ts ./src/app",
1415
"lint-local": "eslint --color --fix -c .eslintrc.js --ext .ts ./src/app",
1516
"e2e": "ng e2e",

‎src/app/workspace/resource/resource.component.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ export class ResourceComponent implements OnInit, OnChanges, OnDestroy {
550550

551551
} else {
552552
this.loading = false;
553+
this.representationsToDisplay = [];
553554
}
554555
},
555556
(error: ApiResponseError) => {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"dspRelease": "2022.01.01",
3+
"apiProtocol": "https",
4+
"apiHost": "api.staging.dasch.swiss",
5+
"apiPort": 443,
6+
"apiPath": "",
7+
"iiifProtocol": "https",
8+
"iiifHost": "iiif.staging.dasch.swiss",
9+
"iiifPort": 443,
10+
"iiifPath": "",
11+
"geonameToken": "knora",
12+
"jsonWebToken": "",
13+
"logErrors": true,
14+
"iriBase": "http://rdfh.ch",
15+
"instrumentation": {
16+
"environment": "staging-server",
17+
"dataDog": {
18+
"enabled": false,
19+
"applicationId": "",
20+
"clientToken": "",
21+
"site": "",
22+
"service": ""
23+
},
24+
"rollbar": {
25+
"enabled": false,
26+
"accessToken": ""
27+
}
28+
}
29+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* This file can be replaced during build by using the `fileReplacements` array.
3+
* `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
4+
* The list of file replacements can be found in `angular.json`.
5+
*/
6+
7+
export const environment = {
8+
name: 'staging-server',
9+
production: false
10+
};
11+
12+
/*
13+
* For easier debugging in development mode, you can import the following file
14+
* to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
15+
*
16+
* This import should be commented out in production mode because it will have a negative impact
17+
* on performance if an error is thrown.
18+
*/
19+
// import 'zone.js/dist/zone-error'; // Included with Angular CLI.

0 commit comments

Comments
 (0)