-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hotfix 2.21.1: fix update worker settings propagation (#3203)
* fix update worker settings Signed-off-by: artembuslaev <[email protected]> * fix Signed-off-by: artembuslaev <[email protected]> * update version Signed-off-by: simvalery <[email protected]> Signed-off-by: simvalery <[email protected]> * [skip ci] Add swagger.yaml * update settings Signed-off-by: simvalery <[email protected]> Signed-off-by: simvalery <[email protected]> * fix fint Signed-off-by: simvalery <[email protected]> Signed-off-by: simvalery <[email protected]> --------- Signed-off-by: artembuslaev <[email protected]> Signed-off-by: simvalery <[email protected]> Co-authored-by: artembuslaev <[email protected]> Co-authored-by: envision-ci-agent <[email protected]>
- Loading branch information
1 parent
e62fbf1
commit 1539a3d
Showing
27 changed files
with
141 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,8 @@ | |
}, | ||
"author": "Envision Blockchain Solutions <[email protected]>", | ||
"dependencies": { | ||
"@guardian/common": "^2.21.0", | ||
"@guardian/interfaces": "^2.21.0", | ||
"@guardian/common": "^2.21.1", | ||
"@guardian/interfaces": "^2.21.1", | ||
"@nestjs/common": "^9.4.1", | ||
"@nestjs/core": "^9.4.1", | ||
"@nestjs/jwt": "^10.0.3", | ||
|
@@ -81,5 +81,5 @@ | |
"start": "node dist/index.js", | ||
"test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/ui-service.xml" | ||
}, | ||
"version": "2.21.0" | ||
"version": "2.21.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,8 @@ | |
}, | ||
"author": "Envision Blockchain Solutions <[email protected]>", | ||
"dependencies": { | ||
"@guardian/common": "^2.21.0", | ||
"@guardian/interfaces": "^2.21.0", | ||
"@guardian/common": "^2.21.1", | ||
"@guardian/interfaces": "^2.21.1", | ||
"@nestjs/common": "^9.4.1", | ||
"@nestjs/core": "^9.4.1", | ||
"@nestjs/jwt": "^10.0.3", | ||
|
@@ -82,5 +82,5 @@ | |
"start": "node dist/index.js", | ||
"test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/ui-service.xml" | ||
}, | ||
"version": "2.21.0" | ||
"version": "2.21.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 78 additions & 48 deletions
126
frontend/src/app/views/admin/settings-view/settings-view.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,85 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { FormBuilder, Validators } from '@angular/forms'; | ||
import { Component, OnDestroy, OnInit } from '@angular/core'; | ||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; | ||
import { CommonSettings } from '@guardian/interfaces'; | ||
import { SettingsService } from 'src/app/services/settings.service'; | ||
import { Subscription } from 'rxjs' | ||
|
||
@Component({ | ||
selector: 'app-settings-view', | ||
templateUrl: './settings-view.component.html', | ||
selector: 'app-settings-view', | ||
templateUrl: './settings-view.component.html', | ||
styleUrls: ['./settings-view.component.scss'] | ||
}) | ||
export class SettingsViewComponent implements OnInit { | ||
dataForm = this.fb.group({ | ||
operatorId: ['', Validators.compose([ | ||
Validators.required, | ||
Validators.pattern(/^\d+\.\d+\.\d+$/) | ||
])], | ||
operatorKey: ['', Validators.compose([ | ||
Validators.required, | ||
Validators.minLength(5) | ||
])], | ||
ipfsStorageApiKey: ['', Validators.compose([ | ||
Validators.required, | ||
Validators.minLength(5) | ||
])] | ||
}); | ||
isLoading: boolean = true; | ||
|
||
constructor( | ||
private fb: FormBuilder, | ||
private settingsService: SettingsService) { | ||
} | ||
|
||
ngOnInit() { | ||
this.settingsService.getSettings() | ||
.subscribe((result: CommonSettings) => { | ||
this.dataForm.patchValue(result); | ||
this.isLoading = false | ||
}, (error) => { | ||
this.isLoading = true | ||
}); | ||
} | ||
|
||
onSubmit() { | ||
if (this.dataForm.valid) { | ||
this.isLoading = true; | ||
this.settingsService.updateSettings(this.dataForm.value) | ||
.subscribe(() => { | ||
this.isLoading = false; | ||
}, () => { | ||
this.isLoading = false; | ||
this.ngOnInit(); | ||
}); | ||
} | ||
} | ||
export class SettingsViewComponent implements OnInit, OnDestroy{ | ||
dataForm = this.fb.group({ | ||
operatorId: [ | ||
'', Validators.compose([ | ||
Validators.required, | ||
Validators.pattern(/^\d+\.\d+\.\d+$/) | ||
])], | ||
operatorKey: [ | ||
'', Validators.compose([ | ||
Validators.required, | ||
Validators.minLength(5) | ||
])], | ||
ipfsStorageApiKey: [ | ||
'', Validators.compose([ | ||
Validators.required, | ||
Validators.minLength(5) | ||
])] | ||
}); | ||
isLoading: boolean = true; | ||
|
||
keyAndProof = this.fb.group({ | ||
key: ['', Validators.required], | ||
proof: ['', Validators.required] | ||
}) | ||
|
||
private subscription: Subscription; | ||
|
||
constructor( | ||
private fb: FormBuilder, | ||
private settingsService: SettingsService) { | ||
this.subscription = new Subscription(); | ||
} | ||
|
||
ngOnInit() { | ||
this.subscription.add( | ||
this.settingsService.getSettings() | ||
.subscribe((result: CommonSettings) => { | ||
this.dataForm.patchValue(result); | ||
this.isLoading = false | ||
}, (error) => { | ||
this.isLoading = true | ||
}) | ||
); | ||
|
||
this.subscription.add( | ||
this.keyAndProof.valueChanges.subscribe(values => { | ||
this.dataForm.patchValue({ | ||
ipfsStorageApiKey: `${values.key};${values.proof}` | ||
}) | ||
}) | ||
); | ||
} | ||
|
||
getFormControl(formGroup: FormGroup, name: string): FormControl { | ||
return formGroup.get(name) as FormControl; | ||
} | ||
|
||
ngOnDestroy() { | ||
this.subscription.unsubscribe() | ||
} | ||
|
||
onSubmit() { | ||
if (this.dataForm.valid) { | ||
this.isLoading = true; | ||
this.settingsService.updateSettings(this.dataForm.value) | ||
.subscribe(() => { | ||
this.isLoading = false; | ||
}, () => { | ||
this.isLoading = false; | ||
this.ngOnInit(); | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.