Skip to content

Commit 7cae29a

Browse files
committed
feat(shop): implement shop detail page
1 parent d8c28ba commit 7cae29a

File tree

5 files changed

+85
-8
lines changed

5 files changed

+85
-8
lines changed

packages/core/state/src/lib/+state/fulfillment/fulfillment.effects.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -240,11 +240,10 @@ export class FulfillmentEffects {
240240
.submit({
241241
items: [
242242
{
243-
...entities[payload.id],
244-
// id: payload.id,
245-
// meta: {
246-
// owners: [...(entities[payload.id]?.meta.owners || [])],
247-
// },
243+
id: payload.id,
244+
meta: {
245+
owners: [...(entities[payload.id]?.meta.owners || [])],
246+
},
248247
},
249248
],
250249
scope: leafOrg || organization,

packages/modules/management/src/lib/components/shop/shop-view.component.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ import {
1313
selector: 'app-module-management-shop-view',
1414
template: `
1515
@if(vm$ | async; as vm) {
16-
<!-- <app-module-management-shop-details [vm]="vm" /> -->
17-
{{ vm.shop | json }}
16+
<app-module-management-shop-view-details [vm]="vm" />
1817
}
1918
`,
2019
changeDetection: ChangeDetectionStrategy.OnPush,

packages/modules/management/src/lib/components/shop/shop.module.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ModulesUiModule } from '@console-modules/ui';
77
import { ShopIndexComponent } from './shop-index.component';
88
import { ShopViewComponent } from './shop-view.component';
99
import { ShopTemplateComponent } from './template/shop-template.component';
10+
import { ShopViewDetailComponent } from './view/shop-view-details.component';
1011

1112
const routes: Routes = [
1213
{
@@ -40,7 +41,12 @@ const routes: Routes = [
4041
];
4142

4243
@NgModule({
43-
declarations: [ShopTemplateComponent, ShopIndexComponent, ShopViewComponent],
44+
declarations: [
45+
ShopTemplateComponent,
46+
ShopIndexComponent,
47+
ShopViewComponent,
48+
ShopViewDetailComponent,
49+
],
4450
imports: [ModulesUiModule.forChild(), RouterModule.forChild(routes)],
4551
})
4652
export class ShopModule {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<vcl-data-list
2+
mode="none"
3+
[noBorder]="true"
4+
>
5+
<vcl-data-list-header>
6+
<h4>Data</h4>
7+
</vcl-data-list-header>
8+
<vcl-data-list-item class="col">
9+
<ng-container
10+
*ngTemplateOutlet="
11+
shopPropItemTemplate;
12+
context: { prop: 'Shop number', value: vm.shop.shopNumber }
13+
"
14+
></ng-container>
15+
</vcl-data-list-item>
16+
17+
<vcl-data-list-item class="col">
18+
<ng-container
19+
*ngTemplateOutlet="
20+
shopPropItemTemplate;
21+
context: { prop: 'Name', value: vm.shop.name }
22+
"
23+
></ng-container>
24+
</vcl-data-list-item>
25+
26+
<vcl-data-list-item class="col">
27+
<ng-container
28+
*ngTemplateOutlet="
29+
shopPropItemTemplate;
30+
context: { prop: 'Description', value: vm.shop.description || 'N/A' }
31+
"
32+
></ng-container>
33+
</vcl-data-list-item>
34+
35+
<vcl-data-list-item class="col">
36+
<ng-container
37+
*ngTemplateOutlet="
38+
shopPropItemTemplate;
39+
context: { prop: 'Domain', value: vm.shop.domains?.join(', ') }
40+
"
41+
></ng-container>
42+
</vcl-data-list-item>
43+
</vcl-data-list>
44+
45+
<ng-template
46+
#shopPropItemTemplate
47+
let-prop="prop"
48+
let-value="value"
49+
>
50+
<div class="flex row justify-content-between align-items-center">
51+
<span>{{ prop }}</span>
52+
<span>{{ value }}</span>
53+
</div>
54+
</ng-template>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
2+
3+
import { IShop } from '@console-core/types';
4+
5+
@Component({
6+
selector: 'app-module-management-shop-view-details',
7+
templateUrl: './shop-view-details.component.html',
8+
changeDetection: ChangeDetectionStrategy.OnPush,
9+
standalone: false,
10+
})
11+
export class ShopViewDetailComponent {
12+
@Input({
13+
required: true,
14+
})
15+
vm!: {
16+
id: string;
17+
shop: IShop;
18+
};
19+
}

0 commit comments

Comments
 (0)