Commit f07a63bf authored by Alex ORLUC's avatar Alex ORLUC

FIX #12091 TIME 0:20 fix action mass + resfesh list

parent 78198f27
......@@ -11,8 +11,7 @@ import { Subscription } from 'rxjs';
@Component({
selector: 'app-actions-list',
templateUrl: "actions-list.component.html",
styleUrls: ['actions-list.component.scss'],
providers: [NotificationService, ActionsService],
styleUrls: ['actions-list.component.scss']
})
export class ActionsListComponent implements OnInit {
......@@ -25,7 +24,6 @@ export class ActionsListComponent implements OnInit {
contextMenuPosition = { x: '0px', y: '0px' };
contextMenuTitle = '';
currentAction: any = {};
currentResource: any = null;
basketInfo: any = {};
contextResId = 0;
currentLock: any = null;
......@@ -38,6 +36,7 @@ export class ActionsListComponent implements OnInit {
@Input('totalRes') totalRes: number;
@Input('contextMode') contextMode: boolean;
@Input('currentBasketInfo') currentBasketInfo: any;
@Input('currentResource') currentResource: any = {};
@Output('refreshEvent') refreshEvent = new EventEmitter<string>();
@Output('refreshEventAfterAction') refreshEventAfterAction = new EventEmitter<string>();
......@@ -52,15 +51,8 @@ export class ActionsListComponent implements OnInit {
) { }
dialogRef: MatDialogRef<any>;
subscription: Subscription;
ngOnInit(): void {
// Event after process action
this.subscription = this.actionService.catchAction().subscribe(message => {
this.refreshEventAfterAction.emit();
this.refreshPanelFolders.emit();
});
}
ngOnInit(): void { }
open(x: number, y: number, row: any) {
......@@ -135,9 +127,4 @@ export class ActionsListComponent implements OnInit {
refreshFolders() {
this.refreshPanelFolders.emit();
}
ngOnDestroy() {
// unsubscribe to ensure no memory leaks
this.subscription.unsubscribe();
}
}
......@@ -75,6 +75,7 @@ import { MailResumeComponent } from './mail/mail-resume/m
import { AddPrivateIndexingModelModalComponent } from './indexation/private-indexing-model/add-private-indexing-model-modal.component';
import { FoldersService } from './folder/folders.service';
import { PrivilegeService } from '../service/privileges.service';
import { ActionsService } from './actions/actions.service';
@NgModule({
......@@ -170,7 +171,7 @@ import { PrivilegeService } from '../service/privileges.service';
AddPrivateIndexingModelModalComponent,
AttachmentShowModalComponent
],
providers: [ FiltersListService, FoldersService, NotificationService, PrivilegeService ],
providers: [ FiltersListService, FoldersService, ActionsService, NotificationService, PrivilegeService ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
......@@ -49,7 +49,7 @@
<span>
<app-actions-list #actionsList (refreshEvent)="refreshDao()"
[contextMode]="false" [totalRes]="allResInBasket.length" [selectedRes]="selectedRes"
[currentBasketInfo]="currentBasketInfo" (refreshPanelFolders)="panelFolder.refreshFoldersTree()"></app-actions-list>
[currentBasketInfo]="currentBasketInfo" [currentResource]="currentResource" (refreshPanelFolders)="panelFolder.refreshFoldersTree()"></app-actions-list>
</span>
<span>
<app-tools-list #actionsList [selectedRes]="selectedRes"
......
......@@ -22,6 +22,7 @@ import { PanelListComponent } from './panel/panel-list.component';
import { AppService } from '../../service/app.service';
import { PanelFolderComponent } from '../folder/panel/panel-folder.component';
import { FoldersService } from '../folder/folders.service';
import { ActionsService } from '../actions/actions.service';
declare function $j(selector: any): any;
......@@ -91,6 +92,7 @@ export class BasketListComponent implements OnInit {
private destroy$ = new Subject<boolean>();
subscription: Subscription;
subscription2: Subscription;
@ViewChild('actionsListContext', { static: true }) actionsList: ActionsListComponent;
@ViewChild('filtersTool', { static: true }) filtersTool: FiltersToolComponent;
......@@ -116,7 +118,8 @@ export class BasketListComponent implements OnInit {
public overlay: Overlay,
public viewContainerRef: ViewContainerRef,
public appService: AppService,
private foldersService: FoldersService) {
private foldersService: FoldersService,
private actionService: ActionsService) {
_activatedRoute.queryParams.subscribe(
params => this.specificChrono = params.chrono
);
......@@ -127,6 +130,10 @@ export class BasketListComponent implements OnInit {
this[result.content]();
}
});
this.subscription2 = this.actionService.catchAction().subscribe((message: any) => {
this.refreshDaoAfterAction();
this.panelFolder.refreshFoldersTree();
});
$j("link[href='merged_css.php']").remove();
}
......@@ -171,6 +178,7 @@ export class BasketListComponent implements OnInit {
ngOnDestroy() {
this.destroy$.next(true);
this.subscription.unsubscribe();
this.subscription2.unsubscribe();
}
initResultList() {
......@@ -393,6 +401,7 @@ export class BasketListComponent implements OnInit {
toggleRes(e: any, row: any) {
if (e.checked) {
if (this.selectedRes.indexOf(row.resId) === -1) {
this.currentResource = row;
this.selectedRes.push(row.resId);
row.checked = true;
}
......
Markdown is supported
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