Skip to content

Commit

Permalink
Fixed bug where resizing textfield on NVCL modal doesn't work.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwoodman committed Oct 21, 2024
1 parent 9d3f03d commit 0dc71f1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,25 @@ <h4 class="card-title">{{layer.name}}</h4>
<div class="card-body">
<form #f="ngForm">
<div class="alert alert-secondary">
National Virtual Core Library analytics are run remotely and may take some time to complete. By entering an email and a job name you can come back to this form later to collect your results.
</div>
<div class="">
<div class="form-group form-group-md row justify-content-start">
<label class="col-md-2">Email:</label>
<div class="col-md-6">
<input type="text" class="form-control form-control-sm" [(ngModel)]="nvclform.email" name="email" ngModel #email="ngModel" required pattern="([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$">
National Virtual Core Library analytics are run remotely and may take some time to complete. By entering an email and a job name you can come back to this form later to collect your results.
</div>
<div class="">
<div class="form-group form-group-md row justify-content-start">
<label class="col-md-2">Email:</label>
<div class="col-md-6">
<input type="text" class="form-control form-control-sm" [(ngModel)]="nvclform.email" name="email" ngModel #email="ngModel" required pattern="([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,5})$">
<span class="validity" *ngIf="!email.valid && email.touched"></span>
</div>
</div>
</div>
<div class="form-group form-group-md row justify-content-start">
<label class="col-md-2">Job Name:</label>
<div class="col-md-6">
<input id="jobName" type="text" class="form-control form-control-sm" [(ngModel)]="nvclform.jobName" name="jobName" required minlength="1" ngModel #jobName="ngModel" >
<span class="validity" *ngIf="!jobName.valid && jobName.touched"></span>
<input id="jobName" type="text" class="form-control form-control-sm" [(ngModel)]="nvclform.jobName" name="jobName" required minlength="1" ngModel #jobName="ngModel" >
<span class="validity" *ngIf="!jobName.valid && jobName.touched"></span>
</div>
</div>
</div>


<div class="card card-default card-with-tabs" cdkDrag cdkDragRootElement=".modal-content" #childElement cdkDragBoundary="body">
<!-- BEGIN card-header -->
<div class="card-header">
Expand All @@ -52,34 +51,33 @@ <h4 class="card-title">Borehole Analytics</h4>
Please select a classification algorithm to filter boreholes against.
<div class="form-group form-group-md">
<div id="nvcl-boreholeanalytic-algor-radio">
<input type="radio" name="ExistingAlgorithm" id="ExistingAlgorithm" [value]="true" [(ngModel)]="isExistingAlgorithm" style="margin-left: 5px"> <label for = "existA" >Existing Algorithm </label>
<input type="radio" name="ExistingAlgorithm" id="ExistingAlgorithm" [value]="true" [(ngModel)]="isExistingAlgorithm" style="margin-left: 5px"> <label for = "existA" >Existing Algorithm&nbsp;</label>
<input type="radio" name="NewAlgorithm" id="NewAlgorithm" [value]="false" [(ngModel)]="isExistingAlgorithm" style="margin-left: 5px"> <label for = "newA">New Alogrithm</label>
</div>
</div>
</div>
</div>
<fieldset *ngIf="!isExistingAlgorithm" class="show-fieldset-borders-whitebg mb-3">
<legend><h6>New Algorithm</h6></legend>
<div class="form">
<div class="form-group form-group-md row">
<label class="col-md-3">Name:</label>
<div class="col-md-8">
<select class="form-control form-control-sm" [(ngModel)]="nvclform.tsgAlgName" (change) = "changeTSGAlgorithm()" name="tsgAlgName" required ngModel #tsgAlgName="ngModel" >>
<option value="User Supplied Algorithm">User Supplied Algorithm</option>
<option *ngFor="let x of tSGAlgorithmNames" [value]="x">{{x}}</option>
</select>
<span class="validity" *ngIf="!tsgAlgName.valid && tsgAlgName.touched"></span>
</div>
</div>
<legend><h6>New Algorithm</h6></legend>
<div class="form">
<div class="form-group form-group-md row">
<label class="col-md-3">Name:</label>
<div class="col-md-8">
<select class="form-control form-control-sm" [(ngModel)]="nvclform.tsgAlgName" (change) = "changeTSGAlgorithm()" name="tsgAlgName" required ngModel #tsgAlgName="ngModel" >>
<option value="User Supplied Algorithm">User Supplied Algorithm</option>
<option *ngFor="let x of tSGAlgorithmNames" [value]="x">{{x}}</option>
</select>
<span class="validity" *ngIf="!tsgAlgName.valid && tsgAlgName.touched"></span>
</div>
</div>
<div class="form-group form-group-md row" *ngIf="nvclform.tsgAlgName">
<label class="col-md-3">Algorithm</label>
<div class="col-md-8">
<textarea rows="12" cols="50" [(ngModel)]="nvclform.tsgAlgorithm" name="tsgAlogrithm" required></textarea>
<label class="col-md-3">Algorithm:</label>
<div class="col-md-8">
<textarea (mousedown)="$event.stopPropagation();" rows="12" cols="50" [(ngModel)]="nvclform.tsgAlgorithm" name="tsgAlogrithm" required></textarea>
<span class="validity"></span>
</div>
</div>
</div>
</div>
</fieldset>

</fieldset>

<fieldset *ngIf="isExistingAlgorithm" class="show-fieldset-borders-whitebg mb-3">
<legend><h6>Existing Algorithm</h6></legend>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { environment } from '../../../../environments/environment';
import { saveAs } from 'file-saver';
import { LayerModel } from '@auscope/portal-core-ui';
import { NVCLBoreholeAnalyticService } from './nvcl.boreholeanalytic.service';
Expand All @@ -11,7 +10,6 @@ import {
} from '@angular/core';
import { LayerAnalyticInterface } from '../layer.analytic.interface';
import { NgForm } from '@angular/forms';
import { UserStateService } from 'app/services/user/user-state.service';


@Component({
Expand Down Expand Up @@ -51,8 +49,7 @@ export class NVCLBoreholeAnalyticComponent
};

constructor(
public nvclBoreholeAnalyticService: NVCLBoreholeAnalyticService,
private userStateService: UserStateService
public nvclBoreholeAnalyticService: NVCLBoreholeAnalyticService
) {
this.nvclform = {};
}
Expand Down Expand Up @@ -195,6 +192,7 @@ export class NVCLBoreholeAnalyticComponent
// console.log('jobid=' + jobid + ' publishStatus=' + response);
});
}

public nvclDownload(jobid: string) {
this.nvclBoreholeAnalyticService
.downloadNVCLJobResult(jobid)
Expand Down

0 comments on commit 0dc71f1

Please sign in to comment.