1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00

Add subfolder in store

This commit is contained in:
vincent 2022-07-20 08:53:54 +02:00 committed by Sylvain
parent bf1700e43a
commit 59748356fc
5 changed files with 25 additions and 25 deletions

View File

@ -1,8 +1,8 @@
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ProductCategory } from '../../models/product-category';
import { FabButton } from '../base/fab-button';
import { FabModal, ModalSize } from '../base/fab-modal';
import { ProductCategory } from '../../../models/product-category';
import { FabButton } from '../../base/fab-button';
import { FabModal, ModalSize } from '../../base/fab-modal';
import { ProductCategoryForm } from './product-category-form';
interface ManageProductCategoryProps {

View File

@ -1,21 +1,21 @@
import React from 'react';
import { ProductCategory } from '../../models/product-category';
import { ProductCategory } from '../../../models/product-category';
import { DotsSixVertical } from 'phosphor-react';
import { FabButton } from '../base/fab-button';
import { FabButton } from '../../base/fab-button';
import { ManageProductCategory } from './manage-product-category';
interface ProductCategoriesListProps {
interface ProductCategoriesTreeProps {
productCategories: Array<ProductCategory>,
onSuccess: (message: string) => void,
onError: (message: string) => void,
}
/**
* This component shows a Tree list of all Product's Categories
* This component shows a tree list of all Product's Categories
*/
export const ProductCategoriesList: React.FC<ProductCategoriesListProps> = ({ productCategories, onSuccess, onError }) => {
export const ProductCategoriesTree: React.FC<ProductCategoriesTreeProps> = ({ productCategories, onSuccess, onError }) => {
return (
<div className='product-categories-list'>
<div className='product-categories-tree'>
{productCategories.map((category) => (
<div key={category.id} className='product-categories-item'>
<div className='itemInfo'>

View File

@ -1,13 +1,13 @@
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { ProductCategory } from '../../models/product-category';
import ProductCategoryAPI from '../../api/product-category';
import { ProductCategory } from '../../../models/product-category';
import ProductCategoryAPI from '../../../api/product-category';
import { ManageProductCategory } from './manage-product-category';
import { ProductCategoriesList } from './product-categories-list';
import { FabAlert } from '../base/fab-alert';
import { HtmlTranslate } from '../base/html-translate';
import { IApplication } from '../../models/application';
import { Loader } from '../base/loader';
import { ProductCategoriesTree } from './product-categories-tree';
import { FabAlert } from '../../base/fab-alert';
import { HtmlTranslate } from '../../base/html-translate';
import { IApplication } from '../../../models/application';
import { Loader } from '../../base/loader';
import { react2angular } from 'react2angular';
declare const Application: IApplication;
@ -18,7 +18,7 @@ interface ProductCategoriesProps {
}
/**
* This component shows a list of all product categories and offer to manager them
* This component shows a tree list of all product categories and offer to manager them
* by creating, deleting, modifying and reordering each product categories.
*/
const ProductCategories: React.FC<ProductCategoriesProps> = ({ onSuccess, onError }) => {
@ -61,7 +61,7 @@ const ProductCategories: React.FC<ProductCategoriesProps> = ({ onSuccess, onErro
<FabAlert level="warning">
<HtmlTranslate trKey="app.admin.store.product_categories.info" />
</FabAlert>
<ProductCategoriesList
<ProductCategoriesTree
productCategories={productCategories}
onSuccess={handleSuccess} onError={onError} />
</div>

View File

@ -2,12 +2,12 @@ import React, { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { useForm, SubmitHandler } from 'react-hook-form';
import slugify from 'slugify';
import { FormInput } from '../form/form-input';
import { FormSelect } from '../form/form-select';
import { ProductCategory } from '../../models/product-category';
import { FabButton } from '../base/fab-button';
import { FabAlert } from '../base/fab-alert';
import ProductCategoryAPI from '../../api/product-category';
import { FormInput } from '../../form/form-input';
import { FormSelect } from '../../form/form-select';
import { ProductCategory } from '../../../models/product-category';
import { FabButton } from '../../base/fab-button';
import { FabAlert } from '../../base/fab-alert';
import ProductCategoryAPI from '../../../api/product-category';
interface ProductCategoryFormProps {
action: 'create' | 'update' | 'delete',

View File

@ -39,7 +39,7 @@
}
}
&-list {
&-tree {
& > *:not(:last-of-type) {
margin-bottom: 1.6rem;
}