Skip to content
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

Feat/add microservices #47

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"OneCX Development Team <[email protected]>"
],
"config": {
"openapiYaml": "src/assets/api/product-store-bff-api.yaml",
"openapiYaml": "src/assets/api/openapi-bff.yaml",
"openapiOutput": "src/app/shared/generated"
},
"scripts": {
Expand Down Expand Up @@ -49,11 +49,11 @@
"@ngneat/falso": "^6.4.0",
"@ngx-translate/core": "^14.0.0",
"@ngx-translate/http-loader": "^7.0.0",
"@onecx/accelerator": "^4.1.2",
"@onecx/integration-interface": "^4.1.2",
"@onecx/keycloak-auth": "^4.1.2",
"@onecx/portal-integration-angular": "^4.1.2",
"@onecx/portal-layout-styles": "^4.1.2",
"@onecx/accelerator": "^4.5.1",
"@onecx/integration-interface": "^4.5.1",
"@onecx/keycloak-auth": "^4.5.1",
"@onecx/portal-integration-angular": "^4.5.1",
"@onecx/portal-layout-styles": "^4.5.1",
"file-saver": "^2.0.5",
"i18n-iso-countries": "^7.6.0",
"ngx-color": "^8.0.3",
Expand Down
6 changes: 3 additions & 3 deletions src/app/product-store/app-delete/app-delete.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p-dialog
[(visible)]="displayDialog"
[header]="'ACTIONS.DELETE.APP.HEADER' | translate"
[header]="appAbstract?.appType ? ('ACTIONS.DELETE.' + appAbstract?.appType + '.HEADER' | translate) : ''"
[modal]="true"
[resizable]="false"
[dismissableMask]="true"
Expand All @@ -9,7 +9,7 @@
<div class="flex column-gap-3 row-gap-1 justify-content-start align-items-center">
<div class="pi pi-question-circle text-3xl danger-action-text"></div>
<div>
<div>{{ ('ACTIONS.DELETE.MESSAGE' | translate).replace("{{ITEM}}", appAbstract ? appAbstract.appId : '') }}</div>
<div>{{ ('ACTIONS.DELETE.MESSAGE' | translate).replace("{{ITEM}}", appAbstract?.appId ?? '') }}</div>
<div class="mt-2">{{ 'ACTIONS.DELETE.MESSAGE_INFO' | translate }}</div>
</div>
</div>
Expand All @@ -34,7 +34,7 @@
iconPos="left"
[label]="'ACTIONS.CONFIRMATION.YES' | translate"
[title]="'ACTIONS.CONFIRMATION.YES.TOOLTIP' | translate"
(click)="confirmDeletion()"
(click)="onConfirmDeletion()"
></button>
</div>
</ng-template>
Expand Down
38 changes: 28 additions & 10 deletions src/app/product-store/app-delete/app-delete.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,47 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'
import { TranslateService } from '@ngx-translate/core'

import { PortalMessageService } from '@onecx/portal-integration-angular'
import { MicrofrontendsAPIService, MicrofrontendAbstract } from 'src/app/shared/generated'
import { AppAbstract } from '../app-search/app-search.component'
import { MicrofrontendsAPIService, MicroservicesAPIService } from 'src/app/shared/generated'

@Component({
selector: 'app-app-delete',
templateUrl: './app-delete.component.html'
})
export class AppDeleteComponent {
@Input() appAbstract: MicrofrontendAbstract | undefined
@Input() appAbstract: AppAbstract | undefined
@Input() displayDialog = false
@Output() displayDialogChange = new EventEmitter<boolean>()

public deleteMessage = ''
@Output() appDeleted = new EventEmitter<boolean>()

constructor(
private appApi: MicrofrontendsAPIService,
private msApi: MicroservicesAPIService,
private mfeApi: MicrofrontendsAPIService,
private msgService: PortalMessageService,
private translate: TranslateService
) {}

public onDialogHide() {
this.displayDialogChange.emit(false)
public onDialogHide(): void {
this.appDeleted.emit(false)
}
public confirmDeletion() {
console.log('confirmDeletion')

public onConfirmDeletion(): void {
if (this.appAbstract?.id) {
if (this.appAbstract?.appType === 'MFE')
this.mfeApi.deleteMicrofrontend({ id: this.appAbstract?.id }).subscribe({
next: () => {
this.msgService.success({ summaryKey: 'ACTIONS.DELETE.APP.OK' })
this.appDeleted.emit(true)
},
error: () => this.msgService.error({ summaryKey: 'ACTIONS.DELETE.APP.NOK' })
})
if (this.appAbstract?.appType === 'MS')
this.msApi.deleteMicroservice({ id: this.appAbstract?.id }).subscribe({
next: () => {
this.msgService.success({ summaryKey: 'ACTIONS.DELETE.APP.OK' })
this.appDeleted.emit(true)
},
error: () => this.msgService.error({ summaryKey: 'ACTIONS.DELETE.APP.NOK' })
})
}
}
}
Loading
Loading