feat: Implement product categories, stores, suppliers, and users management features
- Added ProductCategoriesService for handling product category API interactions. - Created components for listing and viewing product categories. - Implemented UI for managing product categories with a data list component. - Developed StoresService for managing store-related API calls. - Created components for listing and viewing stores with appropriate UI. - Added SuppliersService for handling supplier API interactions. - Implemented components for managing suppliers with a data list component. - Developed UsersService for managing user-related API calls. - Created components for listing and viewing users with appropriate UI. - Enhanced not found page with improved layout and navigation options.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { Injectable, computed, effect, signal } from '@angular/core';
|
||||
import { MENU_ITEMS } from '@/core/constants';
|
||||
import { computed, effect, Injectable, signal } from '@angular/core';
|
||||
import { MenuItem } from 'primeng/api';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
export interface layoutConfig {
|
||||
@@ -15,6 +17,7 @@ interface LayoutState {
|
||||
configSidebarVisible?: boolean;
|
||||
staticMenuMobileActive?: boolean;
|
||||
menuHoverActive?: boolean;
|
||||
isFixedContentSize?: boolean;
|
||||
}
|
||||
|
||||
interface MenuChangeEvent {
|
||||
@@ -28,7 +31,7 @@ interface MenuChangeEvent {
|
||||
export class LayoutService {
|
||||
_config: layoutConfig = {
|
||||
preset: 'Aura',
|
||||
primary: 'violet',
|
||||
primary: 'blue',
|
||||
surface: null,
|
||||
darkTheme: localStorage.getItem('isDarkTheme') === 'true',
|
||||
menuMode: 'static',
|
||||
@@ -40,6 +43,7 @@ export class LayoutService {
|
||||
configSidebarVisible: false,
|
||||
staticMenuMobileActive: false,
|
||||
menuHoverActive: false,
|
||||
isFixedContentSize: true,
|
||||
};
|
||||
|
||||
layoutConfig = signal<layoutConfig>(this._config);
|
||||
@@ -54,6 +58,8 @@ export class LayoutService {
|
||||
|
||||
private resetSource = new Subject();
|
||||
|
||||
public menuItems = signal<MenuItem[]>(MENU_ITEMS);
|
||||
|
||||
menuSource$ = this.menuSource.asObservable();
|
||||
|
||||
resetSource$ = this.resetSource.asObservable();
|
||||
@@ -76,11 +82,14 @@ export class LayoutService {
|
||||
|
||||
isOverlay = computed(() => this.layoutConfig().menuMode === 'overlay');
|
||||
|
||||
isFixedContentSize = computed(() => this.layoutState().isFixedContentSize);
|
||||
|
||||
transitionComplete = signal<boolean>(false);
|
||||
|
||||
private initialized = false;
|
||||
|
||||
constructor() {
|
||||
this.handleDarkModeTransition(this._config);
|
||||
effect(() => {
|
||||
const config = this.layoutConfig();
|
||||
if (config) {
|
||||
@@ -121,8 +130,16 @@ export class LayoutService {
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
changeIsFixedContentSize(status: boolean) {
|
||||
this.layoutState.update((prev) => ({
|
||||
...prev,
|
||||
isFixedContentSize: status,
|
||||
}));
|
||||
}
|
||||
|
||||
toggleDarkMode(config?: layoutConfig): void {
|
||||
const _config = config || this.layoutConfig();
|
||||
localStorage.setItem('isDarkTheme', JSON.stringify(_config.darkTheme));
|
||||
if (_config.darkTheme) {
|
||||
document.documentElement.classList.add('app-dark');
|
||||
} else {
|
||||
@@ -186,4 +203,8 @@ export class LayoutService {
|
||||
reset() {
|
||||
this.resetSource.next(true);
|
||||
}
|
||||
|
||||
setMenuItems(items: MenuItem[]) {
|
||||
this.menuItems.set(items);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user