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

FIX #21979 TIME 0:30 sync useless code changes with develop

parent 7054db30
No related branches found
No related tags found
No related merge requests found
......@@ -42,16 +42,6 @@ export class DocumentComponent implements OnInit, OnDestroy {
@ViewChild('rightContent', { static: true }) rightContent: TemplateRef<any>;
@ViewChild('pagesList') pagesList: any;
posX: number = 0;
posY: number = 0;
enterApp: boolean = true;
detailMode: boolean = false;
pageNum: number = 1;
signaturesContent: any = [];
totalPages: number;
draggable: boolean;
currentDoc: number = 0;
docList: any = [];
actionsList: any = [
{
id: 2,
......@@ -75,6 +65,8 @@ export class DocumentComponent implements OnInit, OnDestroy {
event: 'validateDocument'
},
];
enterApp: boolean = true;
pdfDataArr: any;
freezeSidenavClose: boolean = false;
startX: number = 0;
......@@ -90,47 +82,58 @@ export class DocumentComponent implements OnInit, OnDestroy {
};
loadingUI: any = false;
timerSubscription: Subscription;
signaturesContent: any = [];
docList: any = [];
posX: number = 0;
posY: number = 0;
pageNum: number = 1;
currentDoc: number = 0;
totalPages: number;
detailMode: boolean = false;
draggable: boolean;
expandedNote: boolean = true;
hasWorkflowNotes: boolean = false;
currentTool = 'info';
load: HTMLIonLoadingElement = null;
dragging: boolean = false;
resizing: boolean = false;
pdfname: string = null;
loadingdocument: boolean = true;
loadingpdf: boolean = false;
loadingImage: boolean = true;
hasWorkflowNotes: boolean = false;
currentTool = 'info';
pdfname: string = null;
fileContent: string = '';
userDelegated: boolean = false;
timerSubscription: Subscription;
load: HTMLIonLoadingElement = null;
constructor(private translate: TranslateService,
private router: Router,
private route: ActivatedRoute,
constructor(
public http: HttpClient,
public signaturesService: SignaturesContentService,
public notificationService: NotificationService,
private cookieService: CookieService,
public sanitizer: DomSanitizer,
public dialog: MatDialog,
private bottomSheet: MatBottomSheet,
public authService: AuthService,
private localStorage: LocalStorageService,
private menu: MenuController,
public actionSheetController: ActionSheetController,
public loadingController: LoadingController,
public viewContainerRef: ViewContainerRef,
public modalController: ModalController,
private pdfViewerService: NgxExtendedPdfViewerService,
public alertController: AlertController,
public signatureMethodService: SignatureMethodService,
public navCtrl: NavController,
public functionsService: FunctionsService,
public actionsService: ActionsService,
private translate: TranslateService,
private router: Router,
private route: ActivatedRoute,
private bottomSheet: MatBottomSheet,
private localStorage: LocalStorageService,
private menu: MenuController,
private pdfViewerService: NgxExtendedPdfViewerService,
private cookieService: CookieService,
) {
this.draggable = false;
}
......@@ -148,7 +151,6 @@ export class DocumentComponent implements OnInit, OnDestroy {
getImageDimensions(ajustSize: boolean = false): void {
const img = new Image();
img.onload = (data: any) => {
const percent = (data.target.naturalWidth * 100) / this.signaturesService.workingAreaWidth;
this.signaturesService.workingAreaWidth = data.target.naturalWidth;
......@@ -157,33 +159,14 @@ export class DocumentComponent implements OnInit, OnDestroy {
if (ajustSize) {
this.getAreaDimension();
}
/* if (percent !== Infinity) {
this.signatures.forEach(element => {
element.position.height = (percent * element.position.height) / 100;
element.position.width = (percent * element.position.width) / 100;
element.position.top = (percent * element.position.top) / 100;
element.position.left = (percent * element.position.left) / 100;
});
}*/
// this.originalSize = true;
};
img.src = this.docList[this.currentDoc].imgContent[this.pageNum];
}
getAreaDimension() {
const percent = (this.mainContent.el.offsetWidth * 100) / this.signaturesService.workingAreaWidth;
this.signaturesService.workingAreaWidth = (percent * this.signaturesService.workingAreaWidth) / 100;
this.signaturesService.workingAreaHeight = (percent * this.signaturesService.workingAreaHeight) / 100;
/* this.signatures.forEach(element => {
element.position.height = (percent * element.position.height) / 100;
element.position.width = (percent * element.position.width) / 100;
element.position.top = (percent * element.position.top) / 100;
element.position.left = (percent * element.position.left) / 100;
});*/
// this.originalSize = false;
}
async openAction(event: any) {
......@@ -216,25 +199,7 @@ export class DocumentComponent implements OnInit, OnDestroy {
}
});
}
/* if (this.originalSize) {
buttons.push({
text: 'Zoom taille écran',
icon: 'contract-outline',
handler: () => {
this.getAreaDimension();
console.log('Share clicked');
}
});
} else {
buttons.push({
text: 'Zoom taille écran',
icon: 'contract-outline',
handler: () => {
this.getImageDimensions();
console.log('Share clicked');
}
});
} */
if (!this.checkEmptiness()) {
buttons.push({
text: this.translate.instant('lang.deleteAll'),
......@@ -305,6 +270,7 @@ export class DocumentComponent implements OnInit, OnDestroy {
async ngOnInit(): Promise<void> {
this.menu.enable(false, 'right-menu');
this.menu.enable(true, 'left-menu');
this.route.params.subscribe(params => {
if (typeof params['id'] !== 'undefined') {
this.loadingController.create({
......@@ -581,7 +547,6 @@ export class DocumentComponent implements OnInit, OnDestroy {
if (this.pageNum === 0) {
this.pageNum = 1;
} else {
}
if (this.currentDoc === 0) {
......@@ -630,15 +595,6 @@ export class DocumentComponent implements OnInit, OnDestroy {
return Array(n);
}
initWorkingArea() {
/* if ((typeof this.signaturesService.workingAreaHeight !== 'number' || this.signaturesService.workingAreaHeight === 0) && (typeof this.signaturesService.workingAreaWidth !== 'number' || this.signaturesService.workingAreaWidth === 0)) {
this.img = document.querySelector('img.zoom');
const rect = this.img.getBoundingClientRect();
this.signaturesService.workingAreaHeight = rect.height;
this.signaturesService.workingAreaWidth = rect.width;
}*/
}
async refuseDocument(): Promise<void> {
let msg = this.translate.instant('lang.rejectDocumentWarning');
......@@ -663,7 +619,6 @@ export class DocumentComponent implements OnInit, OnDestroy {
text: this.translate.instant('lang.reject'),
handler: async (data: any) => {
const idsToProcess = await this.actionsService.checkGroupMail(this.mainDocument, 'reject');
const res = await this.signatureMethodService.launchDefaultMode(data.paragraph, idsToProcess);
if (!this.functionsService.empty(res)) {
......
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