mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACA-3245] Fetch alfresco repo name from an API (#5676)
* [ACA-3245] Fetch alfresco repo name from an API * [ACA-3245] Take the repo name from the API only when it is not defined in the app config * [ACA-3245] Remo alfresco-1 as default in app.config service * [ACA-3245] Remove passing null argument when calling getRepositories function * [ACA-3245] Revert removing function parameter includeAccounts * [ACA-3245] Add tenantId as optional * [ACA-3245] Revert method * [ACA-3245] Change both parameters to optional * [ACA-3245] Rename param
This commit is contained in:
@@ -20,7 +20,9 @@ import {
|
||||
Output, SimpleChanges, ViewChild, ViewEncapsulation, OnDestroy
|
||||
} from '@angular/core';
|
||||
import {
|
||||
ActivitiContentService, AppConfigService, AppConfigValues,
|
||||
ActivitiContentService,
|
||||
AppConfigService,
|
||||
AppConfigValues,
|
||||
FormValues
|
||||
} from '@alfresco/adf-core';
|
||||
import { ProcessInstanceVariable } from '../models/process-instance-variable.model';
|
||||
@@ -108,6 +110,7 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit, OnDestr
|
||||
processDefinitionInput: FormControl;
|
||||
filteredProcesses: Observable<ProcessDefinitionRepresentation[]>;
|
||||
maxProcessNameLength: number = this.MAX_LENGTH;
|
||||
alfrescoRepositoryName: string;
|
||||
|
||||
private onDestroy$ = new Subject<boolean>();
|
||||
|
||||
@@ -131,6 +134,13 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit, OnDestr
|
||||
map((value) => this._filter(value)),
|
||||
takeUntil(this.onDestroy$)
|
||||
);
|
||||
|
||||
this.activitiContentService.getAlfrescoRepositories().subscribe((repoList) => {
|
||||
if (repoList && repoList[0]) {
|
||||
const alfrescoRepository = repoList[0];
|
||||
this.alfrescoRepositoryName = `alfresco-${alfrescoRepository.id}-${alfrescoRepository.name}`;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
@@ -211,7 +221,7 @@ export class StartProcessInstanceComponent implements OnChanges, OnInit, OnDestr
|
||||
getAlfrescoRepositoryName(): string {
|
||||
let alfrescoRepositoryName = this.appConfig.get<string>(AppConfigValues.ALFRESCO_REPOSITORY_NAME);
|
||||
if (!alfrescoRepositoryName) {
|
||||
alfrescoRepositoryName = 'alfresco-1';
|
||||
alfrescoRepositoryName = this.alfrescoRepositoryName;
|
||||
}
|
||||
return alfrescoRepositoryName + 'Alfresco';
|
||||
}
|
||||
|
Reference in New Issue
Block a user