Pull request #179: fix project owner not reloading after change
Merge in RED/ui from RED-1404 to master * commit '1f7359d4018106993a753c76d62aa4682c10c617': fix project owner not reloading after change
This commit is contained in:
commit
540641c5fe
@ -15,7 +15,7 @@ import { ProjectsDialogService } from '../../services/projects-dialog.service';
|
||||
})
|
||||
export class ProjectListingActionsComponent implements OnInit {
|
||||
@Input() project: ProjectWrapper;
|
||||
@Output() actionPerformed = new EventEmitter();
|
||||
@Output() actionPerformed = new EventEmitter<ProjectWrapper | undefined>();
|
||||
actionMenuOpen = false;
|
||||
|
||||
constructor(
|
||||
@ -28,7 +28,9 @@ export class ProjectListingActionsComponent implements OnInit {
|
||||
ngOnInit(): void {}
|
||||
|
||||
public openAssignProjectOwnerDialog($event: MouseEvent, project: ProjectWrapper) {
|
||||
this._dialogService.openAssignProjectMembersAndOwnerDialog($event, project);
|
||||
this._dialogService.openAssignProjectMembersAndOwnerDialog($event, project, (pw: ProjectWrapper) => {
|
||||
this.actionPerformed.emit(pw);
|
||||
});
|
||||
}
|
||||
|
||||
public openDeleteProjectDialog($event: MouseEvent, project: ProjectWrapper) {
|
||||
|
||||
@ -72,6 +72,7 @@ export class AssignOwnerDialogComponent {
|
||||
}
|
||||
|
||||
async saveUsers() {
|
||||
let result;
|
||||
try {
|
||||
if (this.data.type === 'project') {
|
||||
const ownerId = this.selectedSingleUser;
|
||||
@ -79,7 +80,7 @@ export class AssignOwnerDialogComponent {
|
||||
const pw = Object.assign({}, this.data.project);
|
||||
pw.project.memberIds = memberIds;
|
||||
pw.project.ownerId = ownerId;
|
||||
await this._appStateService.addOrUpdateProject(pw.project);
|
||||
result = await this._appStateService.addOrUpdateProject(pw.project);
|
||||
}
|
||||
|
||||
if (this.data.type === 'file') {
|
||||
@ -102,7 +103,7 @@ export class AssignOwnerDialogComponent {
|
||||
this._notificationService.showToastNotification('Failed: ' + error.error ? error.error.message : error, null, NotificationType.ERROR);
|
||||
}
|
||||
|
||||
this.dialogRef.close();
|
||||
this.dialogRef.close(result);
|
||||
}
|
||||
|
||||
get singleUsersSelectOptions() {
|
||||
|
||||
@ -125,10 +125,10 @@
|
||||
<redaction-needs-work-badge [needsWorkInput]="pw"></redaction-needs-work-badge>
|
||||
</div>
|
||||
<div class="user-column">
|
||||
<redaction-initials-avatar [userId]="pw.project.ownerId" [withName]="true"></redaction-initials-avatar>
|
||||
<redaction-initials-avatar [user]="getUser(pw.project.ownerId)" [withName]="true"></redaction-initials-avatar>
|
||||
</div>
|
||||
<div class="status-container">
|
||||
<redaction-project-listing-actions (actionPerformed)="actionPerformed(pw)" [project]="pw"></redaction-project-listing-actions>
|
||||
<redaction-project-listing-actions (actionPerformed)="actionPerformed($event)" [project]="pw"></redaction-project-listing-actions>
|
||||
</div>
|
||||
<div class="scrollbar-placeholder"></div>
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Component, Injector, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||
import { Project, RuleSetModel } from '@redaction/red-ui-http';
|
||||
import { Project, RuleSetModel, User } from '@redaction/red-ui-http';
|
||||
import { AppStateService } from '../../../../state/app-state.service';
|
||||
import { UserService } from '../../../../services/user.service';
|
||||
import { DoughnutChartConfig } from '../../../shared/components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
@ -64,9 +64,9 @@ export class ProjectListingScreenComponent extends BaseListingComponent<ProjectW
|
||||
private _fileChangedSub: Subscription;
|
||||
|
||||
constructor(
|
||||
public readonly userService: UserService,
|
||||
public readonly translateChartService: TranslateChartService,
|
||||
public readonly permissionsService: PermissionsService,
|
||||
private readonly _translateChartService: TranslateChartService,
|
||||
private readonly _userService: UserService,
|
||||
private readonly _dialogService: ProjectsDialogService,
|
||||
private readonly _translateService: TranslateService,
|
||||
private readonly _router: Router,
|
||||
@ -150,11 +150,15 @@ export class ProjectListingScreenComponent extends BaseListingComponent<ProjectW
|
||||
});
|
||||
}
|
||||
this.documentsChartData.sort((a, b) => StatusSorter[a.key] - StatusSorter[b.key]);
|
||||
this.documentsChartData = this.translateChartService.translateStatus(this.documentsChartData);
|
||||
this.documentsChartData = this._translateChartService.translateStatus(this.documentsChartData);
|
||||
}
|
||||
|
||||
public get user() {
|
||||
return this.userService.user;
|
||||
return this._userService.user;
|
||||
}
|
||||
|
||||
public getUser(id: string): User {
|
||||
return this._userService.getUserById(id);
|
||||
}
|
||||
|
||||
public get activeProjectsCount() {
|
||||
@ -235,7 +239,7 @@ export class ProjectListingScreenComponent extends BaseListingComponent<ProjectW
|
||||
allDistinctPeople.forEach((userId) => {
|
||||
peopleFilters.push({
|
||||
key: userId,
|
||||
label: this.userService.getNameForId(userId)
|
||||
label: this._userService.getNameForId(userId)
|
||||
});
|
||||
});
|
||||
this.peopleFilters = processFilters(this.peopleFilters, peopleFilters);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user