Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UI API usage for Boot 3 updates #1929

Merged
merged 30 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f62b164
Update app service API url with boot version parameter
claudiahub Jun 30, 2023
6cd8df9
Added boot version combo field on register applications form
claudiahub Jun 30, 2023
1014592
Up translations
claudiahub Jul 1, 2023
c4e41f9
Form
oodamien Jul 3, 2023
1b9c043
Update
oodamien Jul 3, 2023
89218ca
Update
oodamien Jul 4, 2023
95e6f4e
Fix tests
oodamien Jul 4, 2023
032f67f
Added SchemaTarget support for task and job executions.
corneil Jul 14, 2023
050194f
Fixed parameters for put/post
corneil Jul 17, 2023
1e04d1f
Improve check for platform name.
corneil Jul 17, 2023
37a88ab
Added translations
claudiahub Jul 17, 2023
562fdd9
Fixed tasks / jobs spec tests
claudiahub Jul 17, 2023
81b3348
Fixed linting
claudiahub Jul 17, 2023
27efd0f
Enable getExecution method on task service
claudiahub Jul 18, 2023
e6a8f94
Enable getExecutionById from task mock
claudiahub Jul 18, 2023
b6484b1
Solved nav router attr for streams
claudiahub Jul 18, 2023
650d162
Fixed default task executions url parameters values
claudiahub Jul 18, 2023
5349def
Solved job service spec tests
claudiahub Jul 18, 2023
3146f93
Solve task service spec tests
claudiahub Jul 18, 2023
de8073e
Polish (lint)
claudiahub Jul 19, 2023
f00f78d
Fixed routerlink attr
claudiahub Jul 21, 2023
7c5652e
Polish
claudiahub Jul 21, 2023
d31487e
Enable schemaTarget label on task execution panel
claudiahub Jul 21, 2023
c93dc77
Enable schemaTarget label on step component
claudiahub Jul 21, 2023
d15277a
Solved job executions label translation directive
claudiahub Jul 21, 2023
3b8f408
Added schemaTarget label on job execution step component
claudiahub Jul 21, 2023
41520d1
Up schemaTarget from task execution object
claudiahub Jul 21, 2023
05e2b4a
Up schemaTarget read
claudiahub Jul 21, 2023
e955411
Added schemaTarget on task execution details panel
claudiahub Jul 21, 2023
c273387
Up
oodamien Jul 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dataflow-ui</artifactId>
<version>3.3.4-SNAPSHOT</version>
<version>3.4.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Spring Cloud Data Flow User Interface</name>
<description>This application provides the Dashboard application of Spring Cloud Data Flow.</description>
Expand Down Expand Up @@ -36,6 +36,16 @@
<role>Project lead</role>
</roles>
</developer>
<developer>
<id>corneil</id>
<name>Corneil du Plessis</name>
<email>pcorneil at vmware.com</email>
<organization>VMware, Inc.</organization>
<organizationUrl>https://www.spring.io</organizationUrl>
<roles>
<role>Project lead</role>
</roles>
</developer>
<developer>
<id>ilayaperumalg</id>
<name>Ilayaperumal Gopinathan</name>
Expand Down
175 changes: 90 additions & 85 deletions ui/proxy.conf.json
Original file line number Diff line number Diff line change
@@ -1,87 +1,92 @@
{
"/about" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/audit-records" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/authenticate" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/apps" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/dashboard/logout" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/jobs" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/oauth2" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/login" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/logout" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/metrics" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/security/info" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/streams" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/tasks" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/tools" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/runtime" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/completions" : {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/websocket": {
"target": "http://localhost:9393",
"ws": true,
"logLevel": "debug"
}
"/about": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/audit-records": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/authenticate": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/apps": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/dashboard/logout": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/jobs": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/oauth2": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/login": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/logout": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/metrics": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/security/info": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/streams": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/tasks": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/tools": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/runtime": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/completions": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
},
"/websocket": {
"target": "http://localhost:9393",
"ws": true,
"logLevel": "debug"
},
"/schema": {
"target": "http://localhost:9393/",
"secure": false,
"logLevel": "debug"
}
}
4 changes: 3 additions & 1 deletion ui/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import {TranslateLoader, TranslateModule} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
import {AppsModule} from './apps/apps.module';
import {UrlUtilities} from './url-utilities.service';
import {TaskService} from './shared/api/task.service';
import {JobService} from './shared/api/job.service';

@NgModule({
declarations: [AppComponent],
Expand Down Expand Up @@ -93,7 +95,7 @@ import {UrlUtilities} from './url-utilities.service';
)
.pipe(switchMap(() => settingsService.load(['en', 'de', 'ru'])))
.toPromise(),
deps: [SecurityService, AboutService, SettingsService],
deps: [SecurityService, AboutService, SettingsService, TaskService, JobService],
multi: true
}
],
Expand Down
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;
}
}
26 changes: 26 additions & 0 deletions ui/src/app/apps/add/register/register.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,32 @@
</div>
</div>
</div>
<div
class="clr-form-control clr-row"
[class.clr-error]="submitted && form.get('bootVersion').invalid && !isFormEmpty(form)"
>
<label class="clr-col-2 clr-control-label" for="type{{ i }}">{{
'applications.main.bootVersion' | translate
}}</label>
<div class="clr-control-container clr-col-10" *ngIf="bootVersions">
<div class="clr-select-wrapper">
<select
name="bootVersion{{ i }}"
id="bootVersion{{ i }}"
formControlName="bootVersion"
class="clr-select"
>
<option *ngFor="let bootVersionKey of bootVersions" value="{{ bootVersionKey }}">
Spring Boot&nbsp;
{{ 'applications.main.bootVersions.' + bootVersionKey | translate }}
</option>
</select>
</div>
<div class="clr-subtext" *ngIf="submitted && form.get('type').invalid && !isFormEmpty(form)">
{{ 'applications.add.register.invalidType' | translate }}
</div>
</div>
</div>
<div
class="clr-form-control clr-row"
[class.clr-error]="submitted && form.get('uri').invalid && !isFormEmpty(form)"
Expand Down
25 changes: 18 additions & 7 deletions ui/src/app/apps/add/register/register.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,24 @@ describe('apps/register/register.component.ts', () => {
const navigate = spyOn((<any>component).router, 'navigateByUrl');
fixture.detectChanges();
const tests = [
{name: 'foobar1', type: 'source', uri: 'https://foo.bar', metaDataUri: '', force: false},
{name: '', type: '', uri: '', metaDataUri: '', force: false},
{name: '', type: '', uri: '', metaDataUri: '', force: false}
{name: 'foobar1', type: 'source', uri: 'https://foo.bar', metaDataUri: '', bootVersion: '3', force: false},
{name: '', type: '', uri: '', metaDataUri: '', bootVersion: '2', force: false},
{name: '', type: '', uri: '', metaDataUri: '', bootVersion: '2', force: false}
];
component.newForm();
component.newForm();
tests.forEach((test, index) => {
component.forms[index].get('name').setValue(test.name);
component.forms[index].get('type').setValue(test.type);
component.forms[index].get('uri').setValue(test.uri);
component.forms[index].get('bootVersion').setValue(test.bootVersion);
component.forms[index].get('metaDataUri').setValue(test.metaDataUri);
component.forms[index].get('force').setValue(test.force);
});
fixture.detectChanges();
fixture.debugElement.query(By.css('button[name=register]')).nativeElement.click();
fixture.detectChanges();

expect(component.isValid()).toBeTruthy();
expect(component.noValue()).toBeFalsy();
expect(NotificationServiceMock.mock.successNotifications[0].title).toContain('Register application(s).');
Expand All @@ -106,16 +108,17 @@ describe('apps/register/register.component.ts', () => {
it('should display errors form', () => {
fixture.detectChanges();
const tests = [
{name: 'foobar1', type: 'source', uri: 'https://foo.bar', metaDataUri: '', force: false},
{name: 'foobar2', type: 'sink', uri: 'https://foo.bar', metaDataUri: '', force: false},
{name: 'foobar3', type: 'processor', uri: '', metaDataUri: '', force: false}
{name: 'foobar1', type: 'source', uri: 'https://foo.bar', metaDataUri: '', bootVersion: '3', force: false},
{name: 'foobar2', type: 'sink', uri: 'https://foo.bar', metaDataUri: '', bootVersion: '2', force: false},
{name: 'foobar3', type: 'processor', uri: '', metaDataUri: '', bootVersion: '3', force: false}
];
component.newForm();
component.newForm();
tests.forEach((test, index) => {
component.forms[index].get('name').setValue(test.name);
component.forms[index].get('type').setValue(test.type);
component.forms[index].get('uri').setValue(test.uri);
component.forms[index].get('bootVersion').setValue(test.bootVersion);
component.forms[index].get('metaDataUri').setValue(test.metaDataUri);
component.forms[index].get('force').setValue(test.force);
});
Expand All @@ -129,10 +132,18 @@ describe('apps/register/register.component.ts', () => {
it('should handle error on run', () => {
spyOn(AppServiceMock.mock, 'registerProps').and.callFake(() => throwError(new Error('Fake error')));
fixture.detectChanges();
const test = {name: 'foobar1', type: 'source', uri: 'https://foo.bar', metaDataUri: '', force: false};
const test = {
name: 'foobar1',
type: 'source',
uri: 'https://foo.bar',
metaDataUri: '',
bootVersion: '3',
force: false
};
component.forms[0].get('name').setValue(test.name);
component.forms[0].get('type').setValue(test.type);
component.forms[0].get('uri').setValue(test.uri);
component.forms[0].get('bootVersion').setValue(test.bootVersion);
component.forms[0].get('metaDataUri').setValue(test.metaDataUri);
component.forms[0].get('force').setValue(test.force);
fixture.detectChanges();
Expand Down
13 changes: 11 additions & 2 deletions ui/src/app/apps/add/register/register.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import {TranslateService} from '@ngx-translate/core';
export class RegisterComponent implements OnInit {
forms: UntypedFormGroup[] = [];
applicationTypes = ApplicationType;
bootVersions: Array<string>;
defaultBoot: string;
submitted = false;
isImporting = false;

Expand All @@ -26,7 +28,11 @@ export class RegisterComponent implements OnInit {
) {}

ngOnInit(): void {
this.newForm();
this.appService.getBootVersions().subscribe((data: any) => {
this.bootVersions = data.versions;
this.defaultBoot = data.defaultSchemaVersion;
this.newForm();
});
}

register(): void {
Expand All @@ -53,6 +59,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 +109,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').value === this.defaultBoot
);
}

Expand All @@ -113,6 +121,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(this.defaultBoot, Validators.required),
force: new UntypedFormControl(false)
});

Expand Down
Loading
Loading