Skip to content

Commit

Permalink
Form
Browse files Browse the repository at this point in the history
  • Loading branch information
oodamien committed Jul 3, 2023
1 parent 1014592 commit c4e41f9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions ui/src/app/apps/add/add.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
padding: .6rem 0;
margin: 0;
}
.clr-error .clr-select-wrapper:after, .clr-success .clr-select-wrapper:after {
right: 0;
}
}
6 changes: 3 additions & 3 deletions ui/src/app/apps/add/register/register.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
formControlName="bootVersion"
class="clr-select"
>
<option value="">{{ 'applications.add.register.bootVersionPlaceholder' | translate }}</option>
<option *ngFor="let bootVersionKey of bootVersions.getKeys()" value="{{ bootVersionKey }}">
{{ bootVersions[bootVersionKey] }}
<option value="">{{ 'applications.main.bootVersionPlaceholder' | translate }}</option>
<option *ngFor="let bootVersionKey of bootVersions" value="{{ bootVersionKey }}">
Spring Boot {{ bootVersionKey }}
</option>
</select>
</div>
Expand Down
6 changes: 5 additions & 1 deletion ui/src/app/apps/add/register/register.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {TranslateService} from '@ngx-translate/core';
export class RegisterComponent implements OnInit {
forms: UntypedFormGroup[] = [];
applicationTypes = ApplicationType;
bootVersions = ['2', '3'];
submitted = false;
isImporting = false;

Expand Down Expand Up @@ -53,6 +54,7 @@ export class RegisterComponent implements OnInit {
type: form.get('type').value as ApplicationType,
uri: form.get('uri').value,
metaDataUri: form.get('metaDataUri').value,
bootVersion: form.get('bootVersion').value,
force: form.get('force').value
};
}
Expand Down Expand Up @@ -102,7 +104,8 @@ export class RegisterComponent implements OnInit {
form.get('uri').hasError('required') &&
form.get('name').hasError('required') &&
form.get('metaDataUri').value === '' &&
form.get('type').hasError('required')
form.get('type').hasError('required') &&
form.get('bootVersion').hasError('required')
);
}

Expand All @@ -113,6 +116,7 @@ export class RegisterComponent implements OnInit {
type: new UntypedFormControl('', Validators.required),
uri: new UntypedFormControl('', [AppsAddValidator.appUri, Validators.required]),
metaDataUri: new UntypedFormControl('', AppsAddValidator.appUri),
bootVersion: new UntypedFormControl('', Validators.required),
force: new UntypedFormControl(false)
});

Expand Down

0 comments on commit c4e41f9

Please sign in to comment.