Skip to content

Commit

Permalink
Merge branch 'develop' into 151-the-remove-bulk-domain-deployment-opt…
Browse files Browse the repository at this point in the history
…ion-does-not-work
  • Loading branch information
pgiertych committed Mar 12, 2024
2 parents 9baf6c4 + 62c4806 commit 8fcba71
Show file tree
Hide file tree
Showing 13 changed files with 142 additions and 41 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/02-build-docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
name: Build docker image with tag latest
name: Build docker image with appropriate tag

on:
push:
branches:
- develop
release:
types: [released]

jobs:
build_docker_image:
runs-on: ubuntu-22.04
steps:
- name: Determine Docker Tag
id: docker_tag
run: |
GIT_EVENT=${{ github.event_name }}
GIT_BRANCH_NAME=${GITHUB_REF##*/}
if [[ $GIT_EVENT == 'push' && $GIT_BRANCH_NAME == 'develop' ]]; then
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
elif [[ $GIT_EVENT == 'release' ]]; then
GIT_TAG_NAME=${{ github.event.release.tag_name }}
echo "DOCKER_TAG=$(echo $GIT_TAG_NAME | cut -c 2-)" >> $GITHUB_ENV
fi
- name: Checkout code
uses: actions/checkout@v4

Expand All @@ -26,6 +40,7 @@ jobs:
- name: Build image and push to Artifactory
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: |
${{ secrets.DOCKER_REPOSITORY_LOCAL }}:latest
${{ secrets.DOCKER_REPOSITORY_LOCAL }}:${{ env.DOCKER_TAG }}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
id "org.sonarqube" version "3.2.0"
}

version = '1.6.0-SNAPSHOT'
version = '1.6.0'

task buildGUI(type: Exec) {
println 'Building using Angular CLI'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ <h3>{{'BULK.APP.VIEW_HEADER' | translate}}</h3>
<td>{{getAppInstanceName(response)}}</td>
<td>{{getDomainCodeName(response)}}</td>
<td style="width: 5%" class="text-right">
<span *ngif="response?.details['appInstanceId'] !==null" class="dropdown">
<span *ngif="response.type === 'APPLICATION' && response?.details['appInstanceId'] !== undefined" class="dropdown">
<a style="display: inline-block" class="dropdown-toggle " aria-expanded="false" aria-haspopup="true"
data-toggle="dropdown" href="#" role="button">
<em class="fas fa-cog icon-black icon-bigger"></em>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Component, OnDestroy, OnInit} from '@angular/core';
import {BulkDeployment} from '../../../model/bulk-deployment';
import {BulkDeployment, BulkDeploymentState} from '../../../model/bulk-deployment';
import {AppdeploymentService} from '../appdeployment.service';
import {ActivatedRoute, Router} from '@angular/router';
import {BulkResponse, BulkType} from '../../../model/bulk-response';
Expand Down Expand Up @@ -55,6 +55,10 @@ export class BulkViewComponent implements OnInit, OnDestroy {
return entry?.details['appInstanceId']
}

public iSWorkingInstance(entry: BulkResponse) {
return entry?.state === BulkDeploymentState.COMPLETED || entry?.state.toString() == 'COMPLETED'
}

public getAppInstanceName(entry: BulkResponse) {
return entry?.details['appInstanceName']
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,10 @@ export class DomainAnnotationsComponent implements OnInit {

public handleAnnotationsUpdate(event: any ) {
console.warn(event)

this.domainService.addAnnotations(event).subscribe(_ => {
this.annotations = this.domainService.getAnnotations();
})
}

public handleDelete(key: string) {
console.warn("trigger delete for", key);

this.domainService.deleteAnnotation(key).subscribe(_ => {
this.annotations = this.domainService.getAnnotations();
})
}

}
2 changes: 1 addition & 1 deletion src/app/appmarket/domains/domain/domain.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ <h3>{{ 'DOMAIN_DETAILS.TITLE' | translate }}</h3>


<div *ngIf="isInMode(ComponentMode.CREATE)" >
<app-domain-namespace-annotations [annotationRead]="annotations" (annotations)="handleAnnotationsChange($event)"></app-domain-namespace-annotations>
<app-domain-namespace-annotations [annotationRead]="annotations" (annotations)="handleAnnotationsChange($event)" (trigerDelete)="handleAnnotationDelete($event)"></app-domain-namespace-annotations>
</div>

<div *ngIf="isInMode(ComponentMode.VIEW)" class="panel panel-default">
Expand Down
10 changes: 8 additions & 2 deletions src/app/appmarket/domains/domain/domain.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {CustomerNetwork} from '../../../model/customernetwork';
import {MinLengthDirective} from '../../../directive/min-length.directive';
import {MaxLengthDirective} from '../../../directive/max-length.directive';
import { KeyValue } from '../../../model/key-value';
import { DomainAnnotation } from '../../../model/domain-annotation';


@Component({
Expand Down Expand Up @@ -46,7 +47,7 @@ export class DomainComponent extends BaseComponent implements OnInit {

public displayCustomerNetworksSection = false;

public annotations : Observable<KeyValue[]> = of([]);
public annotations : Observable<DomainAnnotation[]> = of([]);

constructor(public domainService: DomainService,
protected userService: UserService,
Expand Down Expand Up @@ -171,10 +172,15 @@ export class DomainComponent extends BaseComponent implements OnInit {
this.domain.domainDcnDetails.customerNetworks.push(new CustomerNetwork());
}

public handleAnnotationsChange(event: KeyValue[]){
public handleAnnotationsChange(event: DomainAnnotation[]){
this.domain.annotations = event;
console.log("Updated domain annotations", this.domain.annotations)

}

public handleAnnotationDelete(event : number) {
this.domain.annotations = this.domain.annotations.filter(val => val.id !== event)
console.log("Updated domain annotations", this.domain.annotations)
}

}
5 changes: 5 additions & 0 deletions src/app/model/domain-annotation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export class DomainAnnotation {
public id: number;
public key : string;
public value : string;
}
3 changes: 2 additions & 1 deletion src/app/model/domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {DomainTechDetails} from './domaintechdetails';
import {DomainApplicationStatePerDomain} from './domainapplicationstateperdomain';
import {DomainGroup} from './domaingroup';
import {KeyValue} from './key-value';
import { DomainAnnotation } from './domain-annotation';

export class Domain {
public id: number = undefined;
Expand All @@ -14,5 +15,5 @@ export class Domain {
public applicationStatePerDomain: DomainApplicationStatePerDomain[] = [];
public groups: DomainGroup[] = [];
public deleted: boolean;
public annotations: KeyValue[] = [];
public annotations: DomainAnnotation[] = [];
}
17 changes: 11 additions & 6 deletions src/app/service/domain.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {Domain} from '../model/domain';
import {User} from '../model';
import {DomainGroup} from '../model/domaingroup';
import { KeyValue } from '../model/key-value';
import { DomainAnnotation } from '../model/domain-annotation';

@Injectable({
providedIn: 'root',
Expand Down Expand Up @@ -115,15 +116,19 @@ export class DomainService extends GenericDataService {
return this.put(this.url + 'group/' + id, domainGroup);
}

public getAnnotations(): Observable<KeyValue[]> {
return this.get<KeyValue[]>(this.url + 'annotations')
public getAnnotations(): Observable<DomainAnnotation[]> {
return this.get<DomainAnnotation[]>(this.url + 'annotations')
}

public addAnnotations(annotations: KeyValue[]): Observable<void> {
return this.post(this.url + 'annotations', annotations)
public addAnnotations(annotation: KeyValue): Observable<void> {
return this.post(this.url + 'annotations', annotation)
}

public deleteAnnotation(key: string) : Observable<void>{
return this.delete(`${this.url}annotations/${key}`,)
public deleteAnnotation(id: number) : Observable<void>{
return this.delete(`${this.url}annotations/${id}`)
}

public updateAnnotation(annotation: DomainAnnotation): Observable<void> {
return this.put(`${this.url}annotations/${annotation.id}`, annotation)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
<div class="grid flex flex-grow-1 mt-4 mb-2" *ngFor="let kv of keyValue">
<div class="flex grid flex-grow-1">
<div class="col-4">
<input pInputText type="text" [disabled]="getReadOnlyValue(kv.key)" (focusout)="emmitValue(kv.key)" [(ngModel)]="kv.key" class="flex flex-grow-1" style="width: 100%" [ngClass]="{ 'border-red': isKeyNotUnique(kv.key)}">
<input pInputText type="text" (focusout)="emmitValue(kv)" [(ngModel)]="kv.key" class="flex flex-grow-1" style="width: 100%" [ngClass]="{ 'border-red': isKeyNotUnique(kv.key)}">
</div>
<div class="col-6">
<input pInputText type="text" (focusout)="emmitValue()" [(ngModel)]="kv.value" class="flex flex-grow-1" style="width: 100%">
<input pInputText type="text" (focusout)="emmitValue(kv)" [(ngModel)]="kv.value" class="flex flex-grow-1" style="width: 100%">
</div>
<div class="col-2 flex justify-content-end">
<button type="button" class="btn btn-danger" (click)="deleteAnnotation(kv.key)">Delete</button>
<button type="button" class="btn btn-danger" (click)="deleteAnnotation(kv.id)">Delete</button>
</div>
</div>
</div>
Expand All @@ -37,11 +37,31 @@


<nmaas-modal>
<div class="nmaas-modal-header">{{'DOMAINS.LIST.GROUP' | translate}}</div>
<div class="nmaas-modal-body" style="height: 300px">
<div class="nmaas-modal-header">{{'DOMAINS.ANNOTATIONS.ADD' | translate}}</div>
<div class="nmaas-modal-body" style="height: 200px">

<div class="grid flex flex-grow-1">
<div class="col-4">
{{'DOMAINS.ANNOTATIONS.KEY' | translate}}
</div>
<div class="col-6">
{{'DOMAINS.ANNOTATIONS.VALUE' | translate}}
</div>
</div>

<div class="flex grid flex-grow-1">
<div class="col-4">
<input pInputText type="text" [(ngModel)]="newAnnotations.key" class="flex flex-grow-1" style="width: 100%" [ngClass]="{ 'border-red': isKeyNotUniqueAdd(newAnnotations.key)}">
</div>
<div class="col-6">
<input pInputText type="text" [(ngModel)]="newAnnotations.value" class="flex flex-grow-1" style="width: 100%">
</div>
</div>


</div>
<div class="nmaas-modal-footer">

<button type="button" class="btn btn-default" (click)="modal.hide()">{{'APP_CHANGE_STATE_MODAL.CANCEL_BUTTON' | translate}}</button>
<button type="button" class="btn btn-primary" (click)="closeModal()" [disabled]="isKeyNotUniqueAdd(newAnnotations.key)">{{'SHARED.ADD' | translate}}</button>
</div>
</nmaas-modal>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';

import { DomainNamespaceAnnotationsComponent } from './domain-namespace-annotations.component';
import {TranslateFakeLoader, TranslateLoader, TranslateModule} from '@ngx-translate/core';
import { HttpClientTestingModule } from '@angular/common/http/testing';

describe('DomainNamespaceAnnotationsComponent', () => {
let component: DomainNamespaceAnnotationsComponent;
Expand All @@ -11,6 +12,7 @@ describe('DomainNamespaceAnnotationsComponent', () => {
await TestBed.configureTestingModule({
declarations: [ DomainNamespaceAnnotationsComponent ],
imports: [
HttpClientTestingModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
Expand Down
Loading

0 comments on commit 8fcba71

Please sign in to comment.