added users
This commit is contained in:
parent
f9ac7c5141
commit
1cc0a28fd9
@ -17,6 +17,12 @@
|
||||
"changeOrigin": true,
|
||||
"logLevel": "debug"
|
||||
},
|
||||
"/user": {
|
||||
"target": "https://timo-redaction-dev.iqser.cloud/",
|
||||
"secure": false,
|
||||
"changeOrigin": true,
|
||||
"logLevel": "debug"
|
||||
},
|
||||
"/download": {
|
||||
"target": "https://timo-redaction-dev.iqser.cloud/",
|
||||
"secure": false,
|
||||
|
||||
@ -35,40 +35,54 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 'UNPROCESSED'
|
||||
// | 'REPROCESS'
|
||||
// | 'PROCESSING'REPROCESS
|
||||
// | 'ERROR'
|
||||
// | 'UNASSIGNED'
|
||||
// | 'UNDER_REVIEW'
|
||||
// | 'UNDER_APPROVAL'
|
||||
// | 'APPROVED';
|
||||
|
||||
circle {
|
||||
&.unassigned {
|
||||
&.UNASSIGNED {
|
||||
stroke: $grey-5;
|
||||
}
|
||||
|
||||
&.under-review {
|
||||
&.UNPROCESSED {
|
||||
stroke: $grey-3;
|
||||
}
|
||||
|
||||
&.UNDER_REVIEW {
|
||||
stroke: $yellow-1;
|
||||
}
|
||||
|
||||
&.under-approval {
|
||||
stroke: $red-1;
|
||||
}
|
||||
|
||||
&.approved {
|
||||
stroke: $blue-2;
|
||||
}
|
||||
|
||||
&.submitted {
|
||||
stroke: $blue-3;
|
||||
}
|
||||
|
||||
&.efsa {
|
||||
&.UNDER_APPROVAL {
|
||||
stroke: $blue-4;
|
||||
}
|
||||
|
||||
&.finished {
|
||||
stroke: $green-2;
|
||||
&.APPROVED {
|
||||
stroke: $blue-3;
|
||||
}
|
||||
|
||||
&.active {
|
||||
&.PROCESSING {
|
||||
stroke: $green-2
|
||||
}
|
||||
|
||||
&.REPROCESS {
|
||||
stroke: $green-1
|
||||
}
|
||||
|
||||
&.ERROR {
|
||||
stroke: $red-1;
|
||||
}
|
||||
|
||||
&.ACTIVE {
|
||||
stroke: $primary;
|
||||
}
|
||||
|
||||
&.archived {
|
||||
&.ARCHIVED {
|
||||
stroke: rgba($red-1, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ export class FilePreviewScreenComponent implements OnInit {
|
||||
private _readyViewers: string[] = [];
|
||||
private projectId: string;
|
||||
private _activeViewer: 'ANNOTATED' | 'REDACTED' = 'ANNOTATED';
|
||||
private _manualRedactionEntry: ManualRedactionEntry;
|
||||
private _manualRedactionEntry: AddRedactionRequest;
|
||||
|
||||
@ViewChild(PdfViewerComponent) private _viewerComponent: PdfViewerComponent;
|
||||
@ViewChild('annotations') private _annotationsElement: ElementRef;
|
||||
@ -256,6 +256,8 @@ export class FilePreviewScreenComponent implements OnInit {
|
||||
maxWidth: '90vw'
|
||||
});
|
||||
|
||||
console.log(annotation);
|
||||
|
||||
const parts = annotation.Id.split(':');
|
||||
const annotationId = parts[parts.length-1];
|
||||
|
||||
|
||||
@ -49,10 +49,10 @@ export class ManualRedactionDialogComponent implements OnInit {
|
||||
saveManualRedaction() {
|
||||
const mre = Object.assign({}, this.addRedactionRequest);
|
||||
this._enhanceManualRedaction(mre);
|
||||
// mre.comment = {
|
||||
// text: 'Lorem ipsum'
|
||||
// };
|
||||
this._manualRedactionControllerService.addRedaction(mre, this._appStateService.activeProject.project.projectId, this._appStateService.activeFile.fileId).subscribe(ok => {
|
||||
mre.comment = {
|
||||
text: 'Lorem ipsum'
|
||||
};
|
||||
this._manualRedactionControllerService.requestAddRedaction(mre, this._appStateService.activeProject.project.projectId, this._appStateService.activeFile.fileId).subscribe(ok => {
|
||||
this._notificationService.showToastNotification(this._translateService.instant('manual-redaction.dialog.add-redaction.success.label'), null, NotificationType.SUCCESS);
|
||||
this.dialogRef.close();
|
||||
}, (err) => {
|
||||
|
||||
@ -92,7 +92,7 @@
|
||||
<!-- <button mat-icon-button (click)="editProject($event,pw.project)">-->
|
||||
<!-- <mat-icon svgIcon="red:edit"></mat-icon>-->
|
||||
<!-- </button>-->
|
||||
<button color="accent" (click)="$event.stopPropagation()" mat-icon-button
|
||||
<button color="accent" (click)="assignProjectPeople($event,pw.project)" mat-icon-button
|
||||
[matTooltip]="'project-listing.assign.action.label'|translate">
|
||||
<mat-icon svgIcon="red:assign"></mat-icon>
|
||||
</button>
|
||||
|
||||
@ -1,15 +1,16 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Project, ProjectControllerService } from '@redaction/red-ui-http';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { AddEditProjectDialogComponent } from './add-edit-project-dialog/add-edit-project-dialog.component';
|
||||
import { ConfirmationDialogComponent } from '../../common/confirmation-dialog/confirmation-dialog.component';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { NotificationService } from '../../notification/notification.service';
|
||||
import { AppStateService, ProjectWrapper } from '../../state/app-state.service';
|
||||
import { UserService } from '../../user/user.service';
|
||||
import { ProjectDetailsDialogComponent } from '../project-overview-screen/project-details-dialog/project-details-dialog.component';
|
||||
import { DoughnutChartConfig } from '../../components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import { SortingOption } from '../../utils/types';
|
||||
import {Component, OnInit} from '@angular/core';
|
||||
import {Project, ProjectControllerService} from '@redaction/red-ui-http';
|
||||
import {MatDialog} from '@angular/material/dialog';
|
||||
import {AddEditProjectDialogComponent} from './add-edit-project-dialog/add-edit-project-dialog.component';
|
||||
import {ConfirmationDialogComponent} from '../../common/confirmation-dialog/confirmation-dialog.component';
|
||||
import {TranslateService} from '@ngx-translate/core';
|
||||
import {NotificationService} from '../../notification/notification.service';
|
||||
import {AppStateService, ProjectWrapper} from '../../state/app-state.service';
|
||||
import {UserService} from '../../user/user.service';
|
||||
import {ProjectDetailsDialogComponent} from '../project-overview-screen/project-details-dialog/project-details-dialog.component';
|
||||
import {DoughnutChartConfig} from '../../components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import {SortingOption} from '../../utils/types';
|
||||
import {groupBy} from "../../utils/functions";
|
||||
|
||||
@Component({
|
||||
selector: 'redaction-project-listing-screen',
|
||||
@ -20,8 +21,8 @@ export class ProjectListingScreenComponent implements OnInit {
|
||||
public projectsChartData: DoughnutChartConfig [] = [];
|
||||
public documentsChartData: DoughnutChartConfig [] = [];
|
||||
public sortingOptions: SortingOption[] = [
|
||||
{ label: 'project-listing.sorting.recent.label', order: 'desc', column: 'projectDate' },
|
||||
{ label: 'project-listing.sorting.alphabetically.label', order: 'asc', column: 'project.projectName' }
|
||||
{label: 'project-listing.sorting.recent.label', order: 'desc', column: 'projectDate'},
|
||||
{label: 'project-listing.sorting.alphabetically.label', order: 'asc', column: 'project.projectName'}
|
||||
];
|
||||
public sortingOption: SortingOption = this.sortingOptions[0];
|
||||
|
||||
@ -41,14 +42,15 @@ export class ProjectListingScreenComponent implements OnInit {
|
||||
ngOnInit(): void {
|
||||
this.appStateService.reset();
|
||||
this.projectsChartData = [
|
||||
{ value: this.activeProjects, color: 'active', label: 'active' },
|
||||
{ value: this.inactiveProjects, color: 'archived', label: 'archived' }
|
||||
{value: this.activeProjects, color: 'ACTIVE', label: 'active'},
|
||||
{value: this.inactiveProjects, color: 'DELETED', label: 'archived'}
|
||||
];
|
||||
this.documentsChartData = [
|
||||
{ value: this.appStateService.totalDocuments, color: 'unassigned', label: 'unassigned' },
|
||||
// { value: 40, color: 'under-review', label: 'under review' },
|
||||
// { value: 16, color: 'under-approval', label: 'under approval' },
|
||||
]
|
||||
const groups = groupBy(this.appStateService.aggregatedFiles, 'status');
|
||||
this.documentsChartData = [];
|
||||
for (const key of Object.keys(groups)) {
|
||||
this.documentsChartData.push({value: groups[key].length, color: key, label: key});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
openAddProjectDialog(project?: Project): void {
|
||||
@ -87,7 +89,7 @@ export class ProjectListingScreenComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
get totalPages(){
|
||||
get totalPages() {
|
||||
return this.appStateService.totalAnalysedPages;
|
||||
}
|
||||
|
||||
@ -106,4 +108,11 @@ export class ProjectListingScreenComponent implements OnInit {
|
||||
get inactiveProjects() {
|
||||
return this.appStateService.allProjects.length - this.activeProjects;
|
||||
}
|
||||
|
||||
assignProjectPeople($event: MouseEvent, project: Project) {
|
||||
$event.stopPropagation();
|
||||
this._projectControllerService.assignProjectOwner(project.projectId, this._userService.user.id).subscribe(() => {
|
||||
this._notificationService.showToastNotification("Successfully assigned " + this.user.name + " to project: " + project.projectName);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,6 +77,7 @@
|
||||
<div class="small-label flex-2 assigned-to min-width">
|
||||
<redaction-initials-avatar
|
||||
withName="true"
|
||||
[username]="getUsername(fileStatus)"
|
||||
></redaction-initials-avatar>
|
||||
</div>
|
||||
|
||||
@ -95,7 +96,7 @@
|
||||
[matTooltip]="'project-overview.report.action.label'|translate">
|
||||
<mat-icon svgIcon="red:report"></mat-icon>
|
||||
</button>
|
||||
<button (click)="$event.stopPropagation()" color="accent" mat-icon-button
|
||||
<button (click)="assignPeopleToFile($event,fileStatus)" color="accent" mat-icon-button
|
||||
[matTooltip]="'project-overview.assign.action.label'|translate">
|
||||
<mat-icon svgIcon="red:assign"></mat-icon>
|
||||
</button>
|
||||
@ -154,15 +155,16 @@
|
||||
<div class="project-team mt-20">
|
||||
<div class="all-caps-label" translate="project-overview.project-details.project-team.label"></div>
|
||||
<div class="flex mt-20 members-container">
|
||||
<div *ngFor="let username of ['S H', 'D O', 'E G', 'D V', 'J A', 'T H', 'P B']" class="member">
|
||||
<div *ngFor="let username of getMembers()" class="member">
|
||||
<redaction-initials-avatar [username]="username" size="large"></redaction-initials-avatar>
|
||||
</div>
|
||||
<div class="member">
|
||||
<div class="oval large white-dark">+2</div>
|
||||
</div>
|
||||
<div class="member">
|
||||
<div class="oval red-white large">+</div>
|
||||
</div>
|
||||
<!-- TODO THIS IS OVERFLOW-->
|
||||
<!-- <div class="member">-->
|
||||
<!-- <div class="oval large white-dark">+2</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="member">-->
|
||||
<!-- <div class="oval red-white large">+</div>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@ import { AddEditProjectDialogComponent } from '../project-listing-screen/add-edi
|
||||
import { UserService } from '../../user/user.service';
|
||||
import { SortingOption } from '../../utils/types';
|
||||
import { DoughnutChartConfig } from '../../components/simple-doughnut-chart/simple-doughnut-chart.component';
|
||||
import {groupBy} from "../../utils/functions";
|
||||
|
||||
|
||||
@Component({
|
||||
@ -130,16 +131,11 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
private _calculateChartConfig() {
|
||||
const obj = this.appStateService.activeProject.files.reduce((acc, file) => {
|
||||
acc[file.status === 'PROCESSED' ? 'finished' : file.status === 'ERROR' ? 'under-approval' : 'under-review']++;
|
||||
return acc;
|
||||
}, { 'finished': 0, 'under-approval': 0, 'under-review': 0 });
|
||||
|
||||
this.documentsChartData = Object.keys(obj).map((key) => ({
|
||||
value: obj[key],
|
||||
color: key,
|
||||
label: key
|
||||
})) as DoughnutChartConfig[];
|
||||
const groups = groupBy(this.appStateService.activeProject.files, 'status');
|
||||
this.documentsChartData = [];
|
||||
for (const key of Object.keys(groups)) {
|
||||
this.documentsChartData.push({value: groups[key].length, color: key, label: key});
|
||||
}
|
||||
}
|
||||
|
||||
fileId(index, item) {
|
||||
@ -190,6 +186,22 @@ export class ProjectOverviewScreenComponent implements OnInit, OnDestroy {
|
||||
|
||||
|
||||
canOpenFile(fileStatus: FileStatus): boolean {
|
||||
return fileStatus === 'PROCESSED' || fileStatus === 'REVIEWED';
|
||||
// TODO check correct condition for this
|
||||
return fileStatus === 'PROCESSING' || fileStatus === 'REVIEWED' || true;
|
||||
}
|
||||
|
||||
assignPeopleToFile($event: MouseEvent, fileStatus: FileStatus) {
|
||||
$event.stopPropagation();
|
||||
this._statusControllerService.assignProjectOwner1(this.appStateService.activeProjectId, fileStatus.fileId, this.user.id).subscribe(()=>{
|
||||
this._notificationService.showToastNotification("Successfully assigned " + this.user.name + " to file: " + fileStatus.filename);
|
||||
});
|
||||
}
|
||||
|
||||
getMembers(){
|
||||
return this.appStateService.activeProject.project.memberIds.map(m => this._userService.getName(this._userService.getUserById(m)))
|
||||
}
|
||||
|
||||
getUsername(fileStatus: FileStatus) {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import {Injectable} from "@angular/core";
|
||||
import {ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot, UrlTree} from "@angular/router";
|
||||
import {Observable} from "rxjs";
|
||||
import {ActivatedRouteSnapshot, CanActivate, RouterStateSnapshot} from "@angular/router";
|
||||
import {AppStateService} from "./app-state.service";
|
||||
import {UserService} from "../user/user.service";
|
||||
|
||||
|
||||
@Injectable({
|
||||
@ -9,13 +9,15 @@ import {AppStateService} from "./app-state.service";
|
||||
})
|
||||
export class AppStateGuard implements CanActivate {
|
||||
|
||||
constructor(private readonly _appStateService: AppStateService) {
|
||||
constructor(private readonly _appStateService: AppStateService, private readonly _userService: UserService) {
|
||||
}
|
||||
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||
return this._appStateService.loadAllProjectsIfNecessary().then(t => {
|
||||
return true;
|
||||
})
|
||||
async canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean> {
|
||||
|
||||
await this._userService.loadAllUsersIfNecessary()
|
||||
await this._appStateService.loadAllProjectsIfNecessary();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -44,6 +44,13 @@ export class AppStateService {
|
||||
}
|
||||
}
|
||||
|
||||
get aggregatedFiles(): FileStatus[] {
|
||||
const result : FileStatus[] =[];
|
||||
this._appState.projects.forEach(p =>{
|
||||
result.push(...p.files);
|
||||
})
|
||||
return result;
|
||||
}
|
||||
|
||||
get activeProjectId(): string {
|
||||
return this._appState.activeProject?.project?.projectId;
|
||||
|
||||
@ -1,18 +1,19 @@
|
||||
import {Injectable} from "@angular/core";
|
||||
import {KeycloakService} from "keycloak-angular";
|
||||
import {KeycloakProfile} from "keycloak-js";
|
||||
|
||||
import jwt_decode from "jwt-decode";
|
||||
import {UserControllerService} from "../../../../../libs/red-ui-http/src/lib/api/userController.service";
|
||||
import {User} from "@redaction/red-ui-http";
|
||||
|
||||
export class UserWrapper {
|
||||
|
||||
constructor(private _currentUser: KeycloakProfile, public roles: string[]) {
|
||||
constructor(private _currentUser: KeycloakProfile, public roles: string[], public id: string) {
|
||||
}
|
||||
|
||||
get name() {
|
||||
return this._currentUser.firstName + " " + this._currentUser.lastName;
|
||||
}
|
||||
|
||||
|
||||
get isManager() {
|
||||
return this.roles.indexOf("RED_MANAGER") >= 0;
|
||||
}
|
||||
@ -39,16 +40,38 @@ export class UserWrapper {
|
||||
export class UserService {
|
||||
|
||||
private _currentUser: UserWrapper;
|
||||
private _allUsers: User[];
|
||||
|
||||
constructor(private _keycloakService: KeycloakService) {
|
||||
constructor(private readonly _keycloakService: KeycloakService, private readonly _userControllerService: UserControllerService) {
|
||||
}
|
||||
|
||||
logout() {
|
||||
this._keycloakService.logout(window.location.origin);
|
||||
}
|
||||
|
||||
|
||||
get allUsers() {
|
||||
return this._allUsers;
|
||||
}
|
||||
|
||||
async loadAllUsersIfNecessary() {
|
||||
if (!this._allUsers) {
|
||||
await this.loadAllUsers();
|
||||
}
|
||||
}
|
||||
|
||||
async loadAllUsers() {
|
||||
const allUsers = await this._userControllerService.getAllUsers({}, 0, 100).toPromise();
|
||||
this._allUsers = allUsers.users;
|
||||
return allUsers;
|
||||
}
|
||||
|
||||
|
||||
async loadCurrentUser() {
|
||||
this._currentUser = new UserWrapper(await this._keycloakService.loadUserProfile(false), this._keycloakService.getUserRoles(true));
|
||||
const token = await this._keycloakService.getToken();
|
||||
const decoded = jwt_decode(token);
|
||||
const userId = decoded.sub;
|
||||
this._currentUser = new UserWrapper(await this._keycloakService.loadUserProfile(false), this._keycloakService.getUserRoles(true), userId);
|
||||
}
|
||||
|
||||
get user() {
|
||||
@ -56,4 +79,14 @@ export class UserService {
|
||||
}
|
||||
|
||||
|
||||
getUserById(id: string) {
|
||||
return this._allUsers.find(u => u.userId === id);
|
||||
}
|
||||
|
||||
getName(user?: User) {
|
||||
if (user) {
|
||||
return user.firstName + " " + user.lastName;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
6
apps/red-ui/src/app/utils/functions.ts
Normal file
6
apps/red-ui/src/app/utils/functions.ts
Normal file
@ -0,0 +1,6 @@
|
||||
export function groupBy(xs: any[], key: string) {
|
||||
return xs.reduce((rv, x) => {
|
||||
(rv[x[key]] = rv[x[key]] || []).push(x);
|
||||
return rv;
|
||||
}, {});
|
||||
}
|
||||
13
apps/red-ui/src/app/utils/types.d.ts
vendored
13
apps/red-ui/src/app/utils/types.d.ts
vendored
@ -1,13 +1,6 @@
|
||||
export type Color =
|
||||
'unassigned' |
|
||||
'under-review' |
|
||||
'under-approval' |
|
||||
'approved' |
|
||||
'submitted' |
|
||||
'efsa' |
|
||||
'finished' |
|
||||
'active' |
|
||||
'archived';
|
||||
import {FileStatus} from "@redaction/red-ui-http";
|
||||
|
||||
export type Color = FileStatus.StatusEnum | ProjectStatus.StatusEnum;
|
||||
|
||||
export type AnnotationType =
|
||||
'hint' |
|
||||
|
||||
@ -17,6 +17,9 @@ server {
|
||||
location /project {
|
||||
proxy_pass $API_URL;
|
||||
}
|
||||
location /user {
|
||||
proxy_pass $API_URL;
|
||||
}
|
||||
location /dictionary {
|
||||
proxy_pass $API_URL;
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ import {ReanalysisControllerService} from './api/reanalysisController.service';
|
||||
import {RedactionLogControllerService} from './api/redactionLogController.service';
|
||||
import {RulesControllerService} from './api/rulesController.service';
|
||||
import {StatusControllerService} from './api/statusController.service';
|
||||
import {UserControllerService} from "./api/userController.service";
|
||||
|
||||
@NgModule({
|
||||
imports: [],
|
||||
@ -30,6 +31,7 @@ import {StatusControllerService} from './api/statusController.service';
|
||||
ReanalysisControllerService,
|
||||
RedactionLogControllerService,
|
||||
RulesControllerService,
|
||||
UserControllerService,
|
||||
StatusControllerService]
|
||||
})
|
||||
export class ApiModule {
|
||||
|
||||
@ -24,9 +24,9 @@ import {Configuration} from '../configuration';
|
||||
@Injectable()
|
||||
export class StatusControllerService {
|
||||
|
||||
protected basePath = '';
|
||||
public defaultHeaders = new HttpHeaders();
|
||||
public configuration = new Configuration();
|
||||
protected basePath = '';
|
||||
|
||||
constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string, @Optional() configuration: Configuration) {
|
||||
if (basePath) {
|
||||
@ -38,6 +38,77 @@ export class StatusControllerService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param consumes string[] mime-types
|
||||
* @return true: consumes contains 'multipart/form-data', false: otherwise
|
||||
*/
|
||||
private canConsumeForm(consumes: string[]): boolean {
|
||||
const form = 'multipart/form-data';
|
||||
for (const consume of consumes) {
|
||||
if (form === consume) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Assigns new owner to project.
|
||||
* None
|
||||
* @param projectId projectId
|
||||
* @param fileId fileId
|
||||
* @param reviewerId reviewerId
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public assignProjectOwner1(projectId: string, fileId: string, reviewerId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public assignProjectOwner1(projectId: string, fileId: string, reviewerId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public assignProjectOwner1(projectId: string, fileId: string, reviewerId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public assignProjectOwner1(projectId: string, fileId: string, reviewerId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
|
||||
if (projectId === null || projectId === undefined) {
|
||||
throw new Error('Required parameter projectId was null or undefined when calling assignProjectOwner1.');
|
||||
}
|
||||
|
||||
if (fileId === null || fileId === undefined) {
|
||||
throw new Error('Required parameter fileId was null or undefined when calling assignProjectOwner1.');
|
||||
}
|
||||
|
||||
if (reviewerId === null || reviewerId === undefined) {
|
||||
throw new Error('Required parameter reviewerId was null or undefined when calling assignProjectOwner1.');
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
|
||||
// authentication (RED-OAUTH) required
|
||||
if (this.configuration.accessToken) {
|
||||
const accessToken = typeof this.configuration.accessToken === 'function'
|
||||
? this.configuration.accessToken()
|
||||
: this.configuration.accessToken;
|
||||
headers = headers.set('Authorization', 'Bearer ' + accessToken);
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
const httpHeaderAccepts: string[] = [];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected !== undefined) {
|
||||
headers = headers.set('Accept', httpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [];
|
||||
|
||||
return this.httpClient.request<any>('post', `${this.basePath}/status/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}/${encodeURIComponent(String(reviewerId))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status for all files in a project.
|
||||
* None
|
||||
@ -46,11 +117,8 @@ export class StatusControllerService {
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public getProjectStatus(projectId: string, observe?: 'body', reportProgress?: boolean): Observable<Array<FileStatus>>;
|
||||
|
||||
public getProjectStatus(projectId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<Array<FileStatus>>>;
|
||||
|
||||
public getProjectStatus(projectId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<Array<FileStatus>>>;
|
||||
|
||||
public getProjectStatus(projectId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
|
||||
if (projectId === null || projectId === undefined) {
|
||||
@ -90,17 +158,105 @@ export class StatusControllerService {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param consumes string[] mime-types
|
||||
* @return true: consumes contains 'multipart/form-data', false: otherwise
|
||||
* Sets the status APPROVED for a file.
|
||||
* None
|
||||
* @param projectId projectId
|
||||
* @param fileId fileId
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
private canConsumeForm(consumes: string[]): boolean {
|
||||
const form = 'multipart/form-data';
|
||||
for (const consume of consumes) {
|
||||
if (form === consume) {
|
||||
return true;
|
||||
}
|
||||
public setStatusApproved(projectId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public setStatusApproved(projectId: string, fileId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public setStatusApproved(projectId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public setStatusApproved(projectId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
|
||||
if (projectId === null || projectId === undefined) {
|
||||
throw new Error('Required parameter projectId was null or undefined when calling setStatusApproved.');
|
||||
}
|
||||
return false;
|
||||
|
||||
if (fileId === null || fileId === undefined) {
|
||||
throw new Error('Required parameter fileId was null or undefined when calling setStatusApproved.');
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
|
||||
// authentication (RED-OAUTH) required
|
||||
if (this.configuration.accessToken) {
|
||||
const accessToken = typeof this.configuration.accessToken === 'function'
|
||||
? this.configuration.accessToken()
|
||||
: this.configuration.accessToken;
|
||||
headers = headers.set('Authorization', 'Bearer ' + accessToken);
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
const httpHeaderAccepts: string[] = [];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected !== undefined) {
|
||||
headers = headers.set('Accept', httpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [];
|
||||
|
||||
return this.httpClient.request<any>('post', `${this.basePath}/status/approved/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the status UNDER_APPROVAL for a file.
|
||||
* None
|
||||
* @param projectId projectId
|
||||
* @param fileId fileId
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
*/
|
||||
public setStatusUnderApproval(projectId: string, fileId: string, observe?: 'body', reportProgress?: boolean): Observable<any>;
|
||||
public setStatusUnderApproval(projectId: string, fileId: string, observe?: 'response', reportProgress?: boolean): Observable<HttpResponse<any>>;
|
||||
public setStatusUnderApproval(projectId: string, fileId: string, observe?: 'events', reportProgress?: boolean): Observable<HttpEvent<any>>;
|
||||
public setStatusUnderApproval(projectId: string, fileId: string, observe: any = 'body', reportProgress: boolean = false): Observable<any> {
|
||||
|
||||
if (projectId === null || projectId === undefined) {
|
||||
throw new Error('Required parameter projectId was null or undefined when calling setStatusUnderApproval.');
|
||||
}
|
||||
|
||||
if (fileId === null || fileId === undefined) {
|
||||
throw new Error('Required parameter fileId was null or undefined when calling setStatusUnderApproval.');
|
||||
}
|
||||
|
||||
let headers = this.defaultHeaders;
|
||||
|
||||
// authentication (RED-OAUTH) required
|
||||
if (this.configuration.accessToken) {
|
||||
const accessToken = typeof this.configuration.accessToken === 'function'
|
||||
? this.configuration.accessToken()
|
||||
: this.configuration.accessToken;
|
||||
headers = headers.set('Authorization', 'Bearer ' + accessToken);
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
const httpHeaderAccepts: string[] = [];
|
||||
const httpHeaderAcceptSelected: string | undefined = this.configuration.selectHeaderAccept(httpHeaderAccepts);
|
||||
if (httpHeaderAcceptSelected !== undefined) {
|
||||
headers = headers.set('Accept', httpHeaderAcceptSelected);
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
const consumes: string[] = [];
|
||||
|
||||
return this.httpClient.request<any>('post', `${this.basePath}/status/underapproval/${encodeURIComponent(String(projectId))}/${encodeURIComponent(String(fileId))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers,
|
||||
observe: observe,
|
||||
reportProgress: reportProgress
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -3,16 +3,16 @@
|
||||
* Description for redaction
|
||||
*
|
||||
* OpenAPI spec version: 1.0
|
||||
*
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface Colors {
|
||||
defaultColor?: string;
|
||||
notRedacted?: string;
|
||||
requestAdd?: string;
|
||||
requestRemove?: string;
|
||||
}
|
||||
export interface Colors {
|
||||
defaultColor?: string;
|
||||
notRedacted?: string;
|
||||
requestAdd?: string;
|
||||
requestRemove?: string;
|
||||
}
|
||||
|
||||
@ -49,13 +49,23 @@ export interface FileStatus {
|
||||
}
|
||||
|
||||
export namespace FileStatus {
|
||||
export type StatusEnum = 'PROCESSING' | 'PROCESSED' | 'ERROR' | 'UNPROCESSED' | 'REPROCESS' | 'REVIEWED';
|
||||
export type StatusEnum =
|
||||
'UNPROCESSED'
|
||||
| 'REPROCESS'
|
||||
| 'PROCESSING'
|
||||
| 'ERROR'
|
||||
| 'UNASSIGNED'
|
||||
| 'UNDER_REVIEW'
|
||||
| 'UNDER_APPROVAL'
|
||||
| 'APPROVED';
|
||||
export const StatusEnum = {
|
||||
PROCESSING: 'PROCESSING' as StatusEnum,
|
||||
PROCESSED: 'PROCESSED' as StatusEnum,
|
||||
ERROR: 'ERROR' as StatusEnum,
|
||||
UNPROCESSED: 'UNPROCESSED' as StatusEnum,
|
||||
REPROCESS: 'REPROCESS' as StatusEnum,
|
||||
REVIEWED: 'REVIEWED' as StatusEnum
|
||||
PROCESSING: 'PROCESSING' as StatusEnum,
|
||||
ERROR: 'ERROR' as StatusEnum,
|
||||
UNASSIGNED: 'UNASSIGNED' as StatusEnum,
|
||||
UNDERREVIEW: 'UNDER_REVIEW' as StatusEnum,
|
||||
UNDERAPPROVAL: 'UNDER_APPROVAL' as StatusEnum,
|
||||
APPROVED: 'APPROVED' as StatusEnum
|
||||
};
|
||||
}
|
||||
|
||||
@ -18,6 +18,7 @@ export * from './modelFile';
|
||||
export * from './pdfMetaData';
|
||||
export * from './point';
|
||||
export * from './project';
|
||||
export * from './projectMembers';
|
||||
export * from './projectRequest';
|
||||
export * from './rectangle';
|
||||
export * from './redactionLog';
|
||||
@ -31,4 +32,3 @@ export * from './updateTypeValue';
|
||||
export * from './user';
|
||||
export * from './userRequest';
|
||||
export * from './userResponse';
|
||||
export * from './projectMembers';
|
||||
|
||||
@ -3,13 +3,13 @@
|
||||
* Description for redaction
|
||||
*
|
||||
* OpenAPI spec version: 1.0
|
||||
*
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface ProjectMembers {
|
||||
memberIds?: Array<string>;
|
||||
}
|
||||
export interface ProjectMembers {
|
||||
memberIds?: Array<string>;
|
||||
}
|
||||
|
||||
@ -3,14 +3,14 @@
|
||||
* Description for redaction
|
||||
*
|
||||
* OpenAPI spec version: 1.0
|
||||
*
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by the swagger code generator program.
|
||||
* https://github.com/swagger-api/swagger-codegen.git
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
export interface ProjectRequest {
|
||||
projectName?: string;
|
||||
description?: string;
|
||||
}
|
||||
export interface ProjectRequest {
|
||||
projectName?: string;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
@ -22,14 +22,25 @@ export interface ReportData {
|
||||
}
|
||||
|
||||
export namespace ReportData {
|
||||
export type StatusEnum = 'PROCESSING' | 'PROCESSED' | 'ERROR' | 'UNPROCESSED' | 'REPROCESS' | 'REVIEWED' | 'DELETED';
|
||||
export type StatusEnum =
|
||||
'UNPROCESSED'
|
||||
| 'REPROCESS'
|
||||
| 'PROCESSING'
|
||||
| 'ERROR'
|
||||
| 'DELETED'
|
||||
| 'UNASSIGNED'
|
||||
| 'UNDER_REVIEW'
|
||||
| 'UNDER_APPROVAL'
|
||||
| 'APPROVED';
|
||||
export const StatusEnum = {
|
||||
PROCESSING: 'PROCESSING' as StatusEnum,
|
||||
PROCESSED: 'PROCESSED' as StatusEnum,
|
||||
ERROR: 'ERROR' as StatusEnum,
|
||||
UNPROCESSED: 'UNPROCESSED' as StatusEnum,
|
||||
REPROCESS: 'REPROCESS' as StatusEnum,
|
||||
REVIEWED: 'REVIEWED' as StatusEnum,
|
||||
DELETED: 'DELETED' as StatusEnum
|
||||
PROCESSING: 'PROCESSING' as StatusEnum,
|
||||
ERROR: 'ERROR' as StatusEnum,
|
||||
DELETED: 'DELETED' as StatusEnum,
|
||||
UNASSIGNED: 'UNASSIGNED' as StatusEnum,
|
||||
UNDERREVIEW: 'UNDER_REVIEW' as StatusEnum,
|
||||
UNDERAPPROVAL: 'UNDER_APPROVAL' as StatusEnum,
|
||||
APPROVED: 'APPROVED' as StatusEnum
|
||||
};
|
||||
}
|
||||
|
||||
@ -44,6 +44,7 @@
|
||||
"@nrwl/angular": "^10.2.0",
|
||||
"@pdftron/webviewer": "^7.0.1",
|
||||
"file-saver": "^2.0.2",
|
||||
"jwt-decode": "^3.0.0",
|
||||
"keycloak-angular": "^8.0.1",
|
||||
"keycloak-js": "10.0.2",
|
||||
"ng2-file-upload": "^1.4.0",
|
||||
|
||||
@ -6928,6 +6928,11 @@ jsprim@^1.2.2:
|
||||
json-schema "0.2.3"
|
||||
verror "1.10.0"
|
||||
|
||||
jwt-decode@^3.0.0:
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/jwt-decode/-/jwt-decode-3.0.0.tgz#d9a17ddf6d37c03bf037b0b27cf8756cfd01c5c7"
|
||||
integrity sha512-RBQv2MTm3FNKQkdzhEyQwh5MbdNgMa+FyIJIK5RMWEn6hRgRHr7j55cRxGhRe6vGJDElyi6f6u/yfkP7AoXddA==
|
||||
|
||||
karma-source-map-support@1.4.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/karma-source-map-support/-/karma-source-map-support-1.4.0.tgz#58526ceccf7e8730e56effd97a4de8d712ac0d6b"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user