Skip to content
Snippets Groups Projects
Commit ace86546 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #12981 TIME 0:20 front admin action parameters for closing mail and AR

parent 8d718e1a
No related branches found
No related tags found
No related merge requests found
...@@ -45,7 +45,7 @@ export class CloseMailActionComponent implements OnInit { ...@@ -45,7 +45,7 @@ export class CloseMailActionComponent implements OnInit {
checkIndexingClose() { checkIndexingClose() {
this.http.get(`../../rest/actions/${this.data.action.id}`).pipe( this.http.get(`../../rest/actions/${this.data.action.id}`).pipe(
tap((data: any) => { tap((data: any) => {
this.requiredFields = data.action.requiredFields; this.requiredFields = data.action.parameters;
}), }),
exhaustMap(() => this.http.get(`../../rest/customFields`)), exhaustMap(() => this.http.get(`../../rest/customFields`)),
tap((data: any) => this.customFields = data.customFields), tap((data: any) => this.customFields = data.customFields),
......
...@@ -58,6 +58,17 @@ ...@@ -58,6 +58,17 @@
</mat-chip-list> </mat-chip-list>
</div> </div>
</div> </div>
<div class="form-group" *ngIf="action.actionPageId=='create_acknowledgement_receipt'">
<div class="col-sm-12">
<mat-form-field>
<mat-select [required]="action.actionPageId=='create_acknowledgement_receipt'" id="generateARmode" name="generateARmode" title="{{lang.generateARMode}}" placeholder="{{lang.generateARMode}}" [(ngModel)]="arMode">
<mat-option value="auto">{{lang.autoAR}}</mat-option>
<mat-option value="manual">{{lang.manualAR}}</mat-option>
<mat-option value="both">{{lang.bothAR}}</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
<div class="form-group"> <div class="form-group">
<div class="col-sm-12"> <div class="col-sm-12">
<mat-form-field> <mat-form-field>
......
...@@ -37,6 +37,7 @@ export class ActionAdministrationComponent implements OnInit { ...@@ -37,6 +37,7 @@ export class ActionAdministrationComponent implements OnInit {
selectedFieldsValue: Array<any> = []; selectedFieldsValue: Array<any> = [];
selectedFieldsId: Array<any> = []; selectedFieldsId: Array<any> = [];
selectedValue: any; selectedValue: any;
arMode: any;
constructor( constructor(
public http: HttpClient, public http: HttpClient,
...@@ -87,15 +88,19 @@ export class ActionAdministrationComponent implements OnInit { ...@@ -87,15 +88,19 @@ export class ActionAdministrationComponent implements OnInit {
this.headerService.setHeader(this.lang.actionCreation, data.action.label_action); this.headerService.setHeader(this.lang.actionCreation, data.action.label_action);
await this.getCustomFields(); await this.getCustomFields();
this.loading = false; this.loading = false;
this.customFieldsFormControl = new FormControl({ value: this.action.requiredFields, disabled: false }); this.customFieldsFormControl = new FormControl({ value: this.action.parameters, disabled: false });
this.selectedFieldsId = this.action.requiredFields; if (this.action.actionPageId=='close_mail') {
this.selectedFieldsId.forEach((element: any) => { this.selectedFieldsId = this.action.parameters;
this.availableCustomFields.forEach((availableElement: any) => { this.selectedFieldsId.forEach((element: any) => {
if (availableElement.id == element) { this.availableCustomFields.forEach((availableElement: any) => {
this.selectedFieldsValue.push(availableElement.label); if (availableElement.id == element) {
} this.selectedFieldsValue.push(availableElement.label);
}
});
}); });
}); } else if (this.action.actionPageId=='create_acknowledgement_receipt') {
this.arMode = this.action.parameters;
}
}); });
} }
}); });
...@@ -142,7 +147,11 @@ export class ActionAdministrationComponent implements OnInit { ...@@ -142,7 +147,11 @@ export class ActionAdministrationComponent implements OnInit {
} }
onSubmit() { onSubmit() {
this.action.requiredFields = this.selectedFieldsId; if (this.action.actionPageId=='close_mail') {
this.action.parameters = this.selectedFieldsId;
} else if (this.action.actionPageId=='create_acknowledgement_receipt') {
this.action.parameters = this.arMode;
}
if (this.creationMode) { if (this.creationMode) {
this.http.post('../../rest/actions', this.action) this.http.post('../../rest/actions', this.action)
.subscribe(() => { .subscribe(() => {
......
...@@ -1540,6 +1540,10 @@ export const LANG_EN = { ...@@ -1540,6 +1540,10 @@ export const LANG_EN = {
"mailingActionInformations" : "Following mails contain mailing attachments, if next person in visa circuit is signatory then mailing will be activate :", "mailingActionInformations" : "Following mails contain mailing attachments, if next person in visa circuit is signatory then mailing will be activate :",
"mailingActionInformations2" : "Following mails contain mailing attachments, mailing will be activate :", "mailingActionInformations2" : "Following mails contain mailing attachments, mailing will be activate :",
"properties" : "Properties", "properties" : "Properties",
"generateARMode" : "Acknowledgement receipt mode allowed",
"autoAR" : "Automatic",
"manualAR" : "Manual",
"bothAR" : "Automatic et manual",
"tagCreation" : "Tag creation", "tagCreation" : "Tag creation",
"tagModification" : "Tag modification", "tagModification" : "Tag modification",
"usage" : "Used for", "usage" : "Used for",
......
...@@ -1579,6 +1579,10 @@ export const LANG_FR = { ...@@ -1579,6 +1579,10 @@ export const LANG_FR = {
"mailingActionInformations" : "Les courriers suivants contiennent des pièces-jointes pour publipostage, si la prochaine personne du circuit de visa est signataire alors le publipostage s'effectuera dès la validation de cette action :", "mailingActionInformations" : "Les courriers suivants contiennent des pièces-jointes pour publipostage, si la prochaine personne du circuit de visa est signataire alors le publipostage s'effectuera dès la validation de cette action :",
"mailingActionInformations2" : "Les courriers suivants contiennent des pièces-jointes pour publipostage, celui-ci s'effectuera dès la validation de cette action :", "mailingActionInformations2" : "Les courriers suivants contiennent des pièces-jointes pour publipostage, celui-ci s'effectuera dès la validation de cette action :",
"properties" : "Propriétés", "properties" : "Propriétés",
"generateARMode" : "Mode d'accusé de réception autorisé",
"autoAR" : "Automatique",
"manualAR" : "Manuel",
"bothAR" : "Automatique et manuel",
"tagCreation" : "Création d'un mot-clé", "tagCreation" : "Création d'un mot-clé",
"tagModification" : "Modification du mot-clé", "tagModification" : "Modification du mot-clé",
"usage" : "Utilisé pour", "usage" : "Utilisé pour",
......
...@@ -1565,6 +1565,10 @@ export const LANG_NL = { ...@@ -1565,6 +1565,10 @@ export const LANG_NL = {
"mailingActionInformations" : "Following mails contain mailing attachments, if next person in visa circuit is signatory then mailing will be activate :", //_TO_TRANSLATE "mailingActionInformations" : "Following mails contain mailing attachments, if next person in visa circuit is signatory then mailing will be activate :", //_TO_TRANSLATE
"mailingActionInformations2" : "Following mails contain mailing attachments, mailing will be activate :", //TRANSLATE "mailingActionInformations2" : "Following mails contain mailing attachments, mailing will be activate :", //TRANSLATE
"properties" : "Properties", //_TO_TRANSLATE "properties" : "Properties", //_TO_TRANSLATE
"generateARMode" : "Acknowledgement receipt mode allowed", //_TO_TRANSLATE
"autoAR" : "Automatic", //_TO_TRANSLATE
"manualAR" : "Manual", //_TO_TRANSLATE
"bothAR" : "Automatic et manual", //_TO_TRANSLATE
"tagCreation" : "Tag creation", //_TO_TRANSLATE "tagCreation" : "Tag creation", //_TO_TRANSLATE
"tagModification" : "Tag modification", //_TO_TRANSLATE "tagModification" : "Tag modification", //_TO_TRANSLATE
"usage" : "Used for", //_TO_TRANSLATE "usage" : "Used for", //_TO_TRANSLATE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment