This is an automated email from the ASF dual-hosted git repository.
dyankiv pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
The following commit(s) were added to refs/heads/develop by this push:
new 35f69b8 fixed actions for multiple instance choice
new 8315322 Merge pull request #1452 from
GennadiyShpak/fix/DATALAB-2692/actions-for-multiple-choice
35f69b8 is described below
commit 35f69b83e3fced4fc827a4fde04916217df96d4c
Author: Hennadii_Shpak <[email protected]>
AuthorDate: Fri Mar 11 11:43:35 2022 +0200
fixed actions for multiple instance choice
---
.../administration/management/management.component.html | 2 ++
.../administration/management/management.component.scss | 6 +++++-
.../administration/management/management.component.ts | 10 +++++++---
.../main/resources/webapp/src/app/core/models/index.ts | 1 +
.../app/core/models/{index.ts => statusTypes.enum.ts} | 17 +++++++++--------
5 files changed, 24 insertions(+), 12 deletions(-)
diff --git
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
index 6b88976..3b2411a 100644
---
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
+++
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.html
@@ -37,7 +37,9 @@
<button
type="button"
class="butt action-menu-item"
+ [ngClass]="{'disabled': !selectedStopped }"
mat-raised-button
+ [disabled]="!selectedStopped"
(click)="resourseAction('start');$event.stopPropagation()"
>
Run
diff --git
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.scss
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.scss
index f834e82..aae1b45 100644
---
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.scss
+++
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.scss
@@ -40,6 +40,10 @@
.action-menu-item:disabled {
color: rgba(180, 179, 179, 0.87) !important;
- background-color: rgb(224, 224, 224);
+ background-color: white;
opacity: 1;
+}
+
+.action-menu {
+ z-index: 999;
}
\ No newline at end of file
diff --git
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
index 339d7d0..00c8d96 100644
---
a/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
+++
b/services/self-service/src/main/resources/webapp/src/app/administration/management/management.component.ts
@@ -42,6 +42,7 @@ import { ProjectService } from '../../core/services';
import { ConfirmationDialogComponent, ConfirmationDialogType } from
'../../shared/modal-dialog/confirmation-dialog';
import { ManagementGridComponent, ReconfirmationDialogComponent } from
'./management-grid/management-grid.component';
import { FolderTreeComponent } from
'../../resources/bucket-browser/folder-tree/folder-tree.component';
+import { StatusTypes } from '../../core/models';
@Component({
selector: 'environments-management',
@@ -56,6 +57,8 @@ export class ManagementComponent implements OnInit {
public selected: any[] = [];
public isActionsOpen: boolean = false;
public selectedRunning: boolean;
+ public selectedStopped: boolean;
+ public resourseStaus = StatusTypes;
@ViewChild(ManagementGridComponent, { static: true }) managementGrid;
@@ -214,7 +217,8 @@ export class ManagementComponent implements OnInit {
this.isActionsOpen = false;
}
- this.selectedRunning = this.selected.every(item => item.status ===
'running');
+ this.selectedRunning = this.selected.every(item => item.status ===
this.resourseStaus.running);
+ this.selectedStopped = this.selected.every(item => item.status ===
this.resourseStaus.stopped);
}
public toogleActions() {
@@ -293,11 +297,11 @@ export class ManagementComponent implements OnInit {
private getModalConfig(config: ModalData, action: ActionsType, notebooks:
EnvironmentModel[]): ModalData {
config = {...config, type: ModalDataType.notebook}
if(action === ActionsType.stop) {
- notebooks = notebooks.filter(note => note.status !== 'stopped');
+ notebooks = notebooks.filter(note => note.status !==
this.resourseStaus.stopped);
return {...config, notebooks}
}
if(action === ActionsType.start) {
- notebooks = notebooks.filter(note => note.status === 'stopped');
+ notebooks = notebooks.filter(note => note.status ===
this.resourseStaus.stopped);
return {...config, notebooks}
}
return {...config, notebooks}
diff --git
a/services/self-service/src/main/resources/webapp/src/app/core/models/index.ts
b/services/self-service/src/main/resources/webapp/src/app/core/models/index.ts
index 9ab3bc6..1c33095 100644
---
a/services/self-service/src/main/resources/webapp/src/app/core/models/index.ts
+++
b/services/self-service/src/main/resources/webapp/src/app/core/models/index.ts
@@ -24,4 +24,5 @@ export * from './computationalResourceImage.model';
export * from './computationalResourceApplicationTemplate.model';
export * from './computationalResourceApplication.model';
export * from './imageType.enum';
+export * from './statusTypes.enum';
diff --git
a/services/self-service/src/main/resources/webapp/src/app/core/models/index.ts
b/services/self-service/src/main/resources/webapp/src/app/core/models/statusTypes.enum.ts
similarity index 69%
copy from
services/self-service/src/main/resources/webapp/src/app/core/models/index.ts
copy to
services/self-service/src/main/resources/webapp/src/app/core/models/statusTypes.enum.ts
index 9ab3bc6..e0849e7 100644
---
a/services/self-service/src/main/resources/webapp/src/app/core/models/index.ts
+++
b/services/self-service/src/main/resources/webapp/src/app/core/models/statusTypes.enum.ts
@@ -17,11 +17,12 @@
* under the License.
*/
-export * from './resourceShapeTypes.model';
-export * from './resourceShape.model';
-export * from './exploratoryEnvironmentVersion.model';
-export * from './computationalResourceImage.model';
-export * from './computationalResourceApplicationTemplate.model';
-export * from './computationalResourceApplication.model';
-export * from './imageType.enum';
-
+export enum StatusTypes {
+ creating = 'creating',
+ running = 'running',
+ stopping = 'stopping',
+ stopped = 'stopped',
+ terminating = 'terminating',
+ terminated = 'terminated',
+ failed = 'failed'
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]