Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
silentLogin: false,
redirectUri: '/',
redirectUriLogout: '/logout'
}
};
host = program.host;
try {
this.alfrescoJsApi = new alfrescoApi.AlfrescoApiCompatibility(config);
await this.alfrescoJsApi.login(program.username, program.password);
} catch (e) {
console.log('Login error' + e);
}
for (const key of Object.keys(RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS)) {
await deleteApp(alfrescoJsApi, RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS[key].name);
}
let notRunning = await getNotRunningApps(this.alfrescoJsApi);
if (notRunning && notRunning.length > 0) {
console.log(JSON.stringify(notRunning));
}
}
async function getNotRunningApps(alfrescoJsApi) {
let allStatusApps = await getDeployedApplicationsByStatus(alfrescoJsApi, '');
Object.keys(RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS).forEach((key) => {
let isNotRunning = allStatusApps.find((currentApp) => {
//console.log(currentApp.entry.name + ' ' +currentApp.entry.status);
return RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS[key].name === currentApp.entry.name && currentApp.entry.status !== 'Running';
});
if (isNotRunning && isNotRunning.entry.status !== 'ImagePushFailed') {
notRunningApps.push(isNotRunning);
}
});
if (notRunningApps.length > 0) {
console.log(`The following apps are NOT running in the target env:`);
notRunningApps.forEach((currentApp) => {
console.log(`App ${currentApp.entry.name } current status ${JSON.stringify(currentApp.entry.status)}`);
});
let isNotRunning = allStatusApps.find((currentApp) => {
//console.log(currentApp.entry.name + ' ' +currentApp.entry.status);
return RESOURCES_CLOUD.ACTIVITI_CLOUD_APPS[key].name === currentApp.entry.name && currentApp.entry.status !== 'Running';
});
onFilterChange(query: any) {
this.editedFilter = Object.assign({}, query);
this.sortArray = [
new ProcessListCloudSortingModel({
orderBy: this.editedFilter.sort,
direction: this.editedFilter.order
})
];
}
onFilterChange(query: any) {
this.editedFilter = Object.assign({}, query);
this.sortArray = [
new ProcessListCloudSortingModel({
orderBy: this.editedFilter.sort,
direction: this.editedFilter.order
})
];
}
onFilterChange(filter: any) {
this.editedFilter = Object.assign({}, filter);
this.sortArray = [new TaskListCloudSortingModel({ orderBy: this.editedFilter.sort, direction: this.editedFilter.order })];
}
onFilterChange(filter: any) {
this.editedFilter = Object.assign({}, filter);
this.sortArray = [new TaskListCloudSortingModel({ orderBy: this.editedFilter.sort, direction: this.editedFilter.order })];
}
get groupMultipleMode() {
return GroupCloudComponent.MODE_MULTIPLE;
}
}
encapsulation: ViewEncapsulation.None
})
export class PeopleGroupCloudDemoComponent {
DEFAULT_FILTER_MODE: string = 'appName';
DEFAULT_GROUP_PLACEHOLDER: string = `[{"id": "1", "name":"activitiUserGroup"}]`;
DEFAULT_PEOPLE_PLACEHOLDER: string = `[{"id": "1", email": "user@user.com", "firstName":"user", "lastName": "lastName", "username": "user"}]`;
peopleMode: string = PeopleCloudComponent.MODE_SINGLE;
preSelectUsers: string[] = [];
peopleRoles: string[] = [];
peopleAppName: string;
peopleFilterMode: string = this.DEFAULT_FILTER_MODE;
peoplePreselectValidation: Boolean = false;
groupMode: string = GroupCloudComponent.MODE_SINGLE;
preSelectGroup: IdentityGroupModel[] = [];
selectedGroupList: IdentityGroupModel[] = [];
groupRoles: string[];
groupAppName: string;
groupFilterMode: string = this.DEFAULT_FILTER_MODE;
setPeoplePreselectValue(event: any) {
this.preSelectUsers = this.getArrayFromString(event.target.value);
}
setGroupsPreselectValue(event: any) {
this.preSelectGroup = this.getArrayFromString(event.target.value);
}
setPeopleRoles(event: any) {
this.peopleRoles = this.getArrayFromString(event.target.value);
get peopleMultipleMode() {
return PeopleCloudComponent.MODE_MULTIPLE;
}