mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
Compare commits
3 Commits
1cc13eebe1
...
feature/52
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bddaa83d5 | ||
|
|
dd9c60e0c0 | ||
|
|
09677e8df8 |
@@ -35,6 +35,7 @@ import {
|
|||||||
tabResolverFn,
|
tabResolverFn,
|
||||||
TabService,
|
TabService,
|
||||||
TabNavigationService,
|
TabNavigationService,
|
||||||
|
processResolverFn,
|
||||||
} from '@isa/core/tabs';
|
} from '@isa/core/tabs';
|
||||||
import { provideScrollPositionRestoration } from '@isa/utils/scroll-position';
|
import { provideScrollPositionRestoration } from '@isa/utils/scroll-position';
|
||||||
|
|
||||||
@@ -187,7 +188,7 @@ const routes: Routes = [
|
|||||||
{
|
{
|
||||||
path: ':tabId',
|
path: ':tabId',
|
||||||
component: MainComponent,
|
component: MainComponent,
|
||||||
resolve: { process: tabResolverFn, tab: tabResolverFn },
|
resolve: { process: processResolverFn, tab: tabResolverFn },
|
||||||
canActivate: [IsAuthenticatedGuard],
|
canActivate: [IsAuthenticatedGuard],
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -156,26 +156,7 @@ export class ShellProcessBarComponent implements OnInit {
|
|||||||
|
|
||||||
processes = await this.processes$.pipe(delay(1), first()).toPromise();
|
processes = await this.processes$.pipe(delay(1), first()).toPromise();
|
||||||
|
|
||||||
if (processes.length === 0) {
|
|
||||||
this._router.navigate(['/kunde', 'dashboard']);
|
this._router.navigate(['/kunde', 'dashboard']);
|
||||||
} else {
|
|
||||||
const lastest = processes.reduce(
|
|
||||||
(prev, current) =>
|
|
||||||
prev.activated > current.activated ? prev : current,
|
|
||||||
processes[0],
|
|
||||||
);
|
|
||||||
const crumb = await this._breadcrumb
|
|
||||||
.getLastActivatedBreadcrumbByKey$(lastest.id)
|
|
||||||
.pipe(first())
|
|
||||||
.toPromise();
|
|
||||||
if (crumb) {
|
|
||||||
this._router.navigate(coerceArray(crumb.path), {
|
|
||||||
queryParams: crumb.params,
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this._router.navigate(['/kunde', lastest.id, 'product']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@
|
|||||||
*ifRole="'Store'"
|
*ifRole="'Store'"
|
||||||
class="side-menu-group-item"
|
class="side-menu-group-item"
|
||||||
(click)="closeSideMenu(); focusSearchBox()"
|
(click)="closeSideMenu(); focusSearchBox()"
|
||||||
[routerLink]="['/', tabService.activatedTab()?.id || nextId(), 'return']"
|
[routerLink]="['/', tabId(), 'return']"
|
||||||
(isActiveChange)="focusSearchBox()"
|
(isActiveChange)="focusSearchBox()"
|
||||||
>
|
>
|
||||||
<span class="side-menu-group-item-icon w-[2.375rem] h-12">
|
<span class="side-menu-group-item-icon w-[2.375rem] h-12">
|
||||||
@@ -303,7 +303,7 @@
|
|||||||
(click)="closeSideMenu(); focusSearchBox()"
|
(click)="closeSideMenu(); focusSearchBox()"
|
||||||
[routerLink]="[
|
[routerLink]="[
|
||||||
'/',
|
'/',
|
||||||
tabService.activatedTab()?.id || nextId(),
|
tabId(),
|
||||||
'remission',
|
'remission',
|
||||||
]"
|
]"
|
||||||
(isActiveChange)="focusSearchBox(); remissionExpanded.set($event)"
|
(isActiveChange)="focusSearchBox(); remissionExpanded.set($event)"
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
:host {
|
:host {
|
||||||
@apply h-32 w-full flex flex-row gap-20 rounded-2xl bg-isa-neutral-400 p-6;
|
@apply h-32 w-full flex flex-row gap-20 rounded-2xl bg-isa-neutral-400 p-6 text-isa-neutral-900;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,25 @@
|
|||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-[0.125rem]">
|
||||||
<div class="flex flex-col gap-1">
|
<div class="flex flex-col gap-1">
|
||||||
<span>NAME {{ card().firstName }} - {{ card().lastName }} </span>
|
<span class="isa-text-body-1-regular"
|
||||||
<span>{{ card().totalPoints }}</span>
|
>{{ card()?.firstName }} {{ card()?.lastName }}
|
||||||
|
</span>
|
||||||
|
<span class="isa-text-body-1-bold"
|
||||||
|
>{{ card()?.totalPoints ?? 0 }} Lesepunkte</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button (click)="resetCustomer()" linkButton>Zurücksetzen</button>
|
<ui-text-button
|
||||||
|
class="self-start -ml-[0.6rem]"
|
||||||
|
type="button"
|
||||||
|
color="subtle"
|
||||||
|
size="small"
|
||||||
|
(click)="resetCustomer()"
|
||||||
|
>
|
||||||
|
Zurücksetzen
|
||||||
|
</ui-text-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<span>Prämien ausgewählt</span>
|
<span class="isa-text-body-1-regular">Prämien ausgewählt</span>
|
||||||
<span>0</span>
|
<span class="isa-text-body-1-bold">0</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import {
|
import {
|
||||||
ChangeDetectionStrategy,
|
ChangeDetectionStrategy,
|
||||||
Component,
|
Component,
|
||||||
linkedSignal,
|
|
||||||
inject,
|
inject,
|
||||||
input,
|
input,
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import { ButtonComponent } from '@isa/ui/buttons';
|
import { TextButtonComponent } from '@isa/ui/buttons';
|
||||||
import { RouterLink } from '@angular/router';
|
|
||||||
import { BonusCardInfo, SelectedCustomerFacade } from '@isa/crm/data-access';
|
import { BonusCardInfo, SelectedCustomerFacade } from '@isa/crm/data-access';
|
||||||
import { injectTabId } from '@isa/core/tabs';
|
import { injectTabId } from '@isa/core/tabs';
|
||||||
|
|
||||||
@@ -15,7 +13,7 @@ import { injectTabId } from '@isa/core/tabs';
|
|||||||
templateUrl: './reward-customer-card.component.html',
|
templateUrl: './reward-customer-card.component.html',
|
||||||
styleUrl: './reward-customer-card.component.css',
|
styleUrl: './reward-customer-card.component.css',
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
imports: [ButtonComponent, RouterLink],
|
imports: [TextButtonComponent],
|
||||||
})
|
})
|
||||||
export class RewardCustomerCardComponent {
|
export class RewardCustomerCardComponent {
|
||||||
tabId = injectTabId();
|
tabId = injectTabId();
|
||||||
|
|||||||
@@ -26,3 +26,12 @@ export const tabResolverFn: ResolveFn<Tab> = (route) => {
|
|||||||
|
|
||||||
return tab;
|
return tab;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// @deprecated use tabResolverFn instead
|
||||||
|
export const processResolverFn: ResolveFn<Tab> = async (route) => {
|
||||||
|
const tabService = inject(TabService);
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||||
|
const id = parseInt(route.params['tabId']);
|
||||||
|
|
||||||
|
return tabService.entityMap()[id];
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user