Skip to content

Commit

Permalink
Merge pull request #247 from sitmun/main
Browse files Browse the repository at this point in the history
Update dev
  • Loading branch information
fjlopez authored Nov 10, 2024
2 parents 8e40fb5 + d9e24b1 commit b034d71
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ testem.log
.DS_Store
Thumbs.db
.directory

# Angular
.angular
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ <h5> {{'applicationEntity.generalData' | translate}} </h5>


</div>
<div class="rowFormDiv">
<div class="colFormDiv" >
<label class="formLabel">
{{'applicationEntity.logo' | translate}}
</label>
<mat-form-field appearance="outline">
<input matInput type="text" formControlName="logo">
</mat-form-field>
</div>
</div>
</form>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ describe('ApplicationFormComponent', () => {
it('form invalid when mid-empty', () => {
component.applicationForm.patchValue({
name: 'nameTest',
logo: 'logo',
type: 1,
})
//Miss url
Expand All @@ -120,6 +121,8 @@ describe('ApplicationFormComponent', () => {
it('form valid', () => {
component.applicationForm.patchValue({
name: 'name',
// logo
logo: 'logo',
type: 1,
title: 'title',
jspTemplate: 'url',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export class ApplicationFormComponent implements OnInit {
scales: this.applicationToEdit.scales,
srs: this.applicationToEdit.srs,
treeAutoRefresh: this.applicationToEdit.treeAutoRefresh,
logo: this.applicationToEdit.logo,
_links: this.applicationToEdit._links
});

Expand Down Expand Up @@ -230,6 +231,7 @@ export class ApplicationFormComponent implements OnInit {
this.dataLoaded = true;
this.applicationForm.patchValue({
moveSupramunicipal: false,
logo: false,
treeAutorefresh: false,
type: this.applicationTypes[0].value,
situationMap: this.situationMapList[0].id
Expand Down Expand Up @@ -369,6 +371,7 @@ export class ApplicationFormComponent implements OnInit {
srs: new UntypedFormControl(null),
treeAutoRefresh: new UntypedFormControl(null),
_links: new UntypedFormControl(null, []),
logo: new UntypedFormControl(null,[]),

});

Expand Down Expand Up @@ -921,6 +924,7 @@ export class ApplicationFormComponent implements OnInit {
appObj.type = this.applicationForm.value.type;
appObj.title = this.applicationForm.value.title;
appObj.jspTemplate = this.applicationForm.value.jspTemplate;
appObj.logo = this.applicationForm.value.logo;
appObj.theme = this.applicationForm.value.theme;
appObj.scales = this.applicationForm.value.scales != null ? this.applicationForm.value.scales.toString().split(",") : null;
appObj.srs = this.applicationForm.value.srs;
Expand Down
9 changes: 3 additions & 6 deletions src/app/components/trees/trees-form/trees-form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -590,9 +590,6 @@ export class TreesFormComponent implements OnInit {

}




onSaveButtonClicked() {
if (this.treeForm.valid) {
this.getAllElementsNodes.next("save");
Expand Down Expand Up @@ -674,9 +671,9 @@ export class TreesFormComponent implements OnInit {
treeNodeObj.metadataURL = tree.metadataURL;
treeNodeObj.description = tree.description;
treeNodeObj.tree = this.treeToEdit;
treeNodeObj.filterGetFeatureInfo = tree.filterGetFeatureInfo;
treeNodeObj.filterGetMap = tree.filterGetMap;
treeNodeObj.filterSelectable = tree.filterSelectable;
treeNodeObj.filterGetFeatureInfo = tree.filterGetFeatureInfo == "UNDEFINED" ? null : tree.filterGetFeatureInfo;
treeNodeObj.filterGetMap = tree.filterGetMap == "UNDEFINED" ? null : tree.filterGetMap;
treeNodeObj.filterSelectable = tree.filterSelectable == "UNDEFINED" ? null : tree.filterSelectable;
treeNodeObj.style = tree.style;


Expand Down
12 changes: 10 additions & 2 deletions src/app/frontend-core/src/lib/angular-hal/src/lib/resource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ export abstract class Resource {
public substituteRelation<T extends Resource>(relation: string, resource: T): Observable<any> {
if (!isNullOrUndefined(this._links) && !isNullOrUndefined(this._links[relation])) {
let header = ResourceHelper.headers.append('Content-Type', 'text/uri-list');
return ResourceHelper.getHttp().put(ResourceHelper.getProxy(this._links[relation].href), resource._links.self.href, {headers: header});
let targetUrl = this._links[relation].href;
if (targetUrl.endsWith('{?projection}')) {
targetUrl = targetUrl.substring(0, targetUrl.indexOf('{?projection}'))
}
return ResourceHelper.getHttp().put(ResourceHelper.getProxy(targetUrl), resource._links.self.href, {headers: header});
} else {
return observableThrowError('no relation found');
}
Expand Down Expand Up @@ -137,7 +141,11 @@ export abstract class Resource {
return observableThrowError('no relation found');

let relationId: string = link.substring(idx);
return ResourceHelper.getHttp().delete(ResourceHelper.getProxy(this._links[relation].href + '/' + relationId), {headers: ResourceHelper.headers});
let targetUrl = this._links[relation].href;
if (targetUrl.endsWith('{?projection}')) {
targetUrl = targetUrl.substring(0, targetUrl.indexOf('{?projection}'))
}
return ResourceHelper.getHttp().delete(ResourceHelper.getProxy(targetUrl + '/' + relationId), {headers: ResourceHelper.headers});
} else {
return observableThrowError('no relation found');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ export class Application extends Resource {
/** urlTemplate*/
public jspTemplate: string;

/** urlTemplate*/
public logo: string;


/** system created date*/
public createdDate: any;
Expand Down
3 changes: 2 additions & 1 deletion src/assets/i18n/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@
"selectedBackground": "Fons seleccionat",
"value": "Valor",
"note": "Observacions",
"status": "Estat"
"status": "Estat",
"logo": "Logo"
},
"territoryEntity": {
"generalData": "Dades Generals",
Expand Down
3 changes: 2 additions & 1 deletion src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@
"selectedBackground": "Selected Wallpaper",
"value": "Value",
"note": "Observations",
"status": "Status"
"status": "Status",
"logo": "Logo"
},
"territoryEntity": {
"generalData": "General Data",
Expand Down
3 changes: 2 additions & 1 deletion src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@
"selectedBackground": "Fondo seleccionado",
"value": "Valor",
"noto": "Observaciones",
"status": "Estado"
"status": "Estado",
"logo": "Logo"
},
"territoryEntity": {
"generalData": "Datos Generales",
Expand Down
3 changes: 2 additions & 1 deletion src/assets/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@
"selectedBackground": "Fond d'écran sélectionné",
"value": "Valeur",
"note": "Observations",
"status": "Statut"
"status": "Statut",
"logo": "Logo"
},
"territoryEntity": {
"generalData": "Données générales",
Expand Down
3 changes: 2 additions & 1 deletion src/assets/i18n/oc-aranes.json
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@
"selectedBackground": "Hons seleccionat",
"value": "Valor",
"note": "Observacions",
"status": "Estat"
"status": "Estat",
"logo": "Lògo"
},
"territoryEntity": {
"generalData": "Donades Generaus",
Expand Down

0 comments on commit b034d71

Please sign in to comment.