Skip to content

Commit

Permalink
Merge branch 'main' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
micnori committed Jun 24, 2024
2 parents d7b27cb + 99a4d16 commit 764a5f5
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import { environment } from "src/environments/environment";
import { Injectable } from "@angular/core";
import { HttpClient, HttpParams } from "@angular/common/http";
import { HttpClient, HttpEvent, HttpParams, HttpResponse } from "@angular/common/http";
import { Observable } from "rxjs";

import { PagePlayerInfoConsole } from "../model/pagePlayerInfoConsole";
Expand Down Expand Up @@ -403,6 +403,24 @@ export class ConsoleControllerService {
}
);
}

/**
* getTerritoryManager
*
* @param territoryId territoryId
*/
public getPlayerIdentityUsingGET(campaignId: string): Observable<any> {
const params = new HttpParams().set('campaignId', campaignId);
return this.http.request(
'get',
environment.serverUrl.api + `/playandgo/api/console/player/identity`,
{
observe: 'response',
responseType: 'blob',
params: params,
}
);
}
}

function removeNullOrUndefined(obj: any) {
Expand Down
11 changes: 11 additions & 0 deletions src/app/pages/campaign/campaign-page/campaign-page.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,17 @@
</mat-icon>
</button>
</mat-grid-tile>
<mat-grid-tile [colspan]="1">
<button color="primary" class='action-button' mat-raised-button type="submit"
(click)="identities()">
{{'surveyIdentity' | translate}}
<mat-icon>
<span class="material-icons-outlined">
fingerprint
</span>
</mat-icon>
</button>
</mat-grid-tile>
</mat-grid-list>
<!-- old <img class="img-logo" src="{{PREFIX_SRC_IMG_C + selectedCampaign.banner.contentType + BASE64_SRC_IMG_C + selectedCampaign.banner.image}}"> -->
<mat-card-content>
Expand Down
11 changes: 11 additions & 0 deletions src/app/pages/campaign/campaign-page/campaign-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,17 @@ export class CampaignPageComponent implements OnInit {
});
}

identities() {
this.managerService.getPlayerIdentityUsingGET(this.selectedCampaign.campaignId).subscribe((response)=>{
const downloadLink = document.createElement('a');
downloadLink.href = URL.createObjectURL(new Blob([response.body], { type: response.body.type }));
const contentDisposition = response.headers.get('content-disposition');
const fileName = contentDisposition.split(';')[1].split('filename')[1].split('=')[1].trim();
downloadLink.download = fileName;
downloadLink.click();
});
}


setClassWithourError(element: CampaignClass) : CampaignClass{
const nullString = "valueNotProvided";
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@
"errorNotFound":"error not found",
"survey":"Survey",
"surveys":"Surveys",
"surveyIdentity": "Identity (survey)",
"link":"Link",
"surveyId":"Survay Id",
"assign":"Assign",
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@
"errorNotFound":"errore non trovato",
"survey":"Questionario",
"surveys":"Questionari",
"surveyIdentity": "Identità (questionari)",
"link":"Link",
"surveyId":"Id questionario",
"assign":"Assegna",
Expand Down

0 comments on commit 764a5f5

Please sign in to comment.