Commit 450174d1 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #13667 TIME 1 change rest route relative path

parent 3979940e
......@@ -105,7 +105,7 @@ export class ActionsListComponent implements OnInit {
this.basketInfo = JSON.parse(JSON.stringify(this.currentBasketInfo));
this.http.get('../../rest/resourcesList/users/' + this.currentBasketInfo.ownerId + '/groups/' + this.currentBasketInfo.groupId + '/baskets/' + this.currentBasketInfo.basketId + '/actions')
this.http.get('../rest/resourcesList/users/' + this.currentBasketInfo.ownerId + '/groups/' + this.currentBasketInfo.groupId + '/baskets/' + this.currentBasketInfo.basketId + '/actions')
.subscribe((data: any) => {
if (data.actions.length > 0) {
this.actionsList = data.actions;
......@@ -136,7 +136,7 @@ export class ActionsListComponent implements OnInit {
this.dialogRef.afterClosed().pipe(
filter((data: string) => data === 'ok'),
exhaustMap(() => this.http.request('DELETE', '../../rest/resources/unfollow' , { body: { resources: this.selectedRes } })),
exhaustMap(() => this.http.request('DELETE', '../rest/resources/unfollow' , { body: { resources: this.selectedRes } })),
tap((data: any) => {
this.notify.success(this.lang.removedFromFolder);
this.headerService.nbResourcesFollowed -= data.unFollowed;
......
......@@ -89,8 +89,8 @@ export class ActionsService {
this.currentBasketId = basketId;
this.currentResIds = resIds === null ? [] : resIds;
this.indexActionRoute = `../../rest/indexing/groups/${this.currentGroupId}/actions/${this.currentAction.id}`;
this.processActionRoute = `../../rest/resourcesList/users/${this.currentUserId}/groups/${this.currentGroupId}/baskets/${this.currentBasketId}/actions/${this.currentAction.id}`;
this.indexActionRoute = `../rest/indexing/groups/${this.currentGroupId}/actions/${this.currentAction.id}`;
this.processActionRoute = `../rest/resourcesList/users/${this.currentUserId}/groups/${this.currentGroupId}/baskets/${this.currentBasketId}/actions/${this.currentAction.id}`;
return true;
} else {
......@@ -105,7 +105,7 @@ export class ActionsService {
saveDocument(datas: any) {
this.loading = true;
this.setResourceInformations(datas);
return this.http.post('../../rest/resources', this.currentResourceInformations);
return this.http.post('../rest/resources', this.currentResourceInformations);
}
setResourceInformations(datas: any) {
......@@ -143,7 +143,7 @@ export class ActionsService {
if (action.component == 'viewDoc' || action.component == 'documentDetails') {
this[action.component](action.data);
} else {
this.http.put(`../../rest/resourcesList/users/${userId}/groups/${groupId}/baskets/${basketId}/lock`, { resources: resIds }).pipe(
this.http.put(`../rest/resourcesList/users/${userId}/groups/${groupId}/baskets/${basketId}/lock`, { resources: resIds }).pipe(
tap((data: any) => {
if (this.canExecuteAction(data.countLockedResources, data.lockers, resIds)) {
try {
......@@ -197,7 +197,7 @@ export class ActionsService {
lockResource() {
this.currentResourceLock = setInterval(() => {
this.http.put(`../../rest/resourcesList/users/${this.currentUserId}/groups/${this.currentGroupId}/baskets/${this.currentBasketId}/lock`, { resources: this.currentResIds }).pipe(
this.http.put(`../rest/resourcesList/users/${this.currentUserId}/groups/${this.currentGroupId}/baskets/${this.currentBasketId}/lock`, { resources: this.currentResIds }).pipe(
catchError((err: any) => {
if (err.status == 403) {
clearInterval(this.currentResourceLock);
......@@ -211,7 +211,7 @@ export class ActionsService {
unlockResource() {
if (this.currentResIds.length > 0) {
this.http.put(`../../rest/resourcesList/users/${this.currentUserId}/groups/${this.currentGroupId}/baskets/${this.currentBasketId}/unlock`, { resources: this.currentResIds }).pipe(
this.http.put(`../rest/resourcesList/users/${this.currentUserId}/groups/${this.currentGroupId}/baskets/${this.currentBasketId}/unlock`, { resources: this.currentResIds }).pipe(
catchError((err: any) => {
this.notify.handleErrors(err);
return of(false);
......@@ -674,7 +674,7 @@ export class ActionsService {
noConfirmAction(options: any = null) {
let dataActionToSend = this.setDatasActionToSend();
if (dataActionToSend.resIds.length === 0) {
this.http.post('../../rest/resources', dataActionToSend.resource).pipe(
this.http.post('../rest/resources', dataActionToSend.resource).pipe(
tap((data: any) => {
dataActionToSend.resIds = [data.resId];
}),
......
......@@ -46,7 +46,7 @@ export class ContinueAvisCircuitActionComponent implements OnInit {
this.loading = true;
this.resourcesErrors = [];
this.resourcesWarnings = [];
this.http.post('../../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/actions/' + this.data.action.id + '/checkContinueOpinionCircuit', { resources: this.data.resIds }).pipe(
this.http.post('../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/actions/' + this.data.action.id + '/checkContinueOpinionCircuit', { resources: this.data.resIds }).pipe(
tap((data: any) => {
if (!this.functions.empty(data.resourcesInformations.warning)) {
this.resourcesWarnings = data.resourcesInformations.warning;
......
......@@ -45,7 +45,7 @@ export class GiveAvisParallelActionComponent implements OnInit {
this.resourcesErrors = [];
this.resourcesWarnings = [];
this.http.post('../../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/actions/' + this.data.action.id + '/checkGiveParallelOpinion', { resources: this.data.resIds }).pipe(
this.http.post('../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/actions/' + this.data.action.id + '/checkGiveParallelOpinion', { resources: this.data.resIds }).pipe(
tap((data: any) => {
if (!this.functions.empty(data.resourcesInformations.warning)) {
this.resourcesWarnings = data.resourcesInformations.warning;
......
......@@ -65,7 +65,7 @@ export class SendAvisParallelComponent implements AfterViewInit {
indexDocument() {
return new Promise((resolve, reject) => {
this.http.post('../../rest/resources', this.data.resource).pipe(
this.http.post('../rest/resources', this.data.resource).pipe(
tap((data: any) => {
this.data.resIds = [data.resId];
resolve(true);
......
......@@ -52,7 +52,7 @@ export class ValidateAvisParallelComponent implements OnInit, AfterViewInit {
this.loading = true;
this.resourcesErrors = [];
this.resourcesWarnings = [];
this.http.post('../../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/actions/' + this.data.action.id + '/checkValidateParallelOpinion', { resources: this.data.resIds }).pipe(
this.http.post('../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/actions/' + this.data.action.id + '/checkValidateParallelOpinion', { resources: this.data.resIds }).pipe(
tap((data: any) => {
if (!this.functions.empty(data.resourcesInformations.warning)) {
this.resourcesWarnings = data.resourcesInformations.warning;
......
......@@ -69,7 +69,7 @@ export class SendAvisWorkflowComponent implements AfterViewInit {
indexDocument() {
return new Promise((resolve, reject) => {
this.http.post('../../rest/resources', this.data.resource).pipe(
this.http.post('../rest/resources', this.data.resource).pipe(
tap((data: any) => {
this.data.resIds = [data.resId];
resolve(true);
......
......@@ -37,7 +37,7 @@ export class CloseAndIndexActionComponent implements OnInit {
indexDocumentAndExecuteAction() {
this.http.post('../../rest/resources', this.data.resource).pipe(
this.http.post('../rest/resources', this.data.resource).pipe(
tap((data: any) => {
this.data.resIds = [data.resId];
}),
......
......@@ -41,11 +41,11 @@ export class CloseMailActionComponent implements OnInit {
}
checkIndexingClose() {
this.http.get(`../../rest/actions/${this.data.action.id}`).pipe(
this.http.get(`../rest/actions/${this.data.action.id}`).pipe(
tap((data: any) => {
this.requiredFields = data.action.parameters.requiredFields;
}),
exhaustMap(() => this.http.get(`../../rest/customFields`)),
exhaustMap(() => this.http.get(`../rest/customFields`)),
tap((data: any) => this.customFields = data.customFields),
tap(() => {
let emptyFields: Array<any> = [];
......@@ -71,7 +71,7 @@ export class CloseMailActionComponent implements OnInit {
}
checkClose() {
this.http.post(`../../rest/resourcesList/users/${this.data.userId}/groups/${this.data.groupId}/baskets/${this.data.basketId}/actions/${this.data.action.id}/checkCloseWithFieldsAction`, { resources: this.data.resIds }).pipe(
this.http.post(`../rest/resourcesList/users/${this.data.userId}/groups/${this.data.groupId}/baskets/${this.data.basketId}/actions/${this.data.action.id}/checkCloseWithFieldsAction`, { resources: this.data.resIds }).pipe(
tap((data: any) => {
this.emptyMandatoryFields = data.errors;
this.canCloseResIds = data.success;
......@@ -94,7 +94,7 @@ export class CloseMailActionComponent implements OnInit {
}
indexDocumentAndExecuteAction() {
this.http.post('../../rest/resources', this.data.resource).pipe(
this.http.post('../rest/resources', this.data.resource).pipe(
tap((data: any) => {
this.data.resIds = [data.resId];
}),
......
......@@ -29,7 +29,7 @@ export class closeMailWithAttachmentsOrNotesActionComponent implements OnInit {
ngOnInit(): void {
this.loadingInit = true;
this.http.post('../../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/checkAttachmentsAndNotes', { resources: this.data.resIds })
this.http.post('../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/checkAttachmentsAndNotes', { resources: this.data.resIds })
.subscribe((data: any) => {
this.resourcesInfo = data;
this.loadingInit = false;
......
......@@ -37,7 +37,7 @@ export class ConfirmActionComponent implements OnInit {
}
indexDocumentAndExecuteAction() {
this.http.post('../../rest/resources', this.data.resource).pipe(
this.http.post('../rest/resources', this.data.resource).pipe(
tap((data: any) => {
this.data.resIds = [data.resId];
}),
......
......@@ -59,7 +59,7 @@ export class CreateAcknowledgementReceiptActionComponent implements OnInit, OnDe
}
checkAcknowledgementReceipt() {
this.http.post('../../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/actions/' + this.data.action.id + '/checkAcknowledgementReceipt?' + this.currentMode, { resources: this.data.resIds })
this.http.post('../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/actions/' + this.data.action.id + '/checkAcknowledgementReceipt?' + this.currentMode, { resources: this.data.resIds })
.subscribe((data: any) => {
this.acknowledgement = data;
this.realResSelected = data.sendList;
......@@ -120,7 +120,7 @@ export class CreateAcknowledgementReceiptActionComponent implements OnInit, OnDe
downloadAcknowledgementReceipt(data: any) {
this.loadingExport = true;
this.http.post('../../rest/acknowledgementReceipts', { 'resources': data }, { responseType: "blob" })
this.http.post('../rest/acknowledgementReceipts', { 'resources': data }, { responseType: "blob" })
.subscribe((data) => {
let downloadLink = document.createElement('a');
downloadLink.href = window.URL.createObjectURL(data);
......@@ -201,7 +201,7 @@ export class CreateAcknowledgementReceiptActionComponent implements OnInit, OnDe
this.templateEmailListForm.reset();
this.http.post(`../../rest/templates/${templateId}/mergeEmail`, { data: { resId: this.data.resIds[0] } }).pipe(
this.http.post(`../rest/templates/${templateId}/mergeEmail`, { data: { resId: this.data.resIds[0] } }).pipe(
tap((data: any) => {
var div = document.createElement('div');
......@@ -231,7 +231,7 @@ export class CreateAcknowledgementReceiptActionComponent implements OnInit, OnDe
this.emailSignListForm.reset();
this.http.get(`../../rest/currentUser/emailSignatures/${templateId}`).pipe(
this.http.get(`../rest/currentUser/emailSignatures/${templateId}`).pipe(
tap((data: any) => {
var div = document.createElement('div');
......@@ -255,7 +255,7 @@ export class CreateAcknowledgementReceiptActionComponent implements OnInit, OnDe
initEmailModelsList() {
if (this.availableEmailModels.length === 0 && this.data.resIds.length === 1) {
this.http.get(`../../rest/resources/${this.data.resIds[0]}/emailTemplates`).pipe(
this.http.get(`../rest/resources/${this.data.resIds[0]}/emailTemplates`).pipe(
tap((data: any) => {
this.availableEmailModels = data.templates;
}),
......@@ -269,7 +269,7 @@ export class CreateAcknowledgementReceiptActionComponent implements OnInit, OnDe
initSignEmailModelsList() {
if (this.availableSignEmailModels.length === 0 && this.data.resIds.length === 1) {
this.http.get(`../../rest/currentUser/emailSignatures`).pipe(
this.http.get(`../rest/currentUser/emailSignatures`).pipe(
tap((data: any) => {
this.availableSignEmailModels = data.emailSignatures;
}),
......
......@@ -48,7 +48,7 @@ export class ReconcileActionComponent implements OnInit {
this.resourcesErrors = [];
return new Promise((resolve, reject) => {
this.http.post('../../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/actions/' + this.data.action.id + '/checkReconcile', { resources: this.data.resIds, })
this.http.post('../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/actions/' + this.data.action.id + '/checkReconcile', { resources: this.data.resIds, })
.subscribe((data: any) => {
if(!this.functions.empty(data.resourcesInformations.error)) {
this.resourcesErrors = data.resourcesInformations.error;
......
......@@ -51,7 +51,7 @@ export class RedirectActionComponent implements OnInit {
ngOnInit(): void {
let noEntity = true;
this.loading = true;
this.http.get('../../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/actions/' + this.data.action.id + '/getRedirect')
this.http.get('../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/actions/' + this.data.action.id + '/getRedirect')
.subscribe((data: any) => {
this.entities = data['entities'];
this.userListRedirect = data.users;
......@@ -142,7 +142,7 @@ export class RedirectActionComponent implements OnInit {
this.loading = false;
if (this.data.resIds.length === 1) {
this.http.get('../../rest/resources/' + this.data.resIds[0] + '/listInstance').subscribe((data: any) => {
this.http.get('../rest/resources/' + this.data.resIds[0] + '/listInstance').subscribe((data: any) => {
this.diffusionListDestRedirect = data.listInstance;
Object.keys(data).forEach(diffusionRole => {
data[diffusionRole].forEach((line: any) => {
......@@ -178,7 +178,7 @@ export class RedirectActionComponent implements OnInit {
if (this.data.resIds.length === 1) {
this.isDestinationChanging = false;
this.http.get('../../rest/resources/' + this.data.resIds[0] + '/users/' + user.id + '/isDestinationChanging')
this.http.get('../rest/resources/' + this.data.resIds[0] + '/users/' + user.id + '/isDestinationChanging')
.subscribe((data: any) => {
this.isDestinationChanging = data.isDestinationChanging;
}, (err: any) => {
......
......@@ -29,7 +29,7 @@ export class redirectInitiatorEntityActionComponent implements OnInit {
ngOnInit(): void {
this.loadingInit = true;
this.http.post('../../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/checkInitiatorEntity', { resources: this.data.resIds })
this.http.post('../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/checkInitiatorEntity', { resources: this.data.resIds })
.subscribe((data: any) => {
this.resourcesInfo = data;
this.loadingInit = false;
......
......@@ -33,7 +33,7 @@ export class SendExternalNoteBookActionComponent implements OnInit {
ngOnInit(): void {
this.loading = true;
this.http.post('../../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/checkExternalNoteBook', { resources: this.data.resIds }).pipe(
this.http.post('../rest/resourcesList/users/' + this.data.userId + '/groups/' + this.data.groupId + '/baskets/' + this.data.basketId + '/checkExternalNoteBook', { resources: this.data.resIds }).pipe(
map((data: any) => {
data.additionalsInfos.users.forEach((element: any) => {
element.displayName = element.firstname + ' ' + element.lastname;
......
......@@ -75,7 +75,7 @@ export class SendExternalSignatoryBookActionComponent implements OnInit {
this.loading = true;
return new Promise((resolve, reject) => {
this.http.post(`../../rest/resourcesList/users/${this.data.userId}/groups/${this.data.groupId}/baskets/${this.data.basketId}/checkExternalSignatoryBook`, { resources: this.data.resIds }).pipe(
this.http.post(`../rest/resourcesList/users/${this.data.userId}/groups/${this.data.groupId}/baskets/${this.data.basketId}/checkExternalSignatoryBook`, { resources: this.data.resIds }).pipe(
tap((data: any) => {
this.additionalsInfos = data.additionalsInfos;
if (this.additionalsInfos.attachments.length > 0) {
......@@ -132,7 +132,7 @@ export class SendExternalSignatoryBookActionComponent implements OnInit {
}
toggleIntegration(integrationId: string) {
this.http.put(`../../rest/resourcesList/integrations`, {resources : this.data.resIds, integrations : { [integrationId] : !this.data.resource.integrations[integrationId]}}).pipe(
this.http.put(`../rest/resourcesList/integrations`, {resources : this.data.resIds, integrations : { [integrationId] : !this.data.resource.integrations[integrationId]}}).pipe(
tap(async () => {
this.data.resource.integrations[integrationId] = !this.data.resource.integrations[integrationId];
await this.checkExternalSignatureBook();
......
......@@ -57,7 +57,7 @@ export class XParaphComponent implements OnInit {
startWith(''),
map(state => state ? this._filterUsers(state) : this.usersWorkflowList.slice())
);
this.http.get('../../rest/xParaphWorkflow?login=' + account.login + '&siret=' + account.siret)
this.http.get('../rest/xParaphWorkflow?login=' + account.login + '&siret=' + account.siret)
.subscribe((data: any) => {
this.usersWorkflowList = data.workflow;
this.usersWorkflowList.forEach(element => {
......@@ -133,7 +133,7 @@ export class XParaphComponent implements OnInit {
addNewAccount() {
this.loading = true;
this.http.post('../../rest/xParaphAccount', { login: this.newAccount.login, siret: this.newAccount.siret })
this.http.post('../rest/xParaphAccount', { login: this.newAccount.login, siret: this.newAccount.siret })
.subscribe((data: any) => {
this.additionalsInfos.accounts.push({
'login': this.newAccount.login,
......@@ -154,7 +154,7 @@ export class XParaphComponent implements OnInit {
const r = confirm(this.lang.confirmDeleteAccount);
if (r) {
this.http.delete('../../rest/xParaphAccount?siret=' + this.additionalsInfos.accounts[index].siret + '&login=' + this.additionalsInfos.accounts[index].login)
this.http.delete('../rest/xParaphAccount?siret=' + this.additionalsInfos.accounts[index].siret + '&login=' + this.additionalsInfos.accounts[index].login)
.subscribe((data: any) => {
this.additionalsInfos.accounts.splice(index, 1);
this.notify.success(this.lang.accountDeleted);
......
......@@ -114,7 +114,7 @@
style="width: 50%;">
<div class="pjList">
<img *ngFor="let attach of attachList" title="{{attach.chrono}} : {{attach.title}}"
[src]="'../../rest/' + (attach.type === 'attachment' ? 'attachments' : 'resources') + '/' + attach.res_id + '/thumbnail' | secureUrl | async" />
[src]="'../rest/' + (attach.type === 'attachment' ? 'attachments' : 'resources') + '/' + attach.res_id + '/thumbnail' | secureUrl | async" />
</div>
</mat-sidenav>
</mat-sidenav-container>
......
......@@ -68,7 +68,7 @@ export class SendShippingActionComponent implements OnInit {
}
checkShipping() {
this.http.post(`../../rest/resourcesList/users/${this.data.userId}/groups/${this.data.groupId}/baskets/${this.data.basketId}/actions/${this.data.action.id}/checkShippings`, { resources: this.data.resIds }).pipe(
this.http.post(`../rest/resourcesList/users/${this.data.userId}/groups/${this.data.groupId}/baskets/${this.data.basketId}/actions/${this.data.action.id}/checkShippings`, { resources: this.data.resIds }).pipe(
tap((data: any) => {
if (!this.functions.empty(data.fatalError)) {
this.fatalError = data;
......@@ -111,7 +111,7 @@ export class SendShippingActionComponent implements OnInit {
}
toggleIntegration(integrationId: string) {
this.http.put(`../../rest/resourcesList/integrations`, {resources : this.data.resIds, integrations : { [integrationId] : !this.data.resource.integrations[integrationId]}}).pipe(
this.http.put(`../rest/resourcesList/integrations`, {resources : this.data.resIds, integrations : { [integrationId] : !this.data.resource.integrations[integrationId]}}).pipe(
tap(() => {
this.data.resource.integrations[integrationId] = !this.data.resource.integrations[integrationId];
this.checkShipping();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment