Renommer inventaire vers catalogue pour une meilleure représentation.
This commit is contained in:
parent
19f77d1b5b
commit
fe9dcacc7c
|
@ -1,6 +1,6 @@
|
|||
import {NgModule} from '@angular/core';
|
||||
import {Routes, RouterModule} from '@angular/router';
|
||||
import {InventoryPageComponent} from "./pages/inventory-page/inventory-page.component";
|
||||
import {CatalogComponent} from "./pages/catalog/catalog.component";
|
||||
|
||||
|
||||
const routes: Routes = [{
|
||||
|
@ -16,8 +16,8 @@ const routes: Routes = [{
|
|||
path: 'group',
|
||||
loadChildren: () => import('./modules/groups/groups.module').then(m => m.GroupsModule)
|
||||
}, {
|
||||
path: 'inventory',
|
||||
component: InventoryPageComponent,
|
||||
path: 'catalog',
|
||||
component: CatalogComponent,
|
||||
children: [
|
||||
{
|
||||
path: 'materialtype',
|
||||
|
|
|
@ -6,13 +6,13 @@ import {AppComponent} from './app.component';
|
|||
import {MatIconRegistry} from "@angular/material/icon";
|
||||
import {SharedModule} from "./modules/shared/shared.module";
|
||||
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
|
||||
import { InventoryPageComponent } from './pages/inventory-page/inventory-page.component';
|
||||
import { CatalogComponent } from './pages/catalog/catalog.component';
|
||||
import { CompanyModule } from './modules/company/company.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent,
|
||||
InventoryPageComponent
|
||||
CatalogComponent
|
||||
],
|
||||
imports: [
|
||||
AppRoutingModule,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<cre-entity-add
|
||||
title="Création d'une bannière"
|
||||
backButtonLink="/inventory/company/list"
|
||||
backButtonLink="/catalog/company/list"
|
||||
[unknownError]="unknownError"
|
||||
[customError]="errorMessage"
|
||||
[formFields]="formFields"
|
||||
|
|
|
@ -37,7 +37,7 @@ export class AddComponent extends SubscribingComponent {
|
|||
this.subscribe(
|
||||
this.companyService.save(values.name),
|
||||
{
|
||||
next: () => this.router.navigate(['/inventory/company/list']),
|
||||
next: () => this.router.navigate(['/catalog/company/list']),
|
||||
error: err => {
|
||||
if (err.status == 409) {
|
||||
this.errorMessage = `Une bannière avec le nom '${values.name}' existe déjà`
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*ngIf="company"
|
||||
title="Modifier la bannière {{company.name}}"
|
||||
deleteConfirmMessage="Voulez-vous vraiment supprimer la bannière {{company.name}}?"
|
||||
backButtonLink="/inventory/company/list"
|
||||
backButtonLink="/catalog/company/list"
|
||||
deletePermission="REMOVE_COMPANY"
|
||||
[entity]="company"
|
||||
[formFields]="formFields"
|
||||
|
|
|
@ -46,7 +46,7 @@ export class EditComponent extends SubscribingComponent {
|
|||
next: company => this.company = company,
|
||||
error: err => {
|
||||
if (err.status == 404) {
|
||||
this.router.navigate(['/inventory/company/list'])
|
||||
this.router.navigate(['/catalog/company/list'])
|
||||
} else {
|
||||
this.unknownError = true
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ export class EditComponent extends SubscribingComponent {
|
|||
this.subscribe(
|
||||
this.companyService.update(this.company.id, values.name),
|
||||
{
|
||||
next: () => this.router.navigate(['/inventory/company/list']),
|
||||
next: () => this.router.navigate(['/catalog/company/list']),
|
||||
error: err => {
|
||||
if (err.status == 409) {
|
||||
this.errorMessage = `Une bannière avec le nom '${values.name}' existe déjà`
|
||||
|
@ -77,7 +77,7 @@ export class EditComponent extends SubscribingComponent {
|
|||
this.subscribe(
|
||||
this.companyService.delete(this.company.id),
|
||||
{
|
||||
next: () => this.router.navigate(['/inventory/company/list']),
|
||||
next: () => this.router.navigate(['/catalog/company/list']),
|
||||
error: err => {
|
||||
this.unknownError = true
|
||||
console.log(err)
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
[entities$]="companies$"
|
||||
[columns]="columns"
|
||||
[buttons]="buttons"
|
||||
addLink="/inventory/company/add">
|
||||
addLink="/catalog/company/add">
|
||||
</cre-entity-list>
|
||||
|
|
|
@ -15,7 +15,7 @@ export class ListComponent extends SubscribingComponent {
|
|||
]
|
||||
buttons = [{
|
||||
text: 'Modifier',
|
||||
linkFn: t => `/inventory/company/edit/${t.id}`,
|
||||
linkFn: t => `/catalog/company/edit/${t.id}`,
|
||||
permission: EmployeePermission.EDIT_COMPANY
|
||||
}]
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<cre-entity-add
|
||||
title="Création d'un type de produit"
|
||||
backButtonLink="/inventory/materialtype/list"
|
||||
backButtonLink="/catalog/materialtype/list"
|
||||
[unknownError]="unknownError"
|
||||
[customError]="errorMessage"
|
||||
[formFields]="formFields"
|
||||
|
|
|
@ -57,7 +57,7 @@ export class AddComponent extends SubscribingComponent {
|
|||
this.subscribe(
|
||||
this.materialTypeService.save(values.name, values.prefix, values.usePercentages),
|
||||
{
|
||||
next: () => this.router.navigate(['/inventory/materialtype/list']),
|
||||
next: () => this.router.navigate(['/catalog/materialtype/list']),
|
||||
error: err => {
|
||||
if (err.status == 409 && err.error.id === values.name) {
|
||||
this.errorMessage = `Un type de produit avec le nom '${values.name}' existe déjà`
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*ngIf="materialType"
|
||||
title="Modifier le group {{materialType.name}}"
|
||||
deleteConfirmMessage="Voulez-vous vraiment supprimer le type de produit {{materialType.name}}?"
|
||||
backButtonLink="/inventory/materialtype/list"
|
||||
backButtonLink="/catalog/materialtype/list"
|
||||
deletePermission="REMOVE_MATERIAL_TYPE"
|
||||
[entity]="materialType"
|
||||
[formFields]="formFields"
|
||||
|
|
|
@ -74,7 +74,7 @@ export class EditComponent extends SubscribingComponent {
|
|||
this.subscribe(
|
||||
this.materialTypeService.update(this.materialType.id, values.name, values.prefix),
|
||||
{
|
||||
next: () => this.router.navigate(['/inventory/materialtype/list']),
|
||||
next: () => this.router.navigate(['/catalog/materialtype/list']),
|
||||
error: err => {
|
||||
if (err.status == 409 && err.error.id === values.name) {
|
||||
this.errorMessage = `Un type de produit avec le nom '${values.name}' existe déjà`
|
||||
|
@ -93,7 +93,7 @@ export class EditComponent extends SubscribingComponent {
|
|||
this.subscribe(
|
||||
this.materialTypeService.delete(this.materialType.id),
|
||||
{
|
||||
next: () => this.router.navigate(['/inventory/materialtype/list']),
|
||||
next: () => this.router.navigate(['/catalog/materialtype/list']),
|
||||
error: err => {
|
||||
this.unknownError = true
|
||||
console.log(err)
|
||||
|
|
|
@ -2,5 +2,5 @@
|
|||
[entities$]="materialTypes$"
|
||||
[columns]="columns"
|
||||
[buttons]="buttons"
|
||||
addLink="/inventory/materialtype/add">
|
||||
addLink="/catalog/materialtype/add">
|
||||
</cre-entity-list>
|
||||
|
|
|
@ -18,7 +18,7 @@ export class ListComponent extends SubscribingComponent {
|
|||
buttons = [
|
||||
{
|
||||
text: 'Modifier',
|
||||
linkFn: t => `/inventory/materialtype/edit/${t.id}`,
|
||||
linkFn: t => `/catalog/materialtype/edit/${t.id}`,
|
||||
permission: EmployeePermission.EDIT_MATERIAL_TYPE,
|
||||
disabledFn: t => t.systemType
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<cre-entity-add
|
||||
title="Création d'un produit"
|
||||
backButtonLink="/inventory/material/list"
|
||||
backButtonLink="/catalog/material/list"
|
||||
[unknownError]="unknownError"
|
||||
[customError]="errorMessage"
|
||||
[formFields]="formFields"
|
||||
|
|
|
@ -72,7 +72,7 @@ export class AddComponent extends SubscribingComponent {
|
|||
this.subscribe(
|
||||
this.materialService.save(values.name, values.inventoryQuantity, values.materialType, values.simdutFile),
|
||||
{
|
||||
next: () => this.router.navigate(['/inventory/material/list']),
|
||||
next: () => this.router.navigate(['/catalog/material/list']),
|
||||
error: err => {
|
||||
if (err.status == 409) {
|
||||
this.errorMessage = `Un produit avec le nom '${values.name}' existe déjà`
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*ngIf="material"
|
||||
title="Modifier le produit {{material.name}}"
|
||||
deleteConfirmMessage="Voulez-vous vraiment supprimer le produit {{material.name}}?"
|
||||
backButtonLink="/inventory/material/list"
|
||||
backButtonLink="/catalog/material/list"
|
||||
deletePermission="REMOVE_MATERIAL"
|
||||
[entity]="material"
|
||||
[formFields]="formFields"
|
||||
|
|
|
@ -89,7 +89,7 @@ export class EditComponent extends SubscribingComponent {
|
|||
next: material => this.material = material,
|
||||
error: err => {
|
||||
if (err.status === 404) {
|
||||
this.router.navigate(['/inventory/material/list'])
|
||||
this.router.navigate(['/catalog/material/list'])
|
||||
} else {
|
||||
this.unknownError = true
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ export class EditComponent extends SubscribingComponent {
|
|||
this.subscribe(
|
||||
this.materialService.update(this.material.id, values.name, values.inventoryQuantity, values.materialType, values.simdutFile),
|
||||
{
|
||||
next: () => this.router.navigate(['/inventory/material/list']),
|
||||
next: () => this.router.navigate(['/catalog/material/list']),
|
||||
error: err => {
|
||||
if (err.status == 409) {
|
||||
this.errorMessage = `Un produit avec le nom '${values.name}' existe déjà`
|
||||
|
@ -125,7 +125,7 @@ export class EditComponent extends SubscribingComponent {
|
|||
this.subscribe(
|
||||
this.materialService.delete(this.material.id),
|
||||
{
|
||||
next: () => this.router.navigate(['/inventory/material/list']),
|
||||
next: () => this.router.navigate(['/catalog/material/list']),
|
||||
error: err => {
|
||||
this.unknownError = true
|
||||
console.log(err)
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
[columns]="columns"
|
||||
[icons]="icons"
|
||||
[buttons]="buttons"
|
||||
addLink="/inventory/material/add">
|
||||
addLink="/catalog/material/add">
|
||||
</cre-entity-list>
|
||||
|
|
|
@ -24,7 +24,7 @@ export class ListComponent extends SubscribingComponent {
|
|||
}]
|
||||
buttons = [{
|
||||
text: 'Modifier',
|
||||
linkFn: t => `/inventory/material/edit/${t.id}`,
|
||||
linkFn: t => `/catalog/material/edit/${t.id}`,
|
||||
permission: EmployeePermission.EDIT_MATERIAL
|
||||
}, {
|
||||
text: 'Fiche signalitique',
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
import {Component, OnDestroy, OnInit} from '@angular/core';
|
||||
import {Component} from '@angular/core';
|
||||
import {ResolveEnd, Router} from "@angular/router";
|
||||
import {AppState} from "../../app-state";
|
||||
import {Employee, EmployeePermission} from "../../model/employee";
|
||||
import {AccountService} from "../../../accounts/services/account.service";
|
||||
import {Subject} from "rxjs";
|
||||
import {takeUntil} from "rxjs/operators";
|
||||
import {SubscribingComponent} from "../subscribing.component";
|
||||
|
||||
@Component({
|
||||
|
@ -14,7 +12,7 @@ import {SubscribingComponent} from "../subscribing.component";
|
|||
})
|
||||
export class HeaderComponent extends SubscribingComponent {
|
||||
links: HeaderLink[] = [
|
||||
{route: '/inventory', title: 'Inventaire', enabled: true},
|
||||
{route: '/catalog', title: 'Catalogue', enabled: true},
|
||||
new HeaderLink('/employee', 'Employés', EmployeePermission.VIEW_EMPLOYEE),
|
||||
new HeaderLink('/group', 'Groupes', EmployeePermission.VIEW_EMPLOYEE_GROUP),
|
||||
{route: '/account/login', title: 'Connexion', enabled: true},
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
import {Component} from '@angular/core';
|
||||
import {NavLink} from "../../modules/shared/components/nav/nav.component";
|
||||
import {EmployeePermission} from "../../modules/shared/model/employee";
|
||||
|
||||
@Component({
|
||||
selector: 'cre-inventory-page',
|
||||
templateUrl: './catalog.component.html',
|
||||
styleUrls: ['./catalog.component.sass']
|
||||
})
|
||||
export class CatalogComponent {
|
||||
links: NavLink[] = [
|
||||
{route: '/catalog/materialtype', title: 'Types de produit', permission: EmployeePermission.VIEW_MATERIAL_TYPE},
|
||||
{route: '/catalog/material', title: 'Produits', permission: EmployeePermission.VIEW_MATERIAL},
|
||||
{route: '/catalog/company', title: 'Bannières', permission: EmployeePermission.VIEW_COMPANY}
|
||||
]
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
import {Component} from '@angular/core';
|
||||
import {NavLink} from "../../modules/shared/components/nav/nav.component";
|
||||
import {EmployeePermission} from "../../modules/shared/model/employee";
|
||||
|
||||
@Component({
|
||||
selector: 'cre-inventory-page',
|
||||
templateUrl: './inventory-page.component.html',
|
||||
styleUrls: ['./inventory-page.component.sass']
|
||||
})
|
||||
export class InventoryPageComponent {
|
||||
links: NavLink[] = [
|
||||
{route: '/inventory/materialtype', title: 'Types de produit', permission: EmployeePermission.VIEW_MATERIAL_TYPE},
|
||||
{route: '/inventory/material', title: 'Produits', permission: EmployeePermission.VIEW_MATERIAL},
|
||||
{route: '/inventory/company', title: 'Bannières', permission: EmployeePermission.VIEW_COMPANY}
|
||||
]
|
||||
}
|
Loading…
Reference in New Issue