-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add Cluster List Constraints to Dashboard #57
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sachinsingh2002 thanks a lot for your PR.
I see lot of compile time errors:
Build at: 2024-08-29T10:48:06.339Z - Hash: a41bfac6329bc32f - Time: 1899ms
Error: src/app/control/service-dashboard/service-dashboard.component.html:33:38 - error TS2339: Property 'deployAllServices' does not exist on type 'ServiceDashboardComponent'.
33 <button (click)="deployAllServices()" nbButton type="button" color="primary">
~~~~~~~~~~~~~~~~~
src/app/control/service-dashboard/service-dashboard.component.ts:19:18
19 templateUrl: './service-dashboard.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component ServiceDashboardComponent.
Error: src/app/control/service-dashboard/service-dashboard.component.ts:65:32 - error TS2551: Property 'selectedItems' does not exist on type 'ServiceDashboardComponent'. Did you mean 'selectedItem'?
65 this.nodeDisabled = this.selectedItems.length > 1;
~~~~~~~~~~~~~
src/app/control/service-dashboard/service-dashboard.component.ts:32:5
32 selectedItem: IApplication[] = [];
~~~~~~~~~~~~
'selectedItem' is declared here.
Error: src/app/control/service-dashboard/service-dashboard.component.ts:66:18 - error TS2551: Property 'selectedItems' does not exist on type 'ServiceDashboardComponent'. Did you mean 'selectedItem'?
66 if (this.selectedItems.length === 1) {
~~~~~~~~~~~~~
src/app/control/service-dashboard/service-dashboard.component.ts:32:5
32 selectedItem: IApplication[] = [];
~~~~~~~~~~~~
'selectedItem' is declared here.
Error: src/app/control/service-dashboard/service-dashboard.component.ts:67:71 - error TS2551: Property 'selectedItems' does not exist on type 'ServiceDashboardComponent'. Did you mean 'selectedItem'?
67 this.store.dispatch(setCurrentApplication({ application: this.selectedItems[0] }));
~~~~~~~~~~~~~
src/app/control/service-dashboard/service-dashboard.component.ts:32:5
32 selectedItem: IApplication[] = [];
~~~~~~~~~~~~
'selectedItem' is declared here.
Error: src/app/control/service-dashboard/service-dashboard.component.ts:68:27 - error TS2551: Property 'selectedItems' does not exist on type 'ServiceDashboardComponent'. Did you mean 'selectedItem'?
68 this.appId = this.selectedItems[0]._id.$oid;
~~~~~~~~~~~~~
src/app/control/service-dashboard/service-dashboard.component.ts:32:5
32 selectedItem: IApplication[] = [];
~~~~~~~~~~~~
'selectedItem' is declared here.
Error: src/app/control/service-dashboard/service-dashboard.component.ts:71:5 - error TS2304: Cannot find name 'deployService'.
71 deployService(service: IService) {
~~~~~~~~~~~~~
Error: src/app/control/service-dashboard/service-dashboard.component.ts:71:19 - error TS2304: Cannot find name 'service'.
71 deployService(service: IService) {
~~~~~~~
Error: src/app/control/service-dashboard/service-dashboard.component.ts:71:26 - error TS1005: ',' expected.
71 deployService(service: IService) {
~
Error: src/app/control/service-dashboard/service-dashboard.component.ts:71:28 - error TS2693: 'IService' only refers to a type, but is being used as a value here.
71 deployService(service: IService) {
~~~~~~~~
Error: src/app/control/service-dashboard/service-dashboard.component.ts:71:38 - error TS1005: ';' expected.
71 deployService(service: IService) {
~
Error: src/app/control/service-dashboard/service-dashboard.component.ts:74:28 - error TS2304: Cannot find name 'service'.
74 .deployService(service)
~~~~~~~
Error: src/app/control/service-dashboard/service-dashboard.component.ts:77:30 - error TS2551: Property 'selectedItems' does not exist on type 'ServiceDashboardComponent'. Did you mean 'selectedItem'?
77 if (this.selectedItems[0]._id.$oid !== '') {
~~~~~~~~~~~~~
src/app/control/service-dashboard/service-dashboard.component.ts:32:5
32 selectedItem: IApplication[] = [];
~~~~~~~~~~~~
'selectedItem' is declared here.
Error: src/app/control/service-dashboard/service-dashboard.component.ts:80:75 - error TS2551: Property 'selectedItems' does not exist on type 'ServiceDashboardComponent'. Did you mean 'selectedItem'?
80 this.store.dispatch(getServices({ appId: this.selectedItems[0]._id.$oid }));
~~~~~~~~~~~~~
src/app/control/service-dashboard/service-dashboard.component.ts:32:5
32 selectedItem: IApplication[] = [];
~~~~~~~~~~~~
'selectedItem' is declared here.
Error: src/app/control/service-dashboard/service-dashboard.component.ts:88:5 - error TS2304: Cannot find name 'deployAllServices'.
88 deployAllServices() {
~~~~~~~~~~~~~~~~~
Error: src/app/control/service-dashboard/service-dashboard.component.ts:88:25 - error TS1005: ';' expected.
88 deployAllServices() {
~
Error: src/app/control/service-dashboard/service-dashboard.component.ts:91:22 - error TS2339: Property 'deployService' does not exist on type 'ServiceDashboardComponent'.
91 this.deployService(service);
~~~~~~~~~~~~~
Error: src/app/control/service-dashboard/service-dashboard.component.ts:96:1 - error TS1005: '}' expected.
96
✖ Failed to compile.
Moreover to fix this issue I can recommend looking directly at the Cluster constraint component here
As you can see this currently has a dropdown where you can only choose a single cluster from the list of available ones.
This can be edited in such a way what when the cluster is selected, a list of selected cluster shows up and you can keep selecting clusters from the dropdown.
E.g.,
Selected clusters: cluster1, cluster2
Add Cluster: (dropdown menu)
The logic:
- constraint type name from direct_ to
clusters_
if more than one cluster selected - to match the expected structure from backend, if more than one cluster selected, the form instead of having cluster and
node
should only contain aallowed
list. Refer to #343 for details - add
clusters
case in getConstraintName()
This should be all I think. Let me know if you need further help!
Hi @Sachinsingh2002, thanks for your latest commits! 😀 |
i have made the necessary changes please review it. Fixes #56