fix: update cSpell.words in settings.json and improve code formatting in various files
This commit is contained in:
Vendored
+1
-1
@@ -4,5 +4,5 @@
|
||||
"mode": "auto"
|
||||
}
|
||||
],
|
||||
"cSpell.words": ["mantine", "Menlo", "mgmt", "Millis", "Pandang", "Segoe", "Ujung", "VITE", "WITA"]
|
||||
"cSpell.words": ["dtos", "mantine", "Menlo", "mgmt", "Millis", "Pandang", "Segoe", "TDTO", "Ujung", "VITE", "WITA"]
|
||||
}
|
||||
|
||||
@@ -29,8 +29,8 @@ registerModuleNamespace(fullPageModuleConfig.translationNamespace, {
|
||||
// ---------------------------------------------------------------------------
|
||||
export default function FullPageModule() {
|
||||
return (
|
||||
<EnterpriseModuleProvider<FullPageEntity>
|
||||
config={fullPageModuleConfig}
|
||||
<EnterpriseModuleProvider<FullPageEntity>
|
||||
config={fullPageModuleConfig}
|
||||
dataServices={fullPageDataService}
|
||||
store={fullPageStore}
|
||||
>
|
||||
|
||||
@@ -25,10 +25,7 @@ import type { BaseEntity } from './types';
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export interface IDataTransformer<
|
||||
TEntity extends BaseEntity = BaseEntity,
|
||||
TDTO = TEntity,
|
||||
> {
|
||||
export interface IDataTransformer<TEntity extends BaseEntity = BaseEntity, TDTO = TEntity> {
|
||||
/**
|
||||
* Transform an API DTO into a domain entity.
|
||||
*
|
||||
@@ -88,7 +85,7 @@ export interface IDataTransformer<
|
||||
*
|
||||
* Extends the core `IDataTransformer` contract with granular hooks
|
||||
* for each CRUD operation. Override only the hooks you need —
|
||||
* unoverridden hooks delegate to the core `transformToEntity` /
|
||||
* un overridden hooks delegate to the core `transformToEntity` /
|
||||
* `transformToDTO` methods.
|
||||
*
|
||||
* **Design rationale (from legacy analysis):**
|
||||
@@ -129,10 +126,8 @@ export interface IDataTransformer<
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export abstract class BaseDataTransformer<
|
||||
TEntity extends BaseEntity = BaseEntity,
|
||||
TDTO = TEntity,
|
||||
> implements IDataTransformer<TEntity, TDTO>
|
||||
export abstract class BaseDataTransformer<TEntity extends BaseEntity = BaseEntity, TDTO = TEntity>
|
||||
implements IDataTransformer<TEntity, TDTO>
|
||||
{
|
||||
/**
|
||||
* Core DTO → Entity transformation.
|
||||
|
||||
@@ -3,7 +3,14 @@ import type { UseBoundStore, StoreApi } from 'zustand';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useTranslation } from '@repo/core-i18n';
|
||||
import { BaseEntity, BaseRemoteDataServices } from '@repo/core-api/data-services';
|
||||
import { ConfigSlice, ModuleConfigEntity, SinglePageFormState, SinglePageModalState, EnterpriseModuleState, PrivilegeEntity } from '../entities/entity';
|
||||
import {
|
||||
ConfigSlice,
|
||||
ModuleConfigEntity,
|
||||
SinglePageFormState,
|
||||
SinglePageModalState,
|
||||
EnterpriseModuleState,
|
||||
PrivilegeEntity,
|
||||
} from '../entities/entity';
|
||||
import {
|
||||
EnterpriseConfigContext,
|
||||
EnterpriseDataServiceContext,
|
||||
@@ -17,7 +24,7 @@ import { Forbidden } from '../../../components';
|
||||
|
||||
export interface EnterpriseModuleProviderProps<
|
||||
E extends BaseEntity,
|
||||
S extends EnterpriseModuleState<E> = EnterpriseModuleState<E>
|
||||
S extends EnterpriseModuleState<E> = EnterpriseModuleState<E>,
|
||||
> {
|
||||
children: ReactNode;
|
||||
config: ModuleConfigEntity<E>;
|
||||
@@ -30,7 +37,7 @@ const IS_MACOS = typeof navigator !== 'undefined' && /Mac|iPod|iPhone|iPad/.test
|
||||
|
||||
export function EnterpriseModuleProvider<
|
||||
E extends BaseEntity,
|
||||
S extends EnterpriseModuleState<E> = EnterpriseModuleState<E>
|
||||
S extends EnterpriseModuleState<E> = EnterpriseModuleState<E>,
|
||||
>(props: EnterpriseModuleProviderProps<E, S>) {
|
||||
const { children, config, dataServices, store } = props;
|
||||
const navigate = useNavigate();
|
||||
@@ -38,12 +45,12 @@ export function EnterpriseModuleProvider<
|
||||
// ---------------------------------------------------------------------------
|
||||
// 1. Config Slice (Static)
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
const storePrivileges = store((state: S) => state.privileges);
|
||||
|
||||
|
||||
const configSlice: ConfigSlice = useMemo(() => {
|
||||
// FIXME => Parsing privilege: mapping string array dari store ke format PrivilegeEntity (boolean)
|
||||
const parsedPrivileges = defaultPrivileges
|
||||
// Parsing privilege: mapping string array from store to PrivilegeEntity format (boolean)
|
||||
const parsedPrivileges: PrivilegeEntity = defaultPrivileges;
|
||||
|
||||
return {
|
||||
config,
|
||||
|
||||
Reference in New Issue
Block a user