Skip to content
Snippets Groups Projects
Verified Commit 00a7b757 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #124 add dnd sign file

parent b1383860
No related branches found
No related tags found
No related merge requests found
...@@ -148,24 +148,20 @@ ...@@ -148,24 +148,20 @@
<div id="jstree"></div> <div id="jstree"></div>
</mat-tab> </mat-tab>
<mat-tab *ngIf="!creationMode" label="Signature(s)"> <mat-tab *ngIf="!creationMode" label="Signature(s)">
<button style="position: absolute;right: 20px;bottom: 20px;z-index:1;" (click)="clickOnUploader('uploadSignFile')" matTooltip="taille de 2 mo maximum" <div dnd-droppable matTooltip="{{lang.uploadSignFileInfo}}" (click)="clickOnUploader('uploadSignFile')" [class.dndFileHighlighted]="highlightMe" (dragover)="highlightMe=true" (dragleave)="highlightMe=false" (onDropSuccess)="test($event);highlightMe=false;"
mat-fab color="accent"> class="dndFile">
<mat-icon style="height:auto;" class="fa fa-plus"></mat-icon> {{lang.uploadSignFile}}
</button> </div>
<div class="col-md-3 col-sm-6" *ngFor="let signature of user.signatures; let i = index"> <div class="col-md-3 col-sm-6 col-xm-12" *ngFor="let signature of user.signatures; let i = index">
<mat-card style="padding-left:5px;"> <mat-card style="margin-bottom:10px;">
<mat-card-header>
<mat-card-title>
<mat-form-field>
<input matInput type="text" [(ngModel)]="signature.signature_label" name="selectedSignatureLabel" placeholder="{{lang.label}}"
(focusout)="updateSignature(i)">
<button mat-button matSuffix mat-icon-button (click)="deleteSignature(signature)" color="warn" matTooltip="{{lang.delete}}">
<mat-icon class="fa fa-times"></mat-icon>
</button>
</mat-form-field>
</mat-card-title>
</mat-card-header>
<mat-card-content style="text-align:center;"> <mat-card-content style="text-align:center;">
<mat-form-field floatLabel="never">
<input matInput type="text" [(ngModel)]="signature.signature_label" name="selectedSignatureLabel" placeholder="{{lang.label}}"
(focusout)="updateSignature(i)">
<button mat-button matSuffix mat-icon-button (click)="deleteSignature(signature)" color="warn" matTooltip="{{lang.delete}}">
<mat-icon class="fa fa-times"></mat-icon>
</button>
</mat-form-field>
<img src="{{signature.pathToSignatureOnTmp}}" alt="Signature" style="width:auto;height:60px;"> <img src="{{signature.pathToSignatureOnTmp}}" alt="Signature" style="width:auto;height:60px;">
</mat-card-content> </mat-card-content>
</mat-card> </mat-card>
......
This diff is collapsed.
...@@ -75,25 +75,46 @@ $theme: mat-light-theme($primary, $accent, $warn); ...@@ -75,25 +75,46 @@ $theme: mat-light-theme($primary, $accent, $warn);
} }
.adminArea_1{ .adminArea_1{
overflow: hidden;
padding:20px; padding:20px;
border-right: dashed 1px mat-color($primary, 500); border-right: dashed 1px mat-color($primary, 500);
border-bottom: dashed 1px mat-color($primary, 500); border-bottom: dashed 1px mat-color($primary, 500);
} }
.adminArea_2{ .adminArea_2{
overflow: hidden;
padding:20px; padding:20px;
border-left: dashed 1px mat-color($primary, 500); border-left: dashed 1px mat-color($primary, 500);
border-bottom: dashed 1px mat-color($primary, 500); border-bottom: dashed 1px mat-color($primary, 500);
} }
.adminArea_3{ .adminArea_3{
overflow: hidden;
padding:20px; padding:20px;
border-right: dashed 1px mat-color($primary, 500); border-right: dashed 1px mat-color($primary, 500);
border-top: dashed 1px mat-color($primary, 500); border-top: dashed 1px mat-color($primary, 500);
} }
.adminArea_4{ .adminArea_4{
overflow: hidden;
padding:20px; padding:20px;
border-left: dashed 1px mat-color($primary, 500); border-left: dashed 1px mat-color($primary, 500);
border-top: dashed 1px mat-color($primary, 500); border-top: dashed 1px mat-color($primary, 500);
}
.dndFile{
border: dashed 5px grey;
padding:10px;
text-align:center;
opacity:0.5;
font-size:15px;
font-weight:bolder;
margin-bottom:10px;
}
.dndFileHighlighted {
opacity : 1 !important;
border: dashed 5px mat-color($primary, 500) !important;
color : mat-color($primary, 500);
} }
\ No newline at end of file
...@@ -405,6 +405,24 @@ var UserAdministrationComponent = /** @class */ (function (_super) { ...@@ -405,6 +405,24 @@ var UserAdministrationComponent = /** @class */ (function (_super) {
}); });
} }
}; };
UserAdministrationComponent.prototype.test = function (event) {
var _this = this;
console.log(event.mouseEvent.dataTransfer);
if (event.mouseEvent.dataTransfer.files && event.mouseEvent.dataTransfer.files[0]) {
var reader = new FileReader();
this.signatureModel.name = event.mouseEvent.dataTransfer.files[0].name;
this.signatureModel.size = event.mouseEvent.dataTransfer.files[0].size;
this.signatureModel.type = event.mouseEvent.dataTransfer.files[0].type;
if (this.signatureModel.label == "") {
this.signatureModel.label = this.signatureModel.name;
}
reader.readAsDataURL(event.mouseEvent.dataTransfer.files[0]);
reader.onload = function (value) {
window['angularUserAdministrationComponent'].componentAfterUpload(value.target.result);
_this.submitSignature();
};
}
};
__decorate([ __decorate([
core_1.ViewChild(material_1.MatPaginator), core_1.ViewChild(material_1.MatPaginator),
__metadata("design:type", material_1.MatPaginator) __metadata("design:type", material_1.MatPaginator)
......
...@@ -421,6 +421,27 @@ export class UserAdministrationComponent extends AutoCompletePlugin implements O ...@@ -421,6 +421,27 @@ export class UserAdministrationComponent extends AutoCompletePlugin implements O
}); });
} }
} }
test(event:any) {
console.log(event.mouseEvent.dataTransfer);
if (event.mouseEvent.dataTransfer.files && event.mouseEvent.dataTransfer.files[0]) {
var reader = new FileReader();
this.signatureModel.name = event.mouseEvent.dataTransfer.files[0].name;
this.signatureModel.size = event.mouseEvent.dataTransfer.files[0].size;
this.signatureModel.type = event.mouseEvent.dataTransfer.files[0].type;
if (this.signatureModel.label == "") {
this.signatureModel.label = this.signatureModel.name;
}
reader.readAsDataURL(event.mouseEvent.dataTransfer.files[0]);
reader.onload = (value: any) => {
window['angularUserAdministrationComponent'].componentAfterUpload(value.target.result);
this.submitSignature();
};
}
}
} }
export interface History { export interface History {
event_date: Date; event_date: Date;
......
...@@ -258,6 +258,8 @@ exports.LANG_EN = { ...@@ -258,6 +258,8 @@ exports.LANG_EN = {
"updateStatus": "Document status modification", "updateStatus": "Document status modification",
"updateStatusInformationsChrono": "When typing the CHRONO of a document, you will modify its status. The document will be present in the basket depending of the status you have chosen.", "updateStatusInformationsChrono": "When typing the CHRONO of a document, you will modify its status. The document will be present in the basket depending of the status you have chosen.",
"updateStatusInformationsGed": "When typing the GED NUMBER of a document, you will modify its status. The document will be present in the basket depending of the status you have chosen.", "updateStatusInformationsGed": "When typing the GED NUMBER of a document, you will modify its status. The document will be present in the basket depending of the status you have chosen.",
"uploadSignFile": "Upload a sign file",
"uploadSignFileInfo": "Click to add sign file from your computer",
"usedInActionPage": "Used in action page", "usedInActionPage": "Used in action page",
"usedInBasketlist": "Used in basket list", "usedInBasketlist": "Used in basket list",
"user": "user", "user": "user",
......
...@@ -256,6 +256,8 @@ export const LANG_EN = { ...@@ -256,6 +256,8 @@ export const LANG_EN = {
"updateStatus" : "Document status modification", "updateStatus" : "Document status modification",
"updateStatusInformationsChrono" : "When typing the CHRONO of a document, you will modify its status. The document will be present in the basket depending of the status you have chosen.", "updateStatusInformationsChrono" : "When typing the CHRONO of a document, you will modify its status. The document will be present in the basket depending of the status you have chosen.",
"updateStatusInformationsGed" : "When typing the GED NUMBER of a document, you will modify its status. The document will be present in the basket depending of the status you have chosen.", "updateStatusInformationsGed" : "When typing the GED NUMBER of a document, you will modify its status. The document will be present in the basket depending of the status you have chosen.",
"uploadSignFile" : "Upload a sign file",
"uploadSignFileInfo" : "Click to add sign file from your computer",
"usedInActionPage" : "Used in action page", "usedInActionPage" : "Used in action page",
"usedInBasketlist" : "Used in basket list", "usedInBasketlist" : "Used in basket list",
"user" : "user", "user" : "user",
......
...@@ -277,6 +277,8 @@ exports.LANG_FR = { ...@@ -277,6 +277,8 @@ exports.LANG_FR = {
"updateStatus": "Changement de statut de courrier", "updateStatus": "Changement de statut de courrier",
"updateStatusInformationsChrono": "En saisissant le NUMÉRO CHRONO du document, vous modifierez le statut du courrier. Le courrier sera disponible dans la bannette des utilisateurs auquel il était affecté suivant le statut que vous aurez défini.", "updateStatusInformationsChrono": "En saisissant le NUMÉRO CHRONO du document, vous modifierez le statut du courrier. Le courrier sera disponible dans la bannette des utilisateurs auquel il était affecté suivant le statut que vous aurez défini.",
"updateStatusInformationsGed": "En saisissant l'IDENTIFIANT GED du document, vous modifierez le statut du courrier. Le courrier sera disponible dans la bannette des utilisateurs auquel il était affecté suivant le statut que vous aurez défini.", "updateStatusInformationsGed": "En saisissant l'IDENTIFIANT GED du document, vous modifierez le statut du courrier. Le courrier sera disponible dans la bannette des utilisateurs auquel il était affecté suivant le statut que vous aurez défini.",
"uploadSignFile": "Déposer une signature",
"uploadSignFileInfo": "Cliquer pour ajouter une signature depuis votre poste",
"usedInActionPage": "Action sur la page d'action", "usedInActionPage": "Action sur la page d'action",
"usedInBasketlist": "Action sur la liste de résultat", "usedInBasketlist": "Action sur la liste de résultat",
"user": "utilisateur", "user": "utilisateur",
......
...@@ -275,6 +275,8 @@ export const LANG_FR = { ...@@ -275,6 +275,8 @@ export const LANG_FR = {
"updateStatus" : "Changement de statut de courrier", "updateStatus" : "Changement de statut de courrier",
"updateStatusInformationsChrono" : "En saisissant le NUMÉRO CHRONO du document, vous modifierez le statut du courrier. Le courrier sera disponible dans la bannette des utilisateurs auquel il était affecté suivant le statut que vous aurez défini.", "updateStatusInformationsChrono" : "En saisissant le NUMÉRO CHRONO du document, vous modifierez le statut du courrier. Le courrier sera disponible dans la bannette des utilisateurs auquel il était affecté suivant le statut que vous aurez défini.",
"updateStatusInformationsGed" : "En saisissant l'IDENTIFIANT GED du document, vous modifierez le statut du courrier. Le courrier sera disponible dans la bannette des utilisateurs auquel il était affecté suivant le statut que vous aurez défini.", "updateStatusInformationsGed" : "En saisissant l'IDENTIFIANT GED du document, vous modifierez le statut du courrier. Le courrier sera disponible dans la bannette des utilisateurs auquel il était affecté suivant le statut que vous aurez défini.",
"uploadSignFile" : "Déposer une signature",
"uploadSignFileInfo" : "Cliquer pour ajouter une signature depuis votre poste",
"usedInActionPage" : "Action sur la page d'action", "usedInActionPage" : "Action sur la page d'action",
"usedInBasketlist" : "Action sur la liste de résultat", "usedInBasketlist" : "Action sur la liste de résultat",
"user" : "utilisateur", "user" : "utilisateur",
......
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