mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
Optimise imports using inject function (#8557)
* optimise AuthGuard * optimise UploadBase * optimise BaseAuthenticationService * optimise FormComponent * optimise BaseCloudService * optimise card view
This commit is contained in:
parent
991f11178d
commit
f5abce8baa
@ -15,9 +15,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, NgZone } from '@angular/core';
|
import { Component } from '@angular/core';
|
||||||
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
|
import { ComponentFixture, TestBed, fakeAsync, tick } from '@angular/core/testing';
|
||||||
import { TranslationService, setupTestBed } from '@alfresco/adf-core';
|
import { setupTestBed } from '@alfresco/adf-core';
|
||||||
import { UploadBase } from './upload-base';
|
import { UploadBase } from './upload-base';
|
||||||
import { UploadFilesEvent } from '../upload-files.event';
|
import { UploadFilesEvent } from '../upload-files.event';
|
||||||
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
import { ContentTestingModule } from '../../../testing/content.testing.module';
|
||||||
@ -32,12 +32,6 @@ import { FileUploadErrorEvent } from '../../../common/events/file.event';
|
|||||||
template: 'test component'
|
template: 'test component'
|
||||||
})
|
})
|
||||||
export class UploadTestComponent extends UploadBase {
|
export class UploadTestComponent extends UploadBase {
|
||||||
|
|
||||||
constructor(protected uploadService: UploadService,
|
|
||||||
protected translationService: TranslationService,
|
|
||||||
protected ngZone: NgZone) {
|
|
||||||
super(uploadService, translationService, ngZone);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const file = { name: 'bigFile.png', size: 1000 } as File;
|
const file = { name: 'bigFile.png', size: 1000 } as File;
|
||||||
|
@ -19,7 +19,7 @@ import { FileInfo, TranslationService } from '@alfresco/adf-core';
|
|||||||
import { FileUploadErrorEvent } from '../../../common/events/file.event';
|
import { FileUploadErrorEvent } from '../../../common/events/file.event';
|
||||||
import { FileModel } from '../../../common/models/file.model';
|
import { FileModel } from '../../../common/models/file.model';
|
||||||
import { UploadService } from '../../../common/services/upload.service';
|
import { UploadService } from '../../../common/services/upload.service';
|
||||||
import { EventEmitter, Input, Output, OnInit, OnDestroy, NgZone, Directive } from '@angular/core';
|
import { EventEmitter, Input, Output, OnInit, OnDestroy, NgZone, Directive, inject } from '@angular/core';
|
||||||
import { Subject } from 'rxjs';
|
import { Subject } from 'rxjs';
|
||||||
import { UploadFilesEvent } from '../upload-files.event';
|
import { UploadFilesEvent } from '../upload-files.event';
|
||||||
import { takeUntil } from 'rxjs/operators';
|
import { takeUntil } from 'rxjs/operators';
|
||||||
@ -27,6 +27,9 @@ import { takeUntil } from 'rxjs/operators';
|
|||||||
@Directive()
|
@Directive()
|
||||||
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
||||||
export abstract class UploadBase implements OnInit, OnDestroy {
|
export abstract class UploadBase implements OnInit, OnDestroy {
|
||||||
|
protected uploadService = inject(UploadService);
|
||||||
|
protected translationService = inject(TranslationService);
|
||||||
|
protected ngZone = inject(NgZone);
|
||||||
|
|
||||||
/** Sets a limit on the maximum size (in bytes) of a file to be uploaded.
|
/** Sets a limit on the maximum size (in bytes) of a file to be uploaded.
|
||||||
* Has no effect if undefined.
|
* Has no effect if undefined.
|
||||||
@ -82,11 +85,6 @@ export abstract class UploadBase implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
protected onDestroy$ = new Subject<boolean>();
|
protected onDestroy$ = new Subject<boolean>();
|
||||||
|
|
||||||
constructor(protected uploadService: UploadService,
|
|
||||||
protected translationService: TranslationService,
|
|
||||||
protected ngZone: NgZone) {
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.uploadService.fileUploadError
|
this.uploadService.fileUploadError
|
||||||
.pipe(takeUntil(this.onDestroy$))
|
.pipe(takeUntil(this.onDestroy$))
|
||||||
|
@ -15,15 +15,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import { EXTENDIBLE_COMPONENT, FileUtils, LogService } from '@alfresco/adf-core';
|
||||||
EXTENDIBLE_COMPONENT, FileUtils,
|
|
||||||
LogService, TranslationService
|
|
||||||
} from '@alfresco/adf-core';
|
|
||||||
import {
|
import {
|
||||||
Component, EventEmitter, forwardRef, Input,
|
Component, EventEmitter, forwardRef, Input,
|
||||||
OnChanges, OnInit, Output, SimpleChanges, ViewEncapsulation, NgZone
|
OnChanges, OnInit, Output, SimpleChanges, ViewEncapsulation, inject
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { UploadService } from '../../common/services/upload.service';
|
|
||||||
import { NodesApiService } from '../../common/services/nodes-api.service';
|
import { NodesApiService } from '../../common/services/nodes-api.service';
|
||||||
import { ContentService } from '../../common/services/content.service';
|
import { ContentService } from '../../common/services/content.service';
|
||||||
import { AllowableOperationsEnum } from '../../common/models/allowable-operations.enum';
|
import { AllowableOperationsEnum } from '../../common/models/allowable-operations.enum';
|
||||||
@ -43,6 +39,9 @@ import { NodeAllowableOperationSubject } from '../../interfaces/node-allowable-o
|
|||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class UploadButtonComponent extends UploadBase implements OnInit, OnChanges, NodeAllowableOperationSubject {
|
export class UploadButtonComponent extends UploadBase implements OnInit, OnChanges, NodeAllowableOperationSubject {
|
||||||
|
private contentService = inject(ContentService);
|
||||||
|
private nodesApiService = inject(NodesApiService);
|
||||||
|
protected logService = inject(LogService);
|
||||||
|
|
||||||
/** Allows/disallows upload folders (only for Chrome). */
|
/** Allows/disallows upload folders (only for Chrome). */
|
||||||
@Input()
|
@Input()
|
||||||
@ -66,20 +65,10 @@ export class UploadButtonComponent extends UploadBase implements OnInit, OnChang
|
|||||||
|
|
||||||
/** Emitted when create permission is missing. */
|
/** Emitted when create permission is missing. */
|
||||||
@Output()
|
@Output()
|
||||||
permissionEvent: EventEmitter<PermissionModel> = new EventEmitter<PermissionModel>();
|
permissionEvent = new EventEmitter<PermissionModel>();
|
||||||
|
|
||||||
private hasAllowableOperations: boolean = false;
|
private hasAllowableOperations: boolean = false;
|
||||||
|
protected permissionValue = new Subject<boolean>();
|
||||||
protected permissionValue: Subject<boolean> = new Subject<boolean>();
|
|
||||||
|
|
||||||
constructor(protected uploadService: UploadService,
|
|
||||||
private contentService: ContentService,
|
|
||||||
private nodesApiService: NodesApiService,
|
|
||||||
protected translationService: TranslationService,
|
|
||||||
protected logService: LogService,
|
|
||||||
protected ngZone: NgZone) {
|
|
||||||
super(uploadService, translationService, ngZone);
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.permissionValue.subscribe((permission: boolean) => {
|
this.permissionValue.subscribe((permission: boolean) => {
|
||||||
|
@ -15,15 +15,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {
|
import { EXTENDIBLE_COMPONENT, FileInfo, FileUtils, NotificationService } from '@alfresco/adf-core';
|
||||||
EXTENDIBLE_COMPONENT, FileInfo, FileUtils,
|
import { Component, forwardRef, ViewEncapsulation, inject } from '@angular/core';
|
||||||
NotificationService, TranslationService
|
|
||||||
} from '@alfresco/adf-core';
|
|
||||||
import { Component, forwardRef, ViewEncapsulation, NgZone } from '@angular/core';
|
|
||||||
import { NodeAllowableOperationSubject } from '../../interfaces/node-allowable-operation-subject.interface';
|
import { NodeAllowableOperationSubject } from '../../interfaces/node-allowable-operation-subject.interface';
|
||||||
import { UploadBase } from './base-upload/upload-base';
|
import { UploadBase } from './base-upload/upload-base';
|
||||||
import { AllowableOperationsEnum } from '../../common/models/allowable-operations.enum';
|
import { AllowableOperationsEnum } from '../../common/models/allowable-operations.enum';
|
||||||
import { UploadService } from '../../common/services/upload.service';
|
|
||||||
import { ContentService } from '../../common/services/content.service';
|
import { ContentService } from '../../common/services/content.service';
|
||||||
import { FileModel } from '../../common/models/file.model';
|
import { FileModel } from '../../common/models/file.model';
|
||||||
|
|
||||||
@ -38,14 +34,8 @@ import { FileModel } from '../../common/models/file.model';
|
|||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class UploadDragAreaComponent extends UploadBase implements NodeAllowableOperationSubject {
|
export class UploadDragAreaComponent extends UploadBase implements NodeAllowableOperationSubject {
|
||||||
|
private notificationService = inject(NotificationService);
|
||||||
constructor(protected uploadService: UploadService,
|
private contentService = inject(ContentService);
|
||||||
protected translationService: TranslationService,
|
|
||||||
private notificationService: NotificationService,
|
|
||||||
private contentService: ContentService,
|
|
||||||
protected ngZone: NgZone) {
|
|
||||||
super(uploadService, translationService, ngZone);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Method called when files are dropped in the drag area.
|
* Method called when files are dropped in the drag area.
|
||||||
|
@ -24,16 +24,19 @@ import {
|
|||||||
UrlTree
|
UrlTree
|
||||||
} from '@angular/router';
|
} from '@angular/router';
|
||||||
import { AuthenticationService } from '../services/authentication.service';
|
import { AuthenticationService } from '../services/authentication.service';
|
||||||
import {
|
import { AppConfigService, AppConfigValues } from '../../app-config/app-config.service';
|
||||||
AppConfigService,
|
|
||||||
AppConfigValues
|
|
||||||
} from '../../app-config/app-config.service';
|
|
||||||
import { OauthConfigModel } from '../models/oauth-config.model';
|
import { OauthConfigModel } from '../models/oauth-config.model';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { StorageService } from '../../common/services/storage.service';
|
import { StorageService } from '../../common/services/storage.service';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
import { inject } from '@angular/core';
|
||||||
|
|
||||||
export abstract class AuthGuardBase implements CanActivate, CanActivateChild {
|
export abstract class AuthGuardBase implements CanActivate, CanActivateChild {
|
||||||
|
protected authenticationService = inject(AuthenticationService);
|
||||||
|
protected router = inject(Router);
|
||||||
|
protected appConfigService = inject(AppConfigService);
|
||||||
|
protected dialog = inject(MatDialog);
|
||||||
|
private storageService = inject(StorageService);
|
||||||
|
|
||||||
protected get withCredentials(): boolean {
|
protected get withCredentials(): boolean {
|
||||||
return this.appConfigService.get<boolean>(
|
return this.appConfigService.get<boolean>(
|
||||||
@ -42,15 +45,6 @@ export abstract class AuthGuardBase implements CanActivate, CanActivateChild {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(
|
|
||||||
protected authenticationService: AuthenticationService,
|
|
||||||
protected router: Router,
|
|
||||||
protected appConfigService: AppConfigService,
|
|
||||||
protected dialog: MatDialog,
|
|
||||||
private storageService: StorageService
|
|
||||||
) {
|
|
||||||
}
|
|
||||||
|
|
||||||
abstract checkLogin(
|
abstract checkLogin(
|
||||||
activeRoute: ActivatedRouteSnapshot,
|
activeRoute: ActivatedRouteSnapshot,
|
||||||
redirectUrl: string
|
redirectUrl: string
|
||||||
|
@ -16,26 +16,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { ActivatedRouteSnapshot, Router, UrlTree } from '@angular/router';
|
import { ActivatedRouteSnapshot, UrlTree } from '@angular/router';
|
||||||
import { AppConfigService } from '../../app-config/app-config.service';
|
|
||||||
import { AuthenticationService } from '../services/authentication.service';
|
|
||||||
import { AuthGuardBase } from './auth-guard-base';
|
import { AuthGuardBase } from './auth-guard-base';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
|
||||||
import { StorageService } from '../../common/services/storage.service';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class AuthGuardBpm extends AuthGuardBase {
|
export class AuthGuardBpm extends AuthGuardBase {
|
||||||
|
|
||||||
constructor(authenticationService: AuthenticationService,
|
|
||||||
router: Router,
|
|
||||||
appConfigService: AppConfigService,
|
|
||||||
dialog: MatDialog,
|
|
||||||
storageService: StorageService) {
|
|
||||||
super(authenticationService, router, appConfigService, dialog, storageService);
|
|
||||||
}
|
|
||||||
|
|
||||||
async checkLogin(_: ActivatedRouteSnapshot, redirectUrl: string): Promise<boolean | UrlTree> {
|
async checkLogin(_: ActivatedRouteSnapshot, redirectUrl: string): Promise<boolean | UrlTree> {
|
||||||
if (this.authenticationService.isBpmLoggedIn() || this.withCredentials) {
|
if (this.authenticationService.isBpmLoggedIn() || this.withCredentials) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -16,28 +16,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import { ActivatedRouteSnapshot, UrlTree } from '@angular/router';
|
||||||
ActivatedRouteSnapshot, Router, UrlTree
|
|
||||||
} from '@angular/router';
|
|
||||||
import { AuthenticationService } from '../services/authentication.service';
|
|
||||||
import { AppConfigService } from '../../app-config/app-config.service';
|
|
||||||
import { AuthGuardBase } from './auth-guard-base';
|
import { AuthGuardBase } from './auth-guard-base';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
|
||||||
import { StorageService } from '../../common/services/storage.service';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class AuthGuardEcm extends AuthGuardBase {
|
export class AuthGuardEcm extends AuthGuardBase {
|
||||||
|
|
||||||
constructor(authenticationService: AuthenticationService,
|
|
||||||
router: Router,
|
|
||||||
appConfigService: AppConfigService,
|
|
||||||
dialog: MatDialog,
|
|
||||||
storageService: StorageService) {
|
|
||||||
super(authenticationService, router, appConfigService, dialog, storageService);
|
|
||||||
}
|
|
||||||
|
|
||||||
async checkLogin(_: ActivatedRouteSnapshot, redirectUrl: string): Promise<boolean | UrlTree> {
|
async checkLogin(_: ActivatedRouteSnapshot, redirectUrl: string): Promise<boolean | UrlTree> {
|
||||||
if (this.authenticationService.isEcmLoggedIn() || this.withCredentials) {
|
if (this.authenticationService.isEcmLoggedIn() || this.withCredentials) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -16,13 +16,9 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { ActivatedRouteSnapshot, Router, UrlTree } from '@angular/router';
|
import { ActivatedRouteSnapshot, UrlTree } from '@angular/router';
|
||||||
import { AuthenticationService } from '../services/authentication.service';
|
|
||||||
import { AppConfigService } from '../../app-config/app-config.service';
|
|
||||||
import { AuthGuardBase } from './auth-guard-base';
|
import { AuthGuardBase } from './auth-guard-base';
|
||||||
import { JwtHelperService } from '../services/jwt-helper.service';
|
import { JwtHelperService } from '../services/jwt-helper.service';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
|
||||||
import { StorageService } from '../../common/services/storage.service';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
@ -31,13 +27,8 @@ export class AuthGuard extends AuthGuardBase {
|
|||||||
|
|
||||||
ticketChangeBind: any;
|
ticketChangeBind: any;
|
||||||
|
|
||||||
constructor(private jwtHelperService: JwtHelperService,
|
constructor(private jwtHelperService: JwtHelperService) {
|
||||||
authenticationService: AuthenticationService,
|
super();
|
||||||
router: Router,
|
|
||||||
appConfigService: AppConfigService,
|
|
||||||
dialog: MatDialog,
|
|
||||||
storageService: StorageService) {
|
|
||||||
super(authenticationService, router, appConfigService, dialog, storageService);
|
|
||||||
this.ticketChangeBind = this.ticketChange.bind(this);
|
this.ticketChangeBind = this.ticketChange.bind(this);
|
||||||
|
|
||||||
window.addEventListener('storage', this.ticketChangeBind);
|
window.addEventListener('storage', this.ticketChangeBind);
|
||||||
|
@ -18,26 +18,11 @@
|
|||||||
import { Observable, of, throwError } from 'rxjs';
|
import { Observable, of, throwError } from 'rxjs';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AuthenticationService } from '../services/authentication.service';
|
import { AuthenticationService } from '../services/authentication.service';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
|
||||||
import { CookieService } from '../../common/services/cookie.service';
|
|
||||||
import { LogService } from '../../common/services/log.service';
|
|
||||||
import { StorageService } from '../../common/services/storage.service';
|
|
||||||
import { AppConfigService } from '../../app-config/app-config.service';
|
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class AuthenticationMock extends AuthenticationService {
|
export class AuthenticationMock extends AuthenticationService {
|
||||||
constructor(
|
|
||||||
appConfig: AppConfigService,
|
|
||||||
storageService: StorageService,
|
|
||||||
alfrescoApi: AlfrescoApiService,
|
|
||||||
cookie: CookieService,
|
|
||||||
logService: LogService
|
|
||||||
) {
|
|
||||||
super(alfrescoApi, appConfig, cookie, logService, storageService);
|
|
||||||
}
|
|
||||||
|
|
||||||
login(username: string, password: string): Observable<{ type: string; ticket: any }> {
|
login(username: string, password: string): Observable<{ type: string; ticket: any }> {
|
||||||
if (username === 'fake-username' && password === 'fake-password') {
|
if (username === 'fake-username' && password === 'fake-password') {
|
||||||
return of({ type: 'type', ticket: 'ticket' });
|
return of({ type: 'type', ticket: 'ticket' });
|
||||||
|
@ -15,16 +15,13 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { OAuthService, OAuthStorage } from 'angular-oauth2-oidc';
|
import { OAuthService, OAuthStorage } from 'angular-oauth2-oidc';
|
||||||
import { EMPTY, Observable } from 'rxjs';
|
import { EMPTY, Observable } from 'rxjs';
|
||||||
import { catchError, map } from 'rxjs/operators';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
import { AppConfigService, AppConfigValues } from '../../app-config/app-config.service';
|
import { AppConfigValues } from '../../app-config/app-config.service';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
|
||||||
import { BaseAuthenticationService } from '../../services/base-authentication.service';
|
import { BaseAuthenticationService } from '../../services/base-authentication.service';
|
||||||
import { CookieService } from '../../common/services/cookie.service';
|
|
||||||
import { JwtHelperService } from '../services/jwt-helper.service';
|
import { JwtHelperService } from '../services/jwt-helper.service';
|
||||||
import { LogService } from '../../common/services/log.service';
|
|
||||||
import { AuthConfigService } from '../oidc/auth-config.service';
|
import { AuthConfigService } from '../oidc/auth-config.service';
|
||||||
import { AuthService } from './auth.service';
|
import { AuthService } from './auth.service';
|
||||||
|
|
||||||
@ -32,19 +29,15 @@ import { AuthService } from './auth.service';
|
|||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class OIDCAuthenticationService extends BaseAuthenticationService {
|
export class OIDCAuthenticationService extends BaseAuthenticationService {
|
||||||
|
private authStorage = inject(OAuthStorage);
|
||||||
|
private oauthService = inject(OAuthService);
|
||||||
|
private readonly authConfig = inject(AuthConfigService);
|
||||||
|
private readonly auth = inject(AuthService);
|
||||||
|
|
||||||
readonly supportCodeFlow = true;
|
readonly supportCodeFlow = true;
|
||||||
|
|
||||||
constructor(
|
constructor() {
|
||||||
alfrescoApi: AlfrescoApiService,
|
super();
|
||||||
appConfig: AppConfigService,
|
|
||||||
cookie: CookieService,
|
|
||||||
logService: LogService,
|
|
||||||
private authStorage: OAuthStorage,
|
|
||||||
private oauthService: OAuthService,
|
|
||||||
private readonly authConfig: AuthConfigService,
|
|
||||||
private readonly auth: AuthService
|
|
||||||
) {
|
|
||||||
super(alfrescoApi, appConfig, cookie, logService);
|
|
||||||
this.alfrescoApi.alfrescoApiInitialized.subscribe(() => {
|
this.alfrescoApi.alfrescoApiInitialized.subscribe(() => {
|
||||||
this.alfrescoApi.getInstance().reply('logged-in', () => {
|
this.alfrescoApi.getInstance().reply('logged-in', () => {
|
||||||
this.onLogin.next();
|
this.onLogin.next();
|
||||||
|
@ -15,12 +15,9 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { Observable, from } from 'rxjs';
|
import { Observable, from } from 'rxjs';
|
||||||
import { AlfrescoApiService } from '../../services/alfresco-api.service';
|
import { AppConfigValues } from '../../app-config/app-config.service';
|
||||||
import { CookieService } from '../../common/services/cookie.service';
|
|
||||||
import { LogService } from '../../common/services/log.service';
|
|
||||||
import { AppConfigService, AppConfigValues } from '../../app-config/app-config.service';
|
|
||||||
import { map, catchError, tap } from 'rxjs/operators';
|
import { map, catchError, tap } from 'rxjs/operators';
|
||||||
import { JwtHelperService } from './jwt-helper.service';
|
import { JwtHelperService } from './jwt-helper.service';
|
||||||
import { StorageService } from '../../common/services/storage.service';
|
import { StorageService } from '../../common/services/storage.service';
|
||||||
@ -30,16 +27,11 @@ import { BaseAuthenticationService } from '../../services/base-authentication.se
|
|||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class AuthenticationService extends BaseAuthenticationService {
|
export class AuthenticationService extends BaseAuthenticationService {
|
||||||
|
private storageService = inject(StorageService);
|
||||||
readonly supportCodeFlow = false;
|
readonly supportCodeFlow = false;
|
||||||
|
|
||||||
constructor(
|
constructor() {
|
||||||
alfrescoApi: AlfrescoApiService,
|
super();
|
||||||
appConfig: AppConfigService,
|
|
||||||
cookie: CookieService,
|
|
||||||
logService: LogService,
|
|
||||||
private storageService: StorageService
|
|
||||||
) {
|
|
||||||
super(alfrescoApi, appConfig, cookie, logService);
|
|
||||||
this.alfrescoApi.alfrescoApiInitialized.subscribe(() => {
|
this.alfrescoApi.alfrescoApiInitialized.subscribe(() => {
|
||||||
this.alfrescoApi.getInstance().reply('logged-in', () => {
|
this.alfrescoApi.getInstance().reply('logged-in', () => {
|
||||||
this.onLogin.next();
|
this.onLogin.next();
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Input, OnDestroy, Directive } from '@angular/core';
|
import { Input, OnDestroy, Directive, inject } from '@angular/core';
|
||||||
import { CardViewUpdateService } from '../services/card-view-update.service';
|
import { CardViewUpdateService } from '../services/card-view-update.service';
|
||||||
import { CardViewItem } from '../interfaces/card-view.interfaces';
|
import { CardViewItem } from '../interfaces/card-view.interfaces';
|
||||||
import { CardViewBaseItemModel } from '../models/card-view-baseitem.model';
|
import { CardViewBaseItemModel } from '../models/card-view-baseitem.model';
|
||||||
@ -25,13 +25,14 @@ import { takeUntil } from 'rxjs/operators';
|
|||||||
@Directive()
|
@Directive()
|
||||||
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
// eslint-disable-next-line @angular-eslint/directive-class-suffix
|
||||||
export abstract class BaseCardView<T extends CardViewItem> implements OnDestroy {
|
export abstract class BaseCardView<T extends CardViewItem> implements OnDestroy {
|
||||||
|
protected cardViewUpdateService = inject(CardViewUpdateService);
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
property: T;
|
property: T;
|
||||||
|
|
||||||
protected destroy$ = new Subject<boolean>();
|
protected destroy$ = new Subject<boolean>();
|
||||||
|
|
||||||
constructor(protected cardViewUpdateService: CardViewUpdateService) {
|
constructor() {
|
||||||
this.cardViewUpdateService.updateItem$
|
this.cardViewUpdateService.updateItem$
|
||||||
.pipe(takeUntil(this.destroy$))
|
.pipe(takeUntil(this.destroy$))
|
||||||
.subscribe((itemModel: CardViewBaseItemModel) => {
|
.subscribe((itemModel: CardViewBaseItemModel) => {
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
import { Component, ViewEncapsulation } from '@angular/core';
|
import { Component, ViewEncapsulation } from '@angular/core';
|
||||||
import { CardViewArrayItemModel } from '../../models/card-view-arrayitem.model';
|
import { CardViewArrayItemModel } from '../../models/card-view-arrayitem.model';
|
||||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
|
||||||
import { BaseCardView } from '../base-card-view';
|
import { BaseCardView } from '../base-card-view';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -27,11 +26,6 @@ import { BaseCardView } from '../base-card-view';
|
|||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class CardViewArrayItemComponent extends BaseCardView<CardViewArrayItemModel> {
|
export class CardViewArrayItemComponent extends BaseCardView<CardViewArrayItemModel> {
|
||||||
|
|
||||||
constructor(cardViewUpdateService: CardViewUpdateService) {
|
|
||||||
super(cardViewUpdateService);
|
|
||||||
}
|
|
||||||
|
|
||||||
clicked(): void {
|
clicked(): void {
|
||||||
if (this.isClickable()) {
|
if (this.isClickable()) {
|
||||||
this.cardViewUpdateService.clicked(this.property);
|
this.cardViewUpdateService.clicked(this.property);
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||||
import { CardViewBoolItemModel } from '../../models/card-view-boolitem.model';
|
import { CardViewBoolItemModel } from '../../models/card-view-boolitem.model';
|
||||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
|
||||||
import { BaseCardView } from '../base-card-view';
|
import { BaseCardView } from '../base-card-view';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -27,14 +26,9 @@ import { BaseCardView } from '../base-card-view';
|
|||||||
})
|
})
|
||||||
|
|
||||||
export class CardViewBoolItemComponent extends BaseCardView<CardViewBoolItemModel> {
|
export class CardViewBoolItemComponent extends BaseCardView<CardViewBoolItemModel> {
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
editable: boolean;
|
editable: boolean;
|
||||||
|
|
||||||
constructor(cardViewUpdateService: CardViewUpdateService) {
|
|
||||||
super(cardViewUpdateService);
|
|
||||||
}
|
|
||||||
|
|
||||||
isEditable() {
|
isEditable() {
|
||||||
return this.editable && this.property.editable;
|
return this.editable && this.property.editable;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@ import { DatetimeAdapter, MAT_DATETIME_FORMATS, MatDatetimepickerComponent } fro
|
|||||||
import { MAT_MOMENT_DATETIME_FORMATS, MomentDatetimeAdapter } from '@mat-datetimepicker/moment';
|
import { MAT_MOMENT_DATETIME_FORMATS, MomentDatetimeAdapter } from '@mat-datetimepicker/moment';
|
||||||
import moment, { Moment } from 'moment';
|
import moment, { Moment } from 'moment';
|
||||||
import { CardViewDateItemModel } from '../../models/card-view-dateitem.model';
|
import { CardViewDateItemModel } from '../../models/card-view-dateitem.model';
|
||||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
|
||||||
import { UserPreferencesService, UserPreferenceValues } from '../../../common/services/user-preferences.service';
|
import { UserPreferencesService, UserPreferenceValues } from '../../../common/services/user-preferences.service';
|
||||||
import { MomentDateAdapter } from '../../../common/utils/moment-date-adapter';
|
import { MomentDateAdapter } from '../../../common/utils/moment-date-adapter';
|
||||||
import { MOMENT_DATE_FORMATS } from '../../../common/utils/moment-date-formats.model';
|
import { MOMENT_DATE_FORMATS } from '../../../common/utils/moment-date-formats.model';
|
||||||
@ -66,13 +65,12 @@ export class CardViewDateItemComponent extends BaseCardView<CardViewDateItemMode
|
|||||||
|
|
||||||
private onDestroy$ = new Subject<boolean>();
|
private onDestroy$ = new Subject<boolean>();
|
||||||
|
|
||||||
constructor(cardViewUpdateService: CardViewUpdateService,
|
constructor(private dateAdapter: DateAdapter<Moment>,
|
||||||
private dateAdapter: DateAdapter<Moment>,
|
|
||||||
private userPreferencesService: UserPreferencesService,
|
private userPreferencesService: UserPreferencesService,
|
||||||
private appConfig: AppConfigService,
|
private appConfig: AppConfigService,
|
||||||
private clipboardService: ClipboardService,
|
private clipboardService: ClipboardService,
|
||||||
private translateService: TranslationService) {
|
private translateService: TranslationService) {
|
||||||
super(cardViewUpdateService);
|
super();
|
||||||
this.dateFormat = this.appConfig.get('dateValues.defaultDateFormat');
|
this.dateFormat = this.appConfig.get('dateValues.defaultDateFormat');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, Input, OnChanges, ViewEncapsulation } from '@angular/core';
|
import { Component, Input, OnChanges, ViewEncapsulation } from '@angular/core';
|
||||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
|
||||||
import { CardViewKeyValuePairsItemModel } from '../../models/card-view.models';
|
import { CardViewKeyValuePairsItemModel } from '../../models/card-view.models';
|
||||||
import { CardViewKeyValuePairsItemType } from '../../interfaces/card-view.interfaces';
|
import { CardViewKeyValuePairsItemType } from '../../interfaces/card-view.interfaces';
|
||||||
import { MatTableDataSource } from '@angular/material/table';
|
import { MatTableDataSource } from '@angular/material/table';
|
||||||
@ -37,10 +36,6 @@ export class CardViewKeyValuePairsItemComponent extends BaseCardView<CardViewKey
|
|||||||
values: CardViewKeyValuePairsItemType[];
|
values: CardViewKeyValuePairsItemType[];
|
||||||
matTableValues: MatTableDataSource<CardViewKeyValuePairsItemType>;
|
matTableValues: MatTableDataSource<CardViewKeyValuePairsItemType>;
|
||||||
|
|
||||||
constructor(cardViewUpdateService: CardViewUpdateService) {
|
|
||||||
super(cardViewUpdateService);
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnChanges() {
|
ngOnChanges() {
|
||||||
this.values = this.property.value || [];
|
this.values = this.property.value || [];
|
||||||
this.matTableValues = new MatTableDataSource(this.values);
|
this.matTableValues = new MatTableDataSource(this.values);
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
import { Component, Input } from '@angular/core';
|
import { Component, Input } from '@angular/core';
|
||||||
import { CardViewMapItemModel } from '../../models/card-view-mapitem.model';
|
import { CardViewMapItemModel } from '../../models/card-view-mapitem.model';
|
||||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
|
||||||
import { BaseCardView } from '../base-card-view';
|
import { BaseCardView } from '../base-card-view';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -33,10 +32,6 @@ export class CardViewMapItemComponent extends BaseCardView<CardViewMapItemModel>
|
|||||||
@Input()
|
@Input()
|
||||||
displayEmpty: boolean = true;
|
displayEmpty: boolean = true;
|
||||||
|
|
||||||
constructor(cardViewUpdateService: CardViewUpdateService) {
|
|
||||||
super(cardViewUpdateService);
|
|
||||||
}
|
|
||||||
|
|
||||||
showProperty() {
|
showProperty() {
|
||||||
return this.displayEmpty || !this.property.isEmpty();
|
return this.displayEmpty || !this.property.isEmpty();
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, Input, OnChanges, OnDestroy, OnInit } from '@angular/core';
|
import { Component, Input, OnChanges, OnDestroy, OnInit, inject } from '@angular/core';
|
||||||
import { CardViewSelectItemModel } from '../../models/card-view-selectitem.model';
|
import { CardViewSelectItemModel } from '../../models/card-view-selectitem.model';
|
||||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
|
||||||
import { BehaviorSubject, combineLatest, Observable, Subject } from 'rxjs';
|
import { BehaviorSubject, combineLatest, Observable, Subject } from 'rxjs';
|
||||||
import { CardViewSelectItemOption } from '../../interfaces/card-view.interfaces';
|
import { CardViewSelectItemOption } from '../../interfaces/card-view.interfaces';
|
||||||
import { MatSelectChange } from '@angular/material/select';
|
import { MatSelectChange } from '@angular/material/select';
|
||||||
@ -31,6 +30,7 @@ import { takeUntil, map } from 'rxjs/operators';
|
|||||||
styleUrls: ['./card-view-selectitem.component.scss']
|
styleUrls: ['./card-view-selectitem.component.scss']
|
||||||
})
|
})
|
||||||
export class CardViewSelectItemComponent extends BaseCardView<CardViewSelectItemModel<string | number>> implements OnInit, OnChanges, OnDestroy {
|
export class CardViewSelectItemComponent extends BaseCardView<CardViewSelectItemModel<string | number>> implements OnInit, OnChanges, OnDestroy {
|
||||||
|
private appConfig = inject(AppConfigService);
|
||||||
static HIDE_FILTER_LIMIT = 5;
|
static HIDE_FILTER_LIMIT = 5;
|
||||||
|
|
||||||
@Input() editable: boolean = false;
|
@Input() editable: boolean = false;
|
||||||
@ -51,10 +51,6 @@ export class CardViewSelectItemComponent extends BaseCardView<CardViewSelectItem
|
|||||||
|
|
||||||
list$: Observable<CardViewSelectItemOption<string | number>[]> = null;
|
list$: Observable<CardViewSelectItemOption<string | number>[]> = null;
|
||||||
|
|
||||||
constructor(cardViewUpdateService: CardViewUpdateService, private appConfig: AppConfigService) {
|
|
||||||
super(cardViewUpdateService);
|
|
||||||
}
|
|
||||||
|
|
||||||
ngOnChanges(): void {
|
ngOnChanges(): void {
|
||||||
this.value = this.property.value;
|
this.value = this.property.value;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
import { ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
import { ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||||
import { CardViewTextItemModel } from '../../models/card-view-textitem.model';
|
import { CardViewTextItemModel } from '../../models/card-view-textitem.model';
|
||||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
|
||||||
import { BaseCardView } from '../base-card-view';
|
import { BaseCardView } from '../base-card-view';
|
||||||
import { MatChipInputEvent } from '@angular/material/chips';
|
import { MatChipInputEvent } from '@angular/material/chips';
|
||||||
import { ClipboardService } from '../../../clipboard/clipboard.service';
|
import { ClipboardService } from '../../../clipboard/clipboard.service';
|
||||||
@ -67,11 +66,10 @@ export class CardViewTextItemComponent extends BaseCardView<CardViewTextItemMode
|
|||||||
|
|
||||||
private onDestroy$ = new Subject<boolean>();
|
private onDestroy$ = new Subject<boolean>();
|
||||||
|
|
||||||
constructor(cardViewUpdateService: CardViewUpdateService,
|
constructor(private clipboardService: ClipboardService,
|
||||||
private clipboardService: ClipboardService,
|
|
||||||
private translateService: TranslationService,
|
private translateService: TranslationService,
|
||||||
private cd: ChangeDetectorRef) {
|
private cd: ChangeDetectorRef) {
|
||||||
super(cardViewUpdateService);
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
|
@ -23,36 +23,35 @@ import { AppConfigService, AppConfigValues } from '../app-config/app-config.serv
|
|||||||
import { AlfrescoApiService } from './alfresco-api.service';
|
import { AlfrescoApiService } from './alfresco-api.service';
|
||||||
import { CookieService } from '../common/services/cookie.service';
|
import { CookieService } from '../common/services/cookie.service';
|
||||||
import { LogService } from '../common/services/log.service';
|
import { LogService } from '../common/services/log.service';
|
||||||
|
import { inject } from '@angular/core';
|
||||||
|
|
||||||
const REMEMBER_ME_COOKIE_KEY = 'ALFRESCO_REMEMBER_ME';
|
const REMEMBER_ME_COOKIE_KEY = 'ALFRESCO_REMEMBER_ME';
|
||||||
const REMEMBER_ME_UNTIL = 1000 * 60 * 60 * 24 * 30;
|
const REMEMBER_ME_UNTIL = 1000 * 60 * 60 * 24 * 30;
|
||||||
|
|
||||||
export abstract class BaseAuthenticationService {
|
export abstract class BaseAuthenticationService {
|
||||||
|
protected alfrescoApi = inject(AlfrescoApiService);
|
||||||
|
protected appConfig = inject(AppConfigService);
|
||||||
|
protected cookie = inject(CookieService);
|
||||||
|
private logService = inject(LogService);
|
||||||
|
|
||||||
protected bearerExcludedUrls: readonly string[] = ['resources/', 'assets/', 'auth/realms', 'idp/'];
|
protected bearerExcludedUrls: readonly string[] = ['resources/', 'assets/', 'auth/realms', 'idp/'];
|
||||||
protected redirectUrl: RedirectionModel = null;
|
protected redirectUrl: RedirectionModel = null;
|
||||||
|
|
||||||
onLogin = new ReplaySubject<any>(1);
|
onLogin = new ReplaySubject<any>(1);
|
||||||
onLogout = new ReplaySubject<any>(1);
|
onLogout = new ReplaySubject<any>(1);
|
||||||
|
|
||||||
_peopleApi: PeopleApi;
|
private _peopleApi: PeopleApi;
|
||||||
get peopleApi(): PeopleApi {
|
get peopleApi(): PeopleApi {
|
||||||
this._peopleApi = this._peopleApi ?? new PeopleApi(this.alfrescoApi.getInstance());
|
this._peopleApi = this._peopleApi ?? new PeopleApi(this.alfrescoApi.getInstance());
|
||||||
return this._peopleApi;
|
return this._peopleApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
_profileApi: UserProfileApi;
|
private _profileApi: UserProfileApi;
|
||||||
get profileApi(): UserProfileApi {
|
get profileApi(): UserProfileApi {
|
||||||
this._profileApi = this._profileApi ?? new UserProfileApi(this.alfrescoApi.getInstance());
|
this._profileApi = this._profileApi ?? new UserProfileApi(this.alfrescoApi.getInstance());
|
||||||
return this._profileApi;
|
return this._profileApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(
|
|
||||||
protected alfrescoApi: AlfrescoApiService,
|
|
||||||
protected appConfig: AppConfigService,
|
|
||||||
protected cookie: CookieService,
|
|
||||||
private logService: LogService
|
|
||||||
) {}
|
|
||||||
|
|
||||||
abstract readonly supportCodeFlow: boolean;
|
abstract readonly supportCodeFlow: boolean;
|
||||||
abstract getToken(): string;
|
abstract getToken(): string;
|
||||||
abstract isLoggedIn(): boolean;
|
abstract isLoggedIn(): boolean;
|
||||||
|
@ -16,13 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import { FormValues, FormModel, FormFieldOption } from '@alfresco/adf-core';
|
||||||
AlfrescoApiService,
|
|
||||||
FormValues,
|
|
||||||
AppConfigService,
|
|
||||||
FormModel,
|
|
||||||
FormFieldOption
|
|
||||||
} from '@alfresco/adf-core';
|
|
||||||
import { Observable, from, EMPTY } from 'rxjs';
|
import { Observable, from, EMPTY } from 'rxjs';
|
||||||
import { expand, map, reduce, switchMap } from 'rxjs/operators';
|
import { expand, map, reduce, switchMap } from 'rxjs/operators';
|
||||||
import { TaskDetailsCloudModel } from '../../task/start-task/models/task-details-cloud.model';
|
import { TaskDetailsCloudModel } from '../../task/start-task/models/task-details-cloud.model';
|
||||||
@ -43,11 +37,8 @@ export class FormCloudService extends BaseCloudService implements FormCloudServi
|
|||||||
return this._uploadApi;
|
return this._uploadApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(
|
constructor() {
|
||||||
apiService: AlfrescoApiService,
|
super();
|
||||||
appConfigService: AppConfigService
|
|
||||||
) {
|
|
||||||
super(apiService, appConfigService);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AlfrescoApiService, AppConfigService } from '@alfresco/adf-core';
|
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { from, Observable } from 'rxjs';
|
import { from, Observable } from 'rxjs';
|
||||||
import { BaseCloudService } from '../../services/base-cloud.service';
|
import { BaseCloudService } from '../../services/base-cloud.service';
|
||||||
@ -27,12 +26,6 @@ import { FormDefinitionSelectorCloudServiceInterface } from './form-definition-s
|
|||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class FormDefinitionSelectorCloudService extends BaseCloudService implements FormDefinitionSelectorCloudServiceInterface {
|
export class FormDefinitionSelectorCloudService extends BaseCloudService implements FormDefinitionSelectorCloudServiceInterface {
|
||||||
|
|
||||||
constructor(apiService: AlfrescoApiService,
|
|
||||||
appConfigService: AppConfigService) {
|
|
||||||
super(apiService, appConfigService);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all forms of an app.
|
* Get all forms of an app.
|
||||||
*
|
*
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
|
|
||||||
import { ProcessQueryCloudRequestModel } from '../models/process-cloud-query-request.model';
|
import { ProcessQueryCloudRequestModel } from '../models/process-cloud-query-request.model';
|
||||||
import { Observable, throwError } from 'rxjs';
|
import { Observable, throwError } from 'rxjs';
|
||||||
import { ProcessListCloudSortingModel } from '../models/process-list-sorting.model';
|
import { ProcessListCloudSortingModel } from '../models/process-list-sorting.model';
|
||||||
@ -25,13 +24,6 @@ import { map } from 'rxjs/operators';
|
|||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ProcessListCloudService extends BaseCloudService {
|
export class ProcessListCloudService extends BaseCloudService {
|
||||||
|
|
||||||
constructor(apiService: AlfrescoApiService,
|
|
||||||
appConfigService: AppConfigService,
|
|
||||||
private logService: LogService) {
|
|
||||||
super(apiService, appConfigService);
|
|
||||||
}
|
|
||||||
|
|
||||||
private getProcess(
|
private getProcess(
|
||||||
callback: (queryUrl: string, queryParams: any) => Observable<any>,
|
callback: (queryUrl: string, queryParams: any) => Observable<any>,
|
||||||
defaultQueryUrl: string,
|
defaultQueryUrl: string,
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
|
|
||||||
import { Observable, throwError } from 'rxjs';
|
import { Observable, throwError } from 'rxjs';
|
||||||
import { BaseCloudService } from '../../../services/base-cloud.service';
|
import { BaseCloudService } from '../../../services/base-cloud.service';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
@ -27,13 +26,6 @@ import { TaskListCloudSortingModel } from '../../../models/task-list-sorting.mod
|
|||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ProcessTaskListCloudService extends BaseCloudService implements TaskListCloudServiceInterface {
|
export class ProcessTaskListCloudService extends BaseCloudService implements TaskListCloudServiceInterface {
|
||||||
|
|
||||||
constructor(apiService: AlfrescoApiService,
|
|
||||||
appConfigService: AppConfigService,
|
|
||||||
protected logService: LogService) {
|
|
||||||
super(apiService, appConfigService);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds a task using an object with optional query properties.
|
* Finds a task using an object with optional query properties.
|
||||||
*
|
*
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { AlfrescoApiService, LogService, AppConfigService } from '@alfresco/adf-core';
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable, Subject, throwError } from 'rxjs';
|
import { Observable, Subject, throwError } from 'rxjs';
|
||||||
import { catchError, map } from 'rxjs/operators';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
@ -29,15 +28,8 @@ import { ProcessCloudInterface } from './process-cloud.interface';
|
|||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class ProcessCloudService extends BaseCloudService implements ProcessCloudInterface {
|
export class ProcessCloudService extends BaseCloudService implements ProcessCloudInterface {
|
||||||
|
|
||||||
dataChangesDetected = new Subject<ProcessInstanceCloud>();
|
dataChangesDetected = new Subject<ProcessInstanceCloud>();
|
||||||
|
|
||||||
constructor(apiService: AlfrescoApiService,
|
|
||||||
appConfigService: AppConfigService,
|
|
||||||
private logService: LogService) {
|
|
||||||
super(apiService, appConfigService);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets details of a process instance.
|
* Gets details of a process instance.
|
||||||
*
|
*
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable, throwError } from 'rxjs';
|
import { Observable, throwError } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
@ -29,13 +28,6 @@ import { TaskVariableCloud } from '../../../form/models/task-variable-cloud.mode
|
|||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class StartProcessCloudService extends BaseCloudService {
|
export class StartProcessCloudService extends BaseCloudService {
|
||||||
|
|
||||||
constructor(apiService: AlfrescoApiService,
|
|
||||||
private logService: LogService,
|
|
||||||
appConfigService: AppConfigService) {
|
|
||||||
super(apiService, appConfigService);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the process definitions associated with an app.
|
* Gets the process definitions associated with an app.
|
||||||
*
|
*
|
||||||
|
@ -15,7 +15,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { AlfrescoApiService, AppConfigService } from '@alfresco/adf-core';
|
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
|
||||||
|
import { Injectable, inject } from '@angular/core';
|
||||||
import { from, Observable } from 'rxjs';
|
import { from, Observable } from 'rxjs';
|
||||||
|
|
||||||
export interface CallApiParams {
|
export interface CallApiParams {
|
||||||
@ -33,7 +34,11 @@ export interface CallApiParams {
|
|||||||
responseType?: string;
|
responseType?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
export class BaseCloudService {
|
export class BaseCloudService {
|
||||||
|
protected apiService = inject(AlfrescoApiService);
|
||||||
|
protected appConfigService = inject(AppConfigService);
|
||||||
|
protected logService = inject(LogService);
|
||||||
|
|
||||||
protected defaultParams: CallApiParams = {
|
protected defaultParams: CallApiParams = {
|
||||||
path: '',
|
path: '',
|
||||||
@ -42,10 +47,6 @@ export class BaseCloudService {
|
|||||||
accepts: ['application/json']
|
accepts: ['application/json']
|
||||||
};
|
};
|
||||||
|
|
||||||
constructor(
|
|
||||||
protected apiService: AlfrescoApiService,
|
|
||||||
protected appConfigService: AppConfigService) {}
|
|
||||||
|
|
||||||
getBasePath(appName: string): string {
|
getBasePath(appName: string): string {
|
||||||
return appName
|
return appName
|
||||||
? `${this.contextRoot}/${appName}`
|
? `${this.contextRoot}/${appName}`
|
||||||
|
@ -22,21 +22,16 @@ import { WebSocketLink } from '@apollo/client/link/ws';
|
|||||||
import { onError } from '@apollo/client/link/error';
|
import { onError } from '@apollo/client/link/error';
|
||||||
import { getMainDefinition } from '@apollo/client/utilities';
|
import { getMainDefinition } from '@apollo/client/utilities';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AppConfigService, AlfrescoApiService } from '@alfresco/adf-core';
|
|
||||||
import { BaseCloudService } from './base-cloud.service';
|
import { BaseCloudService } from './base-cloud.service';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class NotificationCloudService extends BaseCloudService {
|
export class NotificationCloudService extends BaseCloudService {
|
||||||
|
|
||||||
appsListening = [];
|
appsListening = [];
|
||||||
|
|
||||||
constructor(apiService: AlfrescoApiService,
|
constructor(public apollo: Apollo, private http: HttpLink) {
|
||||||
appConfigService: AppConfigService,
|
super();
|
||||||
public apollo: Apollo,
|
|
||||||
private http: HttpLink) {
|
|
||||||
super(apiService, appConfigService);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private get webSocketHost() {
|
private get webSocketHost() {
|
||||||
|
@ -17,20 +17,11 @@
|
|||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { PreferenceCloudServiceInterface } from './preference-cloud.interface';
|
import { PreferenceCloudServiceInterface } from './preference-cloud.interface';
|
||||||
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
|
|
||||||
import { throwError, Observable } from 'rxjs';
|
import { throwError, Observable } from 'rxjs';
|
||||||
import { BaseCloudService } from './base-cloud.service';
|
import { BaseCloudService } from './base-cloud.service';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class UserPreferenceCloudService extends BaseCloudService implements PreferenceCloudServiceInterface {
|
export class UserPreferenceCloudService extends BaseCloudService implements PreferenceCloudServiceInterface {
|
||||||
|
|
||||||
constructor(
|
|
||||||
apiService: AlfrescoApiService,
|
|
||||||
appConfigService: AppConfigService,
|
|
||||||
private logService: LogService) {
|
|
||||||
super(apiService, appConfigService);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets user preferences
|
* Gets user preferences
|
||||||
*
|
*
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AlfrescoApiService, AppConfigService } from '@alfresco/adf-core';
|
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { StartTaskCloudRequestModel } from '../start-task/models/start-task-cloud-request.model';
|
import { StartTaskCloudRequestModel } from '../start-task/models/start-task-cloud-request.model';
|
||||||
@ -25,13 +24,6 @@ import { BaseCloudService } from '../../services/base-cloud.service';
|
|||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class StartTaskCloudService extends BaseCloudService {
|
export class StartTaskCloudService extends BaseCloudService {
|
||||||
|
|
||||||
constructor(
|
|
||||||
apiService: AlfrescoApiService,
|
|
||||||
appConfigService: AppConfigService) {
|
|
||||||
super(apiService, appConfigService);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @deprecated in 3.5.0, use TaskCloudService instead.
|
* @deprecated in 3.5.0, use TaskCloudService instead.
|
||||||
* Creates a new standalone task.
|
* Creates a new standalone task.
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AlfrescoApiService, LogService, AppConfigService, CardViewArrayItem, TranslationService } from '@alfresco/adf-core';
|
import { CardViewArrayItem, TranslationService } from '@alfresco/adf-core';
|
||||||
import { throwError, Observable, of, Subject } from 'rxjs';
|
import { throwError, Observable, of, Subject } from 'rxjs';
|
||||||
import { catchError, map } from 'rxjs/operators';
|
import { catchError, map } from 'rxjs/operators';
|
||||||
import {
|
import {
|
||||||
@ -30,10 +30,7 @@ import {
|
|||||||
import { BaseCloudService } from '../../services/base-cloud.service';
|
import { BaseCloudService } from '../../services/base-cloud.service';
|
||||||
import { StartTaskCloudRequestModel } from '../start-task/models/start-task-cloud-request.model';
|
import { StartTaskCloudRequestModel } from '../start-task/models/start-task-cloud-request.model';
|
||||||
import { ProcessDefinitionCloud } from '../../models/process-definition-cloud.model';
|
import { ProcessDefinitionCloud } from '../../models/process-definition-cloud.model';
|
||||||
import {
|
import { DEFAULT_TASK_PRIORITIES, TaskPriorityOption } from '../models/task.model';
|
||||||
DEFAULT_TASK_PRIORITIES,
|
|
||||||
TaskPriorityOption
|
|
||||||
} from '../models/task.model';
|
|
||||||
import { TaskCloudServiceInterface } from './task-cloud.service.interface';
|
import { TaskCloudServiceInterface } from './task-cloud.service.interface';
|
||||||
import { IdentityUserService } from '../../people/services/identity-user.service';
|
import { IdentityUserService } from '../../people/services/identity-user.service';
|
||||||
|
|
||||||
@ -45,13 +42,10 @@ export class TaskCloudService extends BaseCloudService implements TaskCloudServi
|
|||||||
dataChangesDetected$ = new Subject();
|
dataChangesDetected$ = new Subject();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
apiService: AlfrescoApiService,
|
|
||||||
appConfigService: AppConfigService,
|
|
||||||
private logService: LogService,
|
|
||||||
private translateService: TranslationService,
|
private translateService: TranslationService,
|
||||||
private identityUserService: IdentityUserService
|
private identityUserService: IdentityUserService
|
||||||
) {
|
) {
|
||||||
super(apiService, appConfigService);
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { AlfrescoApiService, AppConfigService } from '@alfresco/adf-core';
|
|
||||||
import { Injectable, Inject } from '@angular/core';
|
import { Injectable, Inject } from '@angular/core';
|
||||||
import { Observable, of, BehaviorSubject, throwError } from 'rxjs';
|
import { Observable, of, BehaviorSubject, throwError } from 'rxjs';
|
||||||
import { TaskFilterCloudModel } from '../models/filter-cloud.model';
|
import { TaskFilterCloudModel } from '../models/filter-cloud.model';
|
||||||
@ -55,10 +54,8 @@ export class TaskFilterCloudService extends BaseCloudService {
|
|||||||
private identityUserService: IdentityUserService,
|
private identityUserService: IdentityUserService,
|
||||||
@Inject(TASK_FILTERS_SERVICE_TOKEN)
|
@Inject(TASK_FILTERS_SERVICE_TOKEN)
|
||||||
public preferenceService: PreferenceCloudServiceInterface,
|
public preferenceService: PreferenceCloudServiceInterface,
|
||||||
apiService: AlfrescoApiService,
|
|
||||||
appConfigService: AppConfigService,
|
|
||||||
private notificationCloudService: NotificationCloudService) {
|
private notificationCloudService: NotificationCloudService) {
|
||||||
super(apiService, appConfigService);
|
super();
|
||||||
this.filtersSubject = new BehaviorSubject([]);
|
this.filtersSubject = new BehaviorSubject([]);
|
||||||
this.filters$ = this.filtersSubject.asObservable();
|
this.filters$ = this.filtersSubject.asObservable();
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
|
|
||||||
import { ServiceTaskQueryCloudRequestModel, ServiceTaskIntegrationContextCloudModel } from '../models/service-task-cloud.model';
|
import { ServiceTaskQueryCloudRequestModel, ServiceTaskIntegrationContextCloudModel } from '../models/service-task-cloud.model';
|
||||||
import { Observable, throwError } from 'rxjs';
|
import { Observable, throwError } from 'rxjs';
|
||||||
import { TaskListCloudSortingModel } from '../../../models/task-list-sorting.model';
|
import { TaskListCloudSortingModel } from '../../../models/task-list-sorting.model';
|
||||||
@ -25,13 +24,6 @@ import { map } from 'rxjs/operators';
|
|||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class ServiceTaskListCloudService extends BaseCloudService {
|
export class ServiceTaskListCloudService extends BaseCloudService {
|
||||||
|
|
||||||
constructor(apiService: AlfrescoApiService,
|
|
||||||
appConfigService: AppConfigService,
|
|
||||||
private logService: LogService) {
|
|
||||||
super(apiService, appConfigService);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds a task using an object with optional query properties.
|
* Finds a task using an object with optional query properties.
|
||||||
*
|
*
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { AlfrescoApiService, AppConfigService, LogService } from '@alfresco/adf-core';
|
|
||||||
import { TaskQueryCloudRequestModel } from '../../../models/filter-cloud-model';
|
import { TaskQueryCloudRequestModel } from '../../../models/filter-cloud-model';
|
||||||
import { Observable, throwError } from 'rxjs';
|
import { Observable, throwError } from 'rxjs';
|
||||||
import { TaskListCloudSortingModel } from '../../../models/task-list-sorting.model';
|
import { TaskListCloudSortingModel } from '../../../models/task-list-sorting.model';
|
||||||
@ -27,13 +26,6 @@ import { TaskListCloudServiceInterface } from '../../../services/task-list-cloud
|
|||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class TaskListCloudService extends BaseCloudService implements TaskListCloudServiceInterface {
|
export class TaskListCloudService extends BaseCloudService implements TaskListCloudServiceInterface {
|
||||||
|
|
||||||
constructor(apiService: AlfrescoApiService,
|
|
||||||
appConfigService: AppConfigService,
|
|
||||||
protected logService: LogService) {
|
|
||||||
super(apiService, appConfigService);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds a task using an object with optional query properties.
|
* Finds a task using an object with optional query properties.
|
||||||
*
|
*
|
||||||
|
@ -24,7 +24,8 @@ import {
|
|||||||
SimpleChanges,
|
SimpleChanges,
|
||||||
OnInit,
|
OnInit,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
OnChanges
|
OnChanges,
|
||||||
|
inject
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import {
|
import {
|
||||||
WidgetVisibilityService,
|
WidgetVisibilityService,
|
||||||
@ -57,6 +58,14 @@ import { FormDefinitionModel } from './model/form-definition.model';
|
|||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class FormComponent extends FormBaseComponent implements OnInit, OnDestroy, OnChanges {
|
export class FormComponent extends FormBaseComponent implements OnInit, OnDestroy, OnChanges {
|
||||||
|
protected formService = inject(FormService);
|
||||||
|
protected taskFormService = inject(TaskFormService);
|
||||||
|
protected taskService = inject(TaskService);
|
||||||
|
protected editorService = inject(EditorService);
|
||||||
|
protected modelService = inject(ModelService);
|
||||||
|
protected visibilityService = inject(WidgetVisibilityService);
|
||||||
|
protected ecmModelService = inject(EcmModelService);
|
||||||
|
protected nodeService = inject(NodesApiService);
|
||||||
|
|
||||||
/** Underlying form model instance. */
|
/** Underlying form model instance. */
|
||||||
@Input()
|
@Input()
|
||||||
@ -92,36 +101,29 @@ export class FormComponent extends FormBaseComponent implements OnInit, OnDestro
|
|||||||
|
|
||||||
/** Emitted when the form is submitted with the `Save` or custom outcomes. */
|
/** Emitted when the form is submitted with the `Save` or custom outcomes. */
|
||||||
@Output()
|
@Output()
|
||||||
formSaved: EventEmitter<FormModel> = new EventEmitter<FormModel>();
|
formSaved = new EventEmitter<FormModel>();
|
||||||
|
|
||||||
/** Emitted when the form is submitted with the `Complete` outcome. */
|
/** Emitted when the form is submitted with the `Complete` outcome. */
|
||||||
@Output()
|
@Output()
|
||||||
formCompleted: EventEmitter<FormModel> = new EventEmitter<FormModel>();
|
formCompleted = new EventEmitter<FormModel>();
|
||||||
|
|
||||||
/** Emitted when form content is clicked. */
|
/** Emitted when form content is clicked. */
|
||||||
@Output()
|
@Output()
|
||||||
formContentClicked: EventEmitter<ContentLinkModel> = new EventEmitter<ContentLinkModel>();
|
formContentClicked = new EventEmitter<ContentLinkModel>();
|
||||||
|
|
||||||
/** Emitted when the form is loaded or reloaded. */
|
/** Emitted when the form is loaded or reloaded. */
|
||||||
@Output()
|
@Output()
|
||||||
formLoaded: EventEmitter<FormModel> = new EventEmitter<FormModel>();
|
formLoaded = new EventEmitter<FormModel>();
|
||||||
|
|
||||||
/** Emitted when form values are refreshed due to a data property change. */
|
/** Emitted when form values are refreshed due to a data property change. */
|
||||||
@Output()
|
@Output()
|
||||||
formDataRefreshed: EventEmitter<FormModel> = new EventEmitter<FormModel>();
|
formDataRefreshed = new EventEmitter<FormModel>();
|
||||||
|
|
||||||
debugMode: boolean = false;
|
debugMode: boolean = false;
|
||||||
|
|
||||||
protected onDestroy$ = new Subject<boolean>();
|
protected onDestroy$ = new Subject<boolean>();
|
||||||
|
|
||||||
constructor(protected formService: FormService,
|
constructor() {
|
||||||
protected taskFormService: TaskFormService,
|
|
||||||
protected taskService: TaskService,
|
|
||||||
protected editorService: EditorService,
|
|
||||||
protected modelService: ModelService,
|
|
||||||
protected visibilityService: WidgetVisibilityService,
|
|
||||||
protected ecmModelService: EcmModelService,
|
|
||||||
protected nodeService: NodesApiService) {
|
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,15 +26,12 @@ import {
|
|||||||
SimpleChanges,
|
SimpleChanges,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
ViewEncapsulation,
|
ViewEncapsulation,
|
||||||
OnDestroy
|
OnDestroy,
|
||||||
|
inject
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { FormComponent } from './form.component';
|
import { FormComponent } from './form.component';
|
||||||
import { ContentLinkModel, FormService, WidgetVisibilityService, FormOutcomeModel } from '@alfresco/adf-core';
|
import { ContentLinkModel, FormOutcomeModel } from '@alfresco/adf-core';
|
||||||
import { ProcessService } from '../process-list/services/process.service';
|
import { ProcessService } from '../process-list/services/process.service';
|
||||||
import { EditorService } from './services/editor.service';
|
|
||||||
import { ModelService } from './services/model.service';
|
|
||||||
import { TaskFormService } from './services/task-form.service';
|
|
||||||
import { TaskService } from './services/task.service';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'adf-start-form',
|
selector: 'adf-start-form',
|
||||||
@ -43,6 +40,7 @@ import { TaskService } from './services/task.service';
|
|||||||
encapsulation: ViewEncapsulation.None
|
encapsulation: ViewEncapsulation.None
|
||||||
})
|
})
|
||||||
export class StartFormComponent extends FormComponent implements OnChanges, OnInit, OnDestroy {
|
export class StartFormComponent extends FormComponent implements OnChanges, OnInit, OnDestroy {
|
||||||
|
public processService = inject(ProcessService);
|
||||||
|
|
||||||
/** Definition ID of the process to start, this parameter can not be use in combination with processId */
|
/** Definition ID of the process to start, this parameter can not be use in combination with processId */
|
||||||
@Input()
|
@Input()
|
||||||
@ -66,22 +64,17 @@ export class StartFormComponent extends FormComponent implements OnChanges, OnIn
|
|||||||
|
|
||||||
/** Emitted when the user clicks one of the outcome buttons that completes the form. */
|
/** Emitted when the user clicks one of the outcome buttons that completes the form. */
|
||||||
@Output()
|
@Output()
|
||||||
outcomeClick: EventEmitter<any> = new EventEmitter<any>();
|
outcomeClick = new EventEmitter<any>();
|
||||||
|
|
||||||
/** Emitted when a field of the form is clicked. */
|
/** Emitted when a field of the form is clicked. */
|
||||||
@Output()
|
@Output()
|
||||||
formContentClicked: EventEmitter<ContentLinkModel> = new EventEmitter<ContentLinkModel>();
|
formContentClicked = new EventEmitter<ContentLinkModel>();
|
||||||
|
|
||||||
@ViewChild('outcomesContainer')
|
@ViewChild('outcomesContainer')
|
||||||
outcomesContainer: ElementRef = null;
|
outcomesContainer: ElementRef = null;
|
||||||
|
|
||||||
constructor(public processService: ProcessService,
|
constructor() {
|
||||||
taskFormService: TaskFormService,
|
super();
|
||||||
taskService: TaskService,
|
|
||||||
editorService: EditorService,
|
|
||||||
modelService: ModelService,
|
|
||||||
formService: FormService, visibilityService: WidgetVisibilityService) {
|
|
||||||
super(formService, taskFormService, taskService, editorService, modelService, visibilityService, null, null);
|
|
||||||
this.showTitle = false;
|
this.showTitle = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user