fix: improved deploy flow for Viya
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
<div class="card-header">Terms and Conditions</div>
|
||||
<div class="card-block">
|
||||
<div class="card-text">
|
||||
<p>
|
||||
<p class="mt-0">
|
||||
The Demo version of Data Controller is free for EVALUATION purposes
|
||||
only. Before proceeding with configuration, please confirm that you
|
||||
have read, understood, and agreed to the
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
class="deploy-error"
|
||||
shape="times-circle"
|
||||
></clr-icon>
|
||||
LAUNCH / CONFIGURE
|
||||
LAUNCH
|
||||
</button>
|
||||
|
||||
<button
|
||||
@@ -106,7 +106,14 @@
|
||||
<label for="dcloc" class="mt-20 clr-control-label">SAS Admin group</label>
|
||||
<div class="mb-10 clr-control-container">
|
||||
<div class="clr-input-wrapper">
|
||||
<p class="mt-0">{{ selectedAdminGroup }}</p>
|
||||
<select *ngIf="!adminGroupsLoading" clrSelect name="options" [(ngModel)]="selectedAdminGroup">
|
||||
<option *ngFor="let adminGroup of adminGroups" [value]="adminGroup.id">{{adminGroup.name}}</option>
|
||||
</select>
|
||||
<clr-spinner
|
||||
clrInline
|
||||
class="spinner-sm"
|
||||
*ngIf="adminGroupsLoading"
|
||||
></clr-spinner>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@ import { DcAdapterSettings } from 'src/app/models/DcAdapterSettings'
|
||||
import { DeployService } from 'src/app/services/deploy.service'
|
||||
import { EventService } from 'src/app/services/event.service'
|
||||
import { LoggerService } from 'src/app/services/logger.service'
|
||||
import { SasViyaService } from 'src/app/services/sas-viya.service'
|
||||
import { SasService } from 'src/app/services/sas.service'
|
||||
import { Item, ViyaApiIdentities } from 'src/app/viya-api-explorer/models/viya-api-identities.model'
|
||||
|
||||
@Component({
|
||||
selector: 'app-automatic-deploy',
|
||||
@@ -42,6 +44,8 @@ export class AutomaticComponent implements OnInit {
|
||||
*/
|
||||
public recreateDatabase: boolean = true
|
||||
public createDatabaseLoading: boolean = false
|
||||
public adminGroupsLoading: boolean = false
|
||||
public adminGroups: {id: string, name: string}[] = []
|
||||
|
||||
/** autoDeployStatus
|
||||
* This object presents the status for two steps that we have for deploy.
|
||||
@@ -62,10 +66,37 @@ export class AutomaticComponent implements OnInit {
|
||||
private eventService: EventService,
|
||||
private deployService: DeployService,
|
||||
private sasService: SasService,
|
||||
private sasViyaService: SasViyaService,
|
||||
private loggerService: LoggerService
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {}
|
||||
ngOnInit(): void {
|
||||
this.getAdminGroups()
|
||||
}
|
||||
|
||||
public async getAdminGroups() {
|
||||
this.adminGroupsLoading = true
|
||||
|
||||
this.sasViyaService.getAdminGroups().subscribe(
|
||||
(res: ViyaApiIdentities) => {
|
||||
this.adminGroupsLoading = false
|
||||
// Map admin groups with only needed fields
|
||||
this.adminGroups = res.items.map((item: Item) => {
|
||||
return {
|
||||
id: item.id,
|
||||
name: item.name
|
||||
}
|
||||
})
|
||||
}
|
||||
), ((err: any) => {
|
||||
this.adminGroupsLoading = false
|
||||
this.loggerService.error('Error while getting admin groups', err)
|
||||
this.eventService.showAbortModal(
|
||||
'admin groups',
|
||||
err
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes sas.json file to deploy the backend
|
||||
@@ -169,6 +200,7 @@ export class AutomaticComponent implements OnInit {
|
||||
}
|
||||
})
|
||||
.catch((err: any) => {
|
||||
this.eventService.showAbortModal('makedata', err)
|
||||
this.autoDeployStatus.runMakeData = false
|
||||
this.autodeployDone = true
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import { AppStoreService } from './app-store.service'
|
||||
import { ViyaApis } from '../viya-api-explorer/models/viya-apis.models'
|
||||
import { ViyaApiFolderMembers } from '../viya-api-explorer/models/viya-api-folder-content.model'
|
||||
import { ViyaApiFolder } from '../viya-api-explorer/models/viya-api-folder.model'
|
||||
import { ViyaApiIdentities } from '../viya-api-explorer/models/viya-api-identities.model'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -128,4 +129,13 @@ export class SasViyaService {
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
getAdminGroups(limit: number = 5000): Observable<ViyaApiIdentities> {
|
||||
return this.http.get<any>(
|
||||
`${this.serverUrl}/identities/groups?sortBy=name&limit=${limit}`,
|
||||
{
|
||||
withCredentials: true
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
export interface ViyaApiIdentities {
|
||||
links: Link[];
|
||||
name: string;
|
||||
accept: string;
|
||||
start: number;
|
||||
count: number;
|
||||
items: Item[];
|
||||
limit: number;
|
||||
version: number;
|
||||
}
|
||||
|
||||
export interface Item {
|
||||
creationTimeStamp: string;
|
||||
modifiedTimeStamp: string;
|
||||
links: Link2[];
|
||||
version: number;
|
||||
id: string;
|
||||
name: string;
|
||||
providerId: string;
|
||||
type: string;
|
||||
scimId: string;
|
||||
description?: string;
|
||||
state: string;
|
||||
}
|
||||
|
||||
export interface Link2 {
|
||||
method: string;
|
||||
rel: string;
|
||||
href: string;
|
||||
uri: string;
|
||||
type?: string;
|
||||
}
|
||||
|
||||
export interface Link {
|
||||
method: string;
|
||||
rel: string;
|
||||
href: string;
|
||||
uri: string;
|
||||
type: string;
|
||||
itemType: string;
|
||||
}
|
||||
Reference in New Issue
Block a user