Skip to content

Commit

Permalink
set type on number inputs and updated generated code (#175)
Browse files Browse the repository at this point in the history
* set type on number inputs and updated generated code

* Add missing document markings

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
sei-aschlackman and github-actions[bot] authored Jun 3, 2021
1 parent 8278d09 commit 35e83b0
Show file tree
Hide file tree
Showing 15 changed files with 384 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
<mat-form-field class="full-width">
<input
matInput
type="number"
placeholder="Duration Hours (required)"
[formControl]="durationHoursFormControl"
value="{{ data.scenarioTemplate.durationHours }}"
[errorStateMatcher]="notAnIntegerErrorState"
/>
<mat-error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class ScenarioTemplateEditDialogComponent {
.toString()
.trim();
modifiedScenarioTemplate.durationHours =
this.durationHoursFormControl.value.toString().trim();
this.durationHoursFormControl.value;
if (this.errorFree) {
this.editComplete.emit({
saveChanges: saveChanges,
Expand Down
20 changes: 10 additions & 10 deletions src/app/components/tasks/task-edit/task-edit.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ <h2>Scoring</h2>
<mat-form-field class="param-full-width">
<input
matInput
type="number"
placeholder="Points awarded for successful task completion"
[value]="data.task.score"
(input)="data.task.score = $event.target.value"
[(ngModel)]="data.task.score"
/>
</mat-form-field>
<mat-checkbox
Expand All @@ -167,25 +167,25 @@ <h2>Delay / Iteration / Expiration</h2>
<mat-form-field class="param-full-width">
<input
matInput
type="number"
placeholder="Delay (in seconds) Before Executing This Task"
[value]="data.task.delaySeconds"
(input)="data.task.delaySeconds = $event.target.value"
[(ngModel)]="data.task.delaySeconds"
/>
</mat-form-field>
<mat-form-field class="param-full-width">
<input
matInput
type="number"
placeholder="Number of Iterations"
[value]="data.task.iterations"
(input)="data.task.iterations = $event.target.value"
[(ngModel)]="data.task.iterations"
/>
</mat-form-field>
<mat-form-field class="param-full-width">
<input
matInput
type="number"
placeholder="Interval (in seconds) Between Iterations"
[value]="data.task.intervalSeconds"
(input)="data.task.intervalSeconds = $event.target.value"
[(ngModel)]="data.task.intervalSeconds"
/>
</mat-form-field>
<mat-form-field class="param-full-width">
Expand All @@ -205,9 +205,9 @@ <h2>Delay / Iteration / Expiration</h2>
<mat-form-field class="param-full-width">
<input
matInput
type="number"
placeholder="Expiration Timeout (in seconds)"
[value]="data.task.expirationSeconds"
(input)="data.task.expirationSeconds = $event.target.value"
[(ngModel)]="data.task.expirationSeconds"
/>
</mat-form-field>

Expand Down
2 changes: 1 addition & 1 deletion src/app/data/scenario/scenario-data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export class ScenarioDataService {
createScenarioFromScenarioTemplate(scenarioTemplateId: string) {
this.scenarioStore.setLoading(true);
this.scenarioService
.createScenarioFromScenarioTemplate(scenarioTemplateId)
.createScenarioFromScenarioTemplate(scenarioTemplateId, {})
.pipe(
tap(() => {
this.scenarioStore.setLoading(false);
Expand Down
5 changes: 5 additions & 0 deletions src/app/generated/steamfitter.api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ model/consoleConnectionInfo.ts
model/directoryInfo.ts
model/fileAttributes.ts
model/fileInfo.ts
model/gradedExecutionInfo.ts
model/healthStatus.ts
model/localUser.ts
model/models.ts
Expand All @@ -33,11 +34,15 @@ model/permission.ts
model/problemDetails.ts
model/result.ts
model/scenario.ts
model/scenarioCloneOptions.ts
model/scenarioForm.ts
model/scenarioStatus.ts
model/scenarioTemplate.ts
model/scenarioTemplateForm.ts
model/sshPort.ts
model/task.ts
model/taskAction.ts
model/taskForm.ts
model/taskIterationTermination.ts
model/taskStatus.ts
model/taskTrigger.ts
Expand Down
48 changes: 31 additions & 17 deletions src/app/generated/steamfitter.api/api/scenario.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import { Observable } from 'rxjs';

import { ProblemDetails } from '../model/models';
import { Scenario } from '../model/models';
import { ScenarioCloneOptions } from '../model/models';
import { ScenarioForm } from '../model/models';

import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
Expand Down Expand Up @@ -273,14 +275,14 @@ export class ScenarioService {
/**
* Creates a new Scenario
* Creates a new Scenario with the attributes specified &lt;para /&gt; Accessible only to a SuperUser or an Administrator
* @param scenario The data to create the Scenario with
* @param scenarioForm The data to create the Scenario with
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public createScenario(scenario?: Scenario, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<Scenario>;
public createScenario(scenario?: Scenario, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpResponse<Scenario>>;
public createScenario(scenario?: Scenario, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpEvent<Scenario>>;
public createScenario(scenario?: Scenario, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<any> {
public createScenario(scenarioForm?: ScenarioForm, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<Scenario>;
public createScenario(scenarioForm?: ScenarioForm, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpResponse<Scenario>>;
public createScenario(scenarioForm?: ScenarioForm, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpEvent<Scenario>>;
public createScenario(scenarioForm?: ScenarioForm, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<any> {

let headers = this.defaultHeaders;

Expand Down Expand Up @@ -323,7 +325,7 @@ export class ScenarioService {
}

return this.httpClient.post<Scenario>(`${this.configuration.basePath}/api/scenarios`,
scenario,
scenarioForm,
{
responseType: <any>responseType,
withCredentials: this.configuration.withCredentials,
Expand All @@ -338,13 +340,14 @@ export class ScenarioService {
* Creates a new Scenario from a ScenarioTemplate
* Creates a new Scenario from the specified ScenarioTemplate &lt;para /&gt; Accessible only to a SuperUser or an Administrator
* @param id The ScenarioTemplate ID to create the Scenario with
* @param scenarioCloneOptions
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public createScenarioFromScenarioTemplate(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<Scenario>;
public createScenarioFromScenarioTemplate(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpResponse<Scenario>>;
public createScenarioFromScenarioTemplate(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpEvent<Scenario>>;
public createScenarioFromScenarioTemplate(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<any> {
public createScenarioFromScenarioTemplate(id: string, scenarioCloneOptions?: ScenarioCloneOptions, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<Scenario>;
public createScenarioFromScenarioTemplate(id: string, scenarioCloneOptions?: ScenarioCloneOptions, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpResponse<Scenario>>;
public createScenarioFromScenarioTemplate(id: string, scenarioCloneOptions?: ScenarioCloneOptions, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpEvent<Scenario>>;
public createScenarioFromScenarioTemplate(id: string, scenarioCloneOptions?: ScenarioCloneOptions, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling createScenarioFromScenarioTemplate.');
}
Expand Down Expand Up @@ -373,13 +376,24 @@ export class ScenarioService {
}


// to determine the Content-Type header
const consumes: string[] = [
'application/json',
'text/json',
'application/_*+json'
];
const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes);
if (httpContentTypeSelected !== undefined) {
headers = headers.set('Content-Type', httpContentTypeSelected);
}

let responseType: 'text' | 'json' = 'json';
if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) {
responseType = 'text';
}

return this.httpClient.post<Scenario>(`${this.configuration.basePath}/api/scenariotemplates/${encodeURIComponent(String(id))}/scenarios`,
null,
scenarioCloneOptions,
{
responseType: <any>responseType,
withCredentials: this.configuration.withCredentials,
Expand Down Expand Up @@ -827,14 +841,14 @@ export class ScenarioService {
* Updates a Scenario
* Updates an Scenario with the attributes specified &lt;para /&gt; Accessible only to a SuperUser or a User on an Admin Team within the specified Scenario
* @param id The Id of the Exericse to update
* @param scenario The updated Scenario values
* @param scenarioForm The updated Scenario values
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public updateScenario(id: string, scenario?: Scenario, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<Scenario>;
public updateScenario(id: string, scenario?: Scenario, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpResponse<Scenario>>;
public updateScenario(id: string, scenario?: Scenario, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpEvent<Scenario>>;
public updateScenario(id: string, scenario?: Scenario, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<any> {
public updateScenario(id: string, scenarioForm?: ScenarioForm, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<Scenario>;
public updateScenario(id: string, scenarioForm?: ScenarioForm, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpResponse<Scenario>>;
public updateScenario(id: string, scenarioForm?: ScenarioForm, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpEvent<Scenario>>;
public updateScenario(id: string, scenarioForm?: ScenarioForm, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling updateScenario.');
}
Expand Down Expand Up @@ -880,7 +894,7 @@ export class ScenarioService {
}

return this.httpClient.put<Scenario>(`${this.configuration.basePath}/api/scenarios/${encodeURIComponent(String(id))}`,
scenario,
scenarioForm,
{
responseType: <any>responseType,
withCredentials: this.configuration.withCredentials,
Expand Down
25 changes: 13 additions & 12 deletions src/app/generated/steamfitter.api/api/scenarioTemplate.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { Observable } from 'rxjs';

import { ProblemDetails } from '../model/models';
import { ScenarioTemplate } from '../model/models';
import { ScenarioTemplateForm } from '../model/models';

import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';
Expand Down Expand Up @@ -149,14 +150,14 @@ export class ScenarioTemplateService {
/**
* Creates a new ScenarioTemplate
* Creates a new ScenarioTemplate with the attributes specified &lt;para /&gt; Accessible only to a SuperUser or an Administrator
* @param scenarioTemplate The data to create the ScenarioTemplate with
* @param scenarioTemplateForm The data to create the ScenarioTemplate with
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public createScenarioTemplate(scenarioTemplate?: ScenarioTemplate, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<ScenarioTemplate>;
public createScenarioTemplate(scenarioTemplate?: ScenarioTemplate, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpResponse<ScenarioTemplate>>;
public createScenarioTemplate(scenarioTemplate?: ScenarioTemplate, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpEvent<ScenarioTemplate>>;
public createScenarioTemplate(scenarioTemplate?: ScenarioTemplate, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<any> {
public createScenarioTemplate(scenarioTemplateForm?: ScenarioTemplateForm, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<ScenarioTemplate>;
public createScenarioTemplate(scenarioTemplateForm?: ScenarioTemplateForm, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpResponse<ScenarioTemplate>>;
public createScenarioTemplate(scenarioTemplateForm?: ScenarioTemplateForm, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpEvent<ScenarioTemplate>>;
public createScenarioTemplate(scenarioTemplateForm?: ScenarioTemplateForm, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<any> {

let headers = this.defaultHeaders;

Expand Down Expand Up @@ -199,7 +200,7 @@ export class ScenarioTemplateService {
}

return this.httpClient.post<ScenarioTemplate>(`${this.configuration.basePath}/api/scenariotemplates`,
scenarioTemplate,
scenarioTemplateForm,
{
responseType: <any>responseType,
withCredentials: this.configuration.withCredentials,
Expand Down Expand Up @@ -373,14 +374,14 @@ export class ScenarioTemplateService {
* Updates an ScenarioTemplate
* Updates an ScenarioTemplate with the attributes specified &lt;para /&gt; Accessible only to a SuperUser or a User on an Admin Team within the specified ScenarioTemplate
* @param id The Id of the Exericse to update
* @param scenarioTemplate The updated ScenarioTemplate values
* @param scenarioTemplateForm The updated ScenarioTemplate values
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public updateScenarioTemplate(id: string, scenarioTemplate?: ScenarioTemplate, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<ScenarioTemplate>;
public updateScenarioTemplate(id: string, scenarioTemplate?: ScenarioTemplate, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpResponse<ScenarioTemplate>>;
public updateScenarioTemplate(id: string, scenarioTemplate?: ScenarioTemplate, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpEvent<ScenarioTemplate>>;
public updateScenarioTemplate(id: string, scenarioTemplate?: ScenarioTemplate, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<any> {
public updateScenarioTemplate(id: string, scenarioTemplateForm?: ScenarioTemplateForm, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<ScenarioTemplate>;
public updateScenarioTemplate(id: string, scenarioTemplateForm?: ScenarioTemplateForm, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpResponse<ScenarioTemplate>>;
public updateScenarioTemplate(id: string, scenarioTemplateForm?: ScenarioTemplateForm, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<HttpEvent<ScenarioTemplate>>;
public updateScenarioTemplate(id: string, scenarioTemplateForm?: ScenarioTemplateForm, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'text/plain' | 'application/json' | 'text/json'}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling updateScenarioTemplate.');
}
Expand Down Expand Up @@ -426,7 +427,7 @@ export class ScenarioTemplateService {
}

return this.httpClient.put<ScenarioTemplate>(`${this.configuration.basePath}/api/scenariotemplates/${encodeURIComponent(String(id))}`,
scenarioTemplate,
scenarioTemplateForm,
{
responseType: <any>responseType,
withCredentials: this.configuration.withCredentials,
Expand Down
Loading

0 comments on commit 35e83b0

Please sign in to comment.