Skip to content

Commit

Permalink
update nodules
Browse files Browse the repository at this point in the history
  • Loading branch information
nikiquickie committed Nov 27, 2024
1 parent 032cd54 commit d8ecd20
Show file tree
Hide file tree
Showing 28 changed files with 259 additions and 43 deletions.
42 changes: 21 additions & 21 deletions src/app/core/theme/user/user.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,25 @@
<span class="material-icons">translate</span>
<span translate>Theme.Translates</span>
</a>
<a [routerLinkActiveOptions]="{ exact: true }" routerLinkActive="_activeLink"
routerLink="/commerces" class="nav__burger-link" (click)="hideSidebar()">
<a [routerLinkActiveOptions]="{ exact: true }" routerLinkActive="_activeLink" routerLink="/commerces"
class="nav__burger-link" (click)="hideSidebar()">
<span class="material-icons">business</span>
<span translate>Theme.Commerces</span>
</a>
<a [routerLinkActiveOptions]="{ exact: true }" routerLinkActive="_activeLink"
routerLink="/commercebrands" class="nav__burger-link" (click)="hideSidebar()">
<span class="material-icons">branding_watermark</span>
<span translate>Theme.Brands</span>
</a>
<a [routerLinkActiveOptions]="{ exact: true }" routerLinkActive="_activeLink"
routerLink="/commercediscounts" class="nav__burger-link" (click)="hideSidebar()">
<span class="material-icons">percent</span>
<span translate>Theme.Discounts</span>
</a>
<a [routerLinkActiveOptions]="{ exact: true }" routerLinkActive="_activeLink"
routerLink="/commerceorders" class="nav__burger-link" (click)="hideSidebar()">
<span class="material-icons">list_alt</span>
<span translate>Theme.Orders</span>
</a>
<a [routerLinkActiveOptions]="{ exact: true }" routerLinkActive="_activeLink"
routerLink="/commerceportfolios" class="nav__burger-link" (click)="hideSidebar()">
<span class="material-icons">photo_camera</span>
<span translate>Theme.Portfolios</span>
routerLink="/commercestores" class="nav__burger-link" (click)="hideSidebar()">
<span class="material-icons">store</span>
<span translate>Theme.Stores</span>
</a>
<a [routerLinkActiveOptions]="{ exact: true }" routerLinkActive="_activeLink"
routerLink="/commercewarehouses" class="nav__burger-link" (click)="hideSidebar()">
<span class="material-icons">home</span>
<span translate>Theme.Warehouses</span>
</a>
<a [routerLinkActiveOptions]="{ exact: true }" routerLinkActive="_activeLink"
routerLink="/commerceproducts" class="nav__burger-link" (click)="hideSidebar()">
Expand All @@ -85,19 +80,24 @@
<span translate>Theme.Services</span>
</a>
<a [routerLinkActiveOptions]="{ exact: true }" routerLinkActive="_activeLink"
routerLink="/commercestores" class="nav__burger-link" (click)="hideSidebar()">
<span class="material-icons">store</span>
<span translate>Theme.Stores</span>
routerLink="/commerceportfolios" class="nav__burger-link" (click)="hideSidebar()">
<span class="material-icons">photo_camera</span>
<span translate>Theme.Portfolios</span>
</a>
<a [routerLinkActiveOptions]="{ exact: true }" routerLinkActive="_activeLink" routerLink="/commercetags"
class="nav__burger-link" (click)="hideSidebar()">
<span class="material-icons">style</span>
<span translate>Theme.Tags</span>
</a>
<a [routerLinkActiveOptions]="{ exact: true }" routerLinkActive="_activeLink"
routerLink="/commercewarehouses" class="nav__burger-link" (click)="hideSidebar()">
<span class="material-icons">home</span>
<span translate>Theme.Warehouses</span>
routerLink="/commercebrands" class="nav__burger-link" (click)="hideSidebar()">
<span class="material-icons">branding_watermark</span>
<span translate>Theme.Brands</span>
</a>
<a [routerLinkActiveOptions]="{ exact: true }" routerLinkActive="_activeLink"
routerLink="/commercediscounts" class="nav__burger-link" (click)="hideSidebar()">
<span class="material-icons">percent</span>
<span translate>Theme.Discounts</span>
</a>


Expand Down
50 changes: 49 additions & 1 deletion src/app/modules/commerce/pages/commerces/commerces.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,59 @@ export class CommercesComponent {
},
buttons: [
{
icon: 'shopping_bag',
icon: 'list_alt',
hrefFunc: (doc: Commerce): string => {
return '/commerceorders/' + doc._id;
}
},
{
icon: 'store',
hrefFunc: (doc: Commerce): string => {
return '/commercestores/' + doc._id;
}
},
{
icon: 'home',
hrefFunc: (doc: Commerce): string => {
return '/commercewarehouses/' + doc._id;
}
},
{
icon: 'production_quantity_limits',
hrefFunc: (doc: Commerce): string => {
return '/commerceproducts/' + doc._id;
}
},
{
icon: 'room_service',
hrefFunc: (doc: Commerce): string => {
return '/commerceservices/' + doc._id;
}
},
{
icon: 'photo_camera',
hrefFunc: (doc: Commerce): string => {
return '/commerceportfolios/' + doc._id;
}
},
{
icon: 'style',
hrefFunc: (doc: Commerce): string => {
return '/commercetag/' + doc._id;
}
},
{
icon: 'branding_watermark',
hrefFunc: (doc: Commerce): string => {
return '/commercebrand/' + doc._id;
}
},
{
icon: 'percent',
hrefFunc: (doc: Commerce): string => {
return '/commercediscounts/' + doc._id;
}
},
{
icon: 'cloud_download',
click: (doc: Commerce): void => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import { CrudDocument } from 'wacom';
export interface Commercebrand extends CrudDocument {
name: string;
description: string;
commerce: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { FormService } from 'src/app/core/modules/form/form.service';
import { TranslateService } from 'src/app/core/modules/translate/translate.service';
import { FormInterface } from 'src/app/core/modules/form/interfaces/form.interface';
import { commercebrandFormComponents } from '../../formcomponents/commercebrand.formcomponents';
import { Router } from '@angular/router';

@Component({
templateUrl: './commercebrands.component.html',
Expand All @@ -15,13 +16,20 @@ import { commercebrandFormComponents } from '../../formcomponents/commercebrand.
export class CommercebrandsComponent {
columns = ['name', 'description'];

commerce = this._router.url.includes('/commercebrands/')
? this._router.url.replace('/commercebrands/', '')
: '';

form: FormInterface = this._form.getForm('commercebrand', commercebrandFormComponents);

config = {
create: (): void => {
this._form.modal<Commercebrand>(this.form, {
label: 'Create',
click: (created: unknown, close: () => void) => {
if (this.commerce) {
(created as Commercebrand).commerce = this.commerce;
}
this._commercebrandService.create(created as Commercebrand);

close();
Expand Down Expand Up @@ -84,8 +92,9 @@ export class CommercebrandsComponent {
private _commercebrandService: CommercebrandService,
private _alert: AlertService,
private _form: FormService,
private _core: CoreService
) {}
private _core: CoreService,
private _router: Router
) { }

private _bulkManagement(create = true): () => void {
return (): void => {
Expand All @@ -94,6 +103,9 @@ export class CommercebrandsComponent {
.then((commercebrands: Commercebrand[]) => {
if (create) {
for (const commercebrand of commercebrands) {
if (this.commerce) {
commercebrand.commerce = this.commerce;
}
this._commercebrandService.create(commercebrand);
}
} else {
Expand All @@ -115,7 +127,10 @@ export class CommercebrandsComponent {

this._commercebrandService.update(localCommercebrand);
} else {
commercebrand.__created = false;
if (this.commerce) {
commercebrand.commerce = this.commerce;
}
commercebrand.__created = false;

this._commercebrandService.create(commercebrand);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const routes: Routes = [
{
path: '',
component: CommercebrandsComponent
},
{
path: ':commerce_id',
component: CommercebrandsComponent
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import { CrudDocument } from 'wacom';
export interface Commercediscount extends CrudDocument {
name: string;
description: string;
commerce: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { FormService } from 'src/app/core/modules/form/form.service';
import { TranslateService } from 'src/app/core/modules/translate/translate.service';
import { FormInterface } from 'src/app/core/modules/form/interfaces/form.interface';
import { commercediscountFormComponents } from '../../formcomponents/commercediscount.formcomponents';
import { Route, Router } from '@angular/router';

@Component({
templateUrl: './commercediscounts.component.html',
Expand All @@ -15,13 +16,20 @@ import { commercediscountFormComponents } from '../../formcomponents/commercedis
export class CommercediscountsComponent {
columns = ['name', 'description'];

commerce = this._router.url.includes('/commercediscounts/')
? this._router.url.replace('/commercediscounts/', '')
: '';

form: FormInterface = this._form.getForm('commercediscount', commercediscountFormComponents);

config = {
create: (): void => {
this._form.modal<Commercediscount>(this.form, {
label: 'Create',
click: (created: unknown, close: () => void) => {
if (this.commerce) {
(created as Commercediscount).commerce = this.commerce;
}
this._commercediscountService.create(created as Commercediscount);

close();
Expand Down Expand Up @@ -84,8 +92,9 @@ export class CommercediscountsComponent {
private _commercediscountService: CommercediscountService,
private _alert: AlertService,
private _form: FormService,
private _core: CoreService
) {}
private _core: CoreService,
private _router: Router
) { }

private _bulkManagement(create = true): () => void {
return (): void => {
Expand All @@ -94,6 +103,9 @@ export class CommercediscountsComponent {
.then((commercediscounts: Commercediscount[]) => {
if (create) {
for (const commercediscount of commercediscounts) {
if (this.commerce) {
commercediscount.commerce = this.commerce;
}
this._commercediscountService.create(commercediscount);
}
} else {
Expand All @@ -115,7 +127,10 @@ export class CommercediscountsComponent {

this._commercediscountService.update(localCommercediscount);
} else {
commercediscount.__created = false;
if (this.commerce) {
commercediscount.commerce = this.commerce;
}
commercediscount.__created = false;

this._commercediscountService.create(commercediscount);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const routes: Routes = [
{
path: '',
component: CommercediscountsComponent
},
{
path: ':commerce_id',
component: CommercediscountsComponent
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import { CrudDocument } from 'wacom';
export interface Commerceorder extends CrudDocument {
name: string;
description: string;
commerce: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { FormService } from 'src/app/core/modules/form/form.service';
import { TranslateService } from 'src/app/core/modules/translate/translate.service';
import { FormInterface } from 'src/app/core/modules/form/interfaces/form.interface';
import { commerceorderFormComponents } from '../../formcomponents/commerceorder.formcomponents';
import { Router } from '@angular/router';

@Component({
templateUrl: './commerceorders.component.html',
Expand All @@ -15,13 +16,20 @@ import { commerceorderFormComponents } from '../../formcomponents/commerceorder.
export class CommerceordersComponent {
columns = ['name', 'description'];

commerce = this._router.url.includes('/commerceorders/')
? this._router.url.replace('/commerceorders/', '')
: '';

form: FormInterface = this._form.getForm('commerceorder', commerceorderFormComponents);

config = {
create: (): void => {
this._form.modal<Commerceorder>(this.form, {
label: 'Create',
click: (created: unknown, close: () => void) => {
if (this.commerce) {
(created as Commerceorder).commerce = this.commerce;
}
this._commerceorderService.create(created as Commerceorder);

close();
Expand Down Expand Up @@ -84,7 +92,8 @@ export class CommerceordersComponent {
private _commerceorderService: CommerceorderService,
private _alert: AlertService,
private _form: FormService,
private _core: CoreService
private _core: CoreService,
private _router: Router
) { }

private _bulkManagement(create = true): () => void {
Expand All @@ -94,6 +103,9 @@ export class CommerceordersComponent {
.then((commerceorders: Commerceorder[]) => {
if (create) {
for (const commerceorder of commerceorders) {
if (this.commerce) {
commerceorder.commerce = this.commerce;
}
this._commerceorderService.create(commerceorder);
}
} else {
Expand All @@ -115,6 +127,9 @@ export class CommerceordersComponent {

this._commerceorderService.update(localCommerceorder);
} else {
if (this.commerce) {
commerceorder.commerce = this.commerce;
}
commerceorder.__created = false;

this._commerceorderService.create(commerceorder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ const routes: Routes = [
{
path: '',
component: CommerceordersComponent
},
{
path: ':commerce_id',
component: CommerceordersComponent
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ import { CrudDocument } from 'wacom';
export interface Commerceportfolio extends CrudDocument {
name: string;
description: string;
commerce: string;
}
Loading

0 comments on commit d8ecd20

Please sign in to comment.