Skip to content
Snippets Groups Projects
Commit 1457d860 authored by Benaissa BENARBIA's avatar Benaissa BENARBIA
Browse files

Revert "TULEAP 24198: Synchronize permission tab"

This reverts commit e02adc8c96f7e16bd149bce2ef2226161891a709.
parent 46d766c3
No related branches found
No related tags found
1 merge request!51Merge mis a jour vitam-ui
...@@ -172,11 +172,8 @@ export class ContextInformationTabComponent { ...@@ -172,11 +172,8 @@ export class ContextInformationTabComponent {
this.prepareSubmit().subscribe(() => { this.prepareSubmit().subscribe(() => {
this.contextService.get(this._context.identifier).subscribe( this.contextService.get(this._context.identifier).subscribe(
response => { response => {
this.submited = false; this.submited = false;
this.context = extend(this.context, response); this.context = response;
// Update the activation and deactivation dates
this.context.activationDate = response.activationDate ? response.activationDate : null;
this.context.deactivationDate = response.deactivationDate ? response.deactivationDate : null;
} }
); );
}, () => { }, () => {
......
...@@ -86,6 +86,7 @@ export class ContextPreviewComponent implements AfterViewInit { ...@@ -86,6 +86,7 @@ export class ContextPreviewComponent implements AfterViewInit {
async checkBeforeExit() { async checkBeforeExit() {
if (await this.confirmAction()) { if (await this.confirmAction()) {
const submitAccessContractUpdate: Observable<Context> = this.tabLinks[this.tabs.selectedIndex].prepareSubmit(); const submitAccessContractUpdate: Observable<Context> = this.tabLinks[this.tabs.selectedIndex].prepareSubmit();
submitAccessContractUpdate.subscribe(() => { submitAccessContractUpdate.subscribe(() => {
this.contextService.get(this.context.identifier).subscribe( this.contextService.get(this.context.identifier).subscribe(
response => { response => {
...@@ -93,17 +94,14 @@ export class ContextPreviewComponent implements AfterViewInit { ...@@ -93,17 +94,14 @@ export class ContextPreviewComponent implements AfterViewInit {
} }
); );
}); });
} else {
this.tabLinks[this.tabs.selectedIndex].resetForm(this.context);
} }
} }
async interceptTabChange(tab: MatTab, tabHeader: MatTabHeader, idx: number) { async interceptTabChange(tab: MatTab, tabHeader: MatTabHeader, idx: number) {
if (this.tabUpdated[this.tabs.selectedIndex]) { if (this.tabUpdated[this.tabs.selectedIndex]) {
await this.checkBeforeExit(); await this.checkBeforeExit();
} else {
if (idx === 1) {
// Reset the permissions for if the context has changed
this.tabLinks[idx].resetForm(this.context);
}
} }
const args = [tab, tabHeader, idx]; const args = [tab, tabHeader, idx];
......
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