This commit is contained in:
Manuel Romero
2020-09-02 12:12:09 +02:00
parent f38aef13be
commit beb2330bcd
4 changed files with 18 additions and 10 deletions

View File

@@ -9,5 +9,5 @@
<link rel="stylesheet" href="styles.10f399db28cccbaac682.css"></head>
<body>
<app-root></app-root>
<script src="runtime.e227d1a0e31cbccbf8ec.js" defer></script><script src="polyfills-es5.f1f388528ea207060cbf.js" nomodule defer></script><script src="polyfills.335424f161535f57733f.js" defer></script><script src="scripts.5520a99f673924c17e00.js" defer></script><script src="main.0256a1b598757dede0a2.js" defer></script></body>
<script src="runtime.e227d1a0e31cbccbf8ec.js" defer></script><script src="polyfills-es5.f1f388528ea207060cbf.js" nomodule defer></script><script src="polyfills.335424f161535f57733f.js" defer></script><script src="scripts.5520a99f673924c17e00.js" defer></script><script src="main.8dacfd0219d41542a8d6.js" defer></script></body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -8,20 +8,23 @@
</div>
<div class="modal-body" style="max-height: 650px; overflow: auto;">
<!--<h5>{{scenario.title}}</h5>-->
<div class="needs-validation">
<div class="md-form row" style="padding: 15px;">
<div class="col-sm-6">
<h5>Purpose: (*)</h5>
<textarea [(ngModel)]="sendData.description" type="text" class="md-textarea form-control" rows="1" mdbInput placeholder="Short description or Salesforce opportunity"></textarea>
<textarea [(ngModel)]="sendData.description" type="text" class="md-textarea form-control" rows="1" mdbInput placeholder="Short description or Salesforce opportunity" required></textarea>
</div>
<div *ngIf="scenario.deployOpts" class="col-sm-6">
<div>
<label>Deploy into: (*)</label>
<label>Deploy into region: (*)</label>
</div>
<select id="region" class="browser-default custom-select custom-select-sm" [(ngModel)]="selectedDeployOpts">
<select id="region" class="browser-default custom-select custom-select-sm" [(ngModel)]="selectedDeployOpts" required>
<option value="" selected disabled >-- Select --</option>
<option *ngFor="let item of scenario.deployOpts" [value]="item._id">{{item.description}}</option>
</select>
</div>
</div>
</div>
<div *ngIf="scenario.isDivvyEnabled" style="background: #f0f0f0; padding: 15px 15px; margin: 7px 0px;">
<div>

View File

@@ -43,15 +43,18 @@ export class NewProvisionConfirmComponent implements OnInit, OnDestroy {
}
};
selectedDeployOpts;
selectedDeployOpts = "";
zone;
forms;
constructor( public modalRef: MDBModalRef, private _scenariosService: ScenariosService, private _provisionsService: ProvisionsService ) {}
ngOnInit() {
this.zone = moment.tz.guess(true);
this.forms = document.getElementsByClassName('needs-validation');
this.vmTypesSub = this._scenariosService.getScenarioVmtypes().subscribe ( res => {
this.vmTypes = res.results.filter(v=>!v.disabled);
@@ -73,9 +76,9 @@ export class NewProvisionConfirmComponent implements OnInit, OnDestroy {
}
});
if ( this.scenario.deployOpts && this.scenario.deployOpts.length ) {
this.selectedDeployOpts = this.scenario.deployOpts[0]._id;
}
//if ( this.scenario.deployOpts && this.scenario.deployOpts.length ) {
// this.selectedDeployOpts = this.scenario.deployOpts[0]._id;
//}
}
this.vmTypesSub.unsubscribe();
@@ -88,7 +91,9 @@ export class NewProvisionConfirmComponent implements OnInit, OnDestroy {
}
confirm() : void {
if (!this.sendData.description || this.sendData.description.trim() === "") {
if (!this.sendData.description || this.sendData.description.trim() === "" || !this.selectedDeployOpts || this.selectedDeployOpts === "" ) {
this.forms[0].classList.add('was-validated');
return;
}
this.sendData.servers = {};