fix(console): app integration without context (#7541)

* fix: app integration without context

* cleanup

---------

Co-authored-by: Silvan <silvan.reusser@gmail.com>
This commit is contained in:
Max Peintner 2024-03-13 11:27:53 +01:00 committed by GitHub
parent 266abcb23b
commit 1db10a4286
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 7 deletions

View File

@ -3,7 +3,7 @@
{{ 'QUICKSTART.DIALOG.CHANGE.DESCRIPTION' | translate }}
<div class="framework-change-block">
<cnsl-framework-autocomplete
[frameworkId]="data.framework.id"
[frameworkId]="data.framework?.id"
[frameworks]="data.frameworks"
(selectionChanged)="findFramework($event)"
></cnsl-framework-autocomplete>

View File

@ -1,12 +1,19 @@
<div class="framework-change-wrapper">
<div class="framework-card-wrapper">
<div class="framework-card card" *ngIf="framework | async as framework">
<div [routerLink]="['/app-create']" [queryParams]="{ id: framework.docsLink }" class="">
<div class="framework-card card" *ngIf="framework | async as framework; else frameworkFallback">
<div>
<img class="dark-only" *ngIf="framework.imgSrcDark" [src]="framework.imgSrcDark" />
<img class="light-only" *ngIf="framework.imgSrcLight" [src]="framework.imgSrcLight" />
</div>
<span>{{ framework.title }}</span>
</div>
<ng-template #frameworkFallback>
<div class="framework-card card">
<span>{{ 'QUICKSTART.SELECT_FRAMEWORK' | translate }}</span>
</div>
</ng-template>
<button (click)="openDialog()" mat-stroked-button>
{{ 'ACTIONS.CHANGE' | translate }}
</button>

View File

@ -132,9 +132,13 @@ export class AppCreateComponent implements OnDestroy {
.addProject(project.toObject())
.then((resp: AddProjectResponse.AsObject) => {
this.error.set('');
this.router.navigate(['/projects', resp.id, 'apps', 'integrate'], {
queryParams: { framework: this.framework()?.id },
});
if (this.customFramework()) {
this.router.navigate(['/projects', resp.id, 'apps', 'create']);
} else if (this.framework()) {
this.router.navigate(['/projects', resp.id, 'apps', 'integrate'], {
queryParams: { framework: this.framework()?.id },
});
}
})
.catch((error) => {
const { message } = error;

View File

@ -124,7 +124,7 @@
<div class="app-integrate-actions">
<button
mat-raised-button
[disabled]="loading"
[disabled]="loading || !framework()"
class="create-button"
color="primary"
(click)="createApp()"