You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by an...@apache.org on 2019/09/11 12:49:43 UTC

[incubator-dlab] branch DLAB-1079 created (now 6d72270)

This is an automated email from the ASF dual-hosted git repository.

ankovalyshyn pushed a change to branch DLAB-1079
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git.


      at 6d72270  [DLAB-1079]: added key generation on project creation

This branch includes the following new commits:

     new 6d72270  [DLAB-1079]: added key generation on project creation

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org


[incubator-dlab] 01/01: [DLAB-1079]: added key generation on project creation

Posted by an...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ankovalyshyn pushed a commit to branch DLAB-1079
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit 6d7227023ea70221ce5e2975493924de0dcdf545
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Wed Sep 11 15:49:33 2019 +0300

    [DLAB-1079]: added key generation on project creation
---
 .../project/project-form/project-form.component.html        |  4 ++++
 .../project/project-form/project-form.component.scss        |  7 +++++++
 .../project/project-form/project-form.component.ts          | 13 +++++++++++--
 .../src/main/resources/webapp/src/app/core/core.module.ts   |  4 +++-
 4 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.html b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.html
index 77f747c..c392b77 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.html
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.html
@@ -40,6 +40,10 @@
                 <span class="upload-icon"></span> Upload
                 <input (change)="onFileChange($event)" type="file" name="file" accept=".pub" />
               </span>
+              <button mat-raised-button type="button" class="butt butt-generate" [ngClass]="{ 'not-allowed' : item }"
+                (click)="generateUserAccessKey()">
+                <i class="material-icons">move_to_inbox</i> Generate
+              </button>
 
               <div *ngIf="keyLabel" class="m-bott-10 m-top-10 ellipsis" [class.danger_color]="!accessKeyValid">
                 {{ keyLabel }}</div>
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.scss b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.scss
index 1208874..47447a7 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.scss
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.scss
@@ -28,6 +28,13 @@
 
       &.action {
         width: 40%;
+        position: relative;
+
+        .ellipsis {
+          position: absolute;
+          width: 100%;
+          right: 0;
+        }
       }
     }
   }
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
index 5d38b00..4b3409e 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/project/project-form/project-form.component.ts
@@ -22,9 +22,9 @@ import { FormGroup, FormBuilder, Validators } from '@angular/forms';
 import { ToastrService } from 'ngx-toastr';
 import { Subscription } from 'rxjs';
 
-import { ProjectService, RolesGroupsService, EndpointService } from '../../../core/services';
+import { ProjectService, RolesGroupsService, EndpointService, UserAccessKeyService } from '../../../core/services';
 import { ProjectDataService } from '../project-data.service';
-import { CheckUtils, PATTERNS } from '../../../core/util';
+import { CheckUtils, FileUtils, PATTERNS } from '../../../core/util';
 import { Project } from '../project.component';
 import { DICTIONARY } from '../../../../dictionary/global.dictionary';
 
@@ -57,6 +57,7 @@ export class ProjectFormComponent implements OnInit {
     private projectDataService: ProjectDataService,
     private rolesService: RolesGroupsService,
     private endpointService: EndpointService,
+    private userAccessKeyService: UserAccessKeyService,
     private cd: ChangeDetectorRef
   ) { }
 
@@ -120,6 +121,14 @@ export class ProjectFormComponent implements OnInit {
     }
   }
 
+  public generateUserAccessKey() {
+    this.userAccessKeyService.generateAccessKey().subscribe(data => {
+      FileUtils.downloadFile(data);
+      this.keyLabel = 'Key is generated';
+      this.accessKeyValid = true;
+    });
+  }
+
   public selectOptions(list, key, select?) {
     let filter = key === 'endpoints' ? list.map(el => el.name) : list;
     this.projectForm.controls[key].setValue(select ? filter : []);
diff --git a/services/self-service/src/main/resources/webapp/src/app/core/core.module.ts b/services/self-service/src/main/resources/webapp/src/app/core/core.module.ts
index e182467..3173e94 100644
--- a/services/self-service/src/main/resources/webapp/src/app/core/core.module.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/core/core.module.ts
@@ -39,6 +39,7 @@ import { DataengineConfigurationService } from './services/dataengineConfigurati
 import { StorageService } from './services/storage.service';
 import { ProjectService } from './services/project.service';
 import { EndpointService } from './services/endpoint.service';
+import { UserAccessKeyService } from './services/userAccessKey.service';
 
 import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
 
@@ -75,6 +76,7 @@ export class CoreModule {
         StorageService,
         ProjectService,
         EndpointService,
+        UserAccessKeyService,
 
         { provide: MatDialogRef, useValue: {} },
         { provide: MAT_DIALOG_DATA, useValue: [] }
@@ -82,7 +84,7 @@ export class CoreModule {
     };
   }
 
-  constructor (@Optional() @SkipSelf() parentModule: CoreModule) {
+  constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
     if (parentModule)
       throw new Error('CoreModule is already loaded. Import it in the AppModule only');
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org