@applica-software-guru/react-admin 1.5.234 → 1.5.236

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,62 @@
1
+ import { CategoryForm } from '@/playground/components';
2
+ import {
3
+ ActionsMenu,
4
+ CreateInDialogButton,
5
+ Datagrid,
6
+ EditInDialogButton,
7
+ Empty,
8
+ FilterButton,
9
+ List,
10
+ SearchInput,
11
+ SimpleForm,
12
+ TextField,
13
+ TextInput,
14
+ required
15
+ } from '@applica-software-guru/react-admin';
16
+
17
+ function CategoryAddButton() {
18
+ return (
19
+ <CreateInDialogButton maxWidth="sm" redirect="list" size="small" variant="text">
20
+ <CategoryForm />
21
+ </CreateInDialogButton>
22
+ );
23
+ }
24
+
25
+ function CategorySubmitButton() {
26
+ function handleSubmit(values) {
27
+ console.log(values);
28
+ }
29
+ return (
30
+ <CreateInDialogButton onSubmit={handleSubmit} redirect="list" label="Submit">
31
+ <SimpleForm>
32
+ <TextInput source="description" validate={required()} fullWidth />
33
+ </SimpleForm>
34
+ </CreateInDialogButton>
35
+ );
36
+ }
37
+
38
+ function CategoryList() {
39
+ return (
40
+ <List
41
+ filters={[<SearchInput key="keyword" source="keyword" alwaysOn />]}
42
+ actions={
43
+ <>
44
+ <FilterButton />
45
+ <ActionsMenu>
46
+ <CategoryAddButton />
47
+ <CategorySubmitButton />
48
+ </ActionsMenu>
49
+ </>
50
+ }
51
+ empty={<Empty actions={<CategoryAddButton />} />}
52
+ >
53
+ <Datagrid>
54
+ <TextField source="description" />
55
+ <EditInDialogButton>
56
+ <CategoryForm />
57
+ </EditInDialogButton>
58
+ </Datagrid>
59
+ </List>
60
+ );
61
+ }
62
+ export { CategoryList };
@@ -1,3 +1,4 @@
1
+ export * from './CategoryList';
1
2
  export * from './DeviceList';
2
3
  export * from './I18nMessageList';
3
4
  export * from './UserList';
@@ -0,0 +1,26 @@
1
+ import { Create, Edit } from '@/';
2
+ import { CategoryForm, CategoryList } from '@/playground/components';
3
+
4
+ function CategoryCreate() {
5
+ return (
6
+ <Create>
7
+ <CategoryForm />
8
+ </Create>
9
+ );
10
+ }
11
+
12
+ function CategoryEdit() {
13
+ return (
14
+ <Edit>
15
+ <CategoryForm />
16
+ </Edit>
17
+ );
18
+ }
19
+ export const category = {
20
+ list: CategoryList,
21
+ edit: CategoryEdit,
22
+ create: CategoryCreate,
23
+ options: {
24
+ group: 'control-panel'
25
+ }
26
+ };
@@ -1,3 +1,4 @@
1
+ export * from './category';
1
2
  export * from './device';
2
3
  export * from './i18n-message';
3
4
  export * from './notification';
@@ -1,9 +1,16 @@
1
- import { DashboardOutlined, FlagOutlined, NotificationOutlined, TableOutlined, UserOutlined } from '@ant-design/icons';
1
+ import {
2
+ DashboardOutlined,
3
+ FlagOutlined,
4
+ NotificationOutlined,
5
+ TableOutlined,
6
+ TagOutlined,
7
+ UserOutlined
8
+ } from '@ant-design/icons';
2
9
 
3
10
  export const menu = [
4
11
  {
5
12
  id: 'dashboard',
6
- title: 'Dashboard AA',
13
+ title: 'Dashboard',
7
14
  type: 'group',
8
15
  icon: DashboardOutlined,
9
16
  children: [
@@ -57,7 +64,7 @@ export const menu = [
57
64
  title: 'ra.menu.item.entities/category',
58
65
  type: 'item',
59
66
  url: '/entities/category',
60
- icon: FlagOutlined
67
+ icon: TagOutlined
61
68
  },
62
69
  {
63
70
  id: 'entities/user',