@hedhog/admin 0.48.6 → 0.48.7

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.
Files changed (170) hide show
  1. package/dist/admin.module.d.ts.map +1 -1
  2. package/dist/admin.module.js +2 -0
  3. package/dist/admin.module.js.map +1 -1
  4. package/dist/auth/consts/body.d.ts.map +1 -1
  5. package/dist/dashboard/dashboard/dashboard.controller.d.ts +22 -0
  6. package/dist/dashboard/dashboard/dashboard.controller.d.ts.map +1 -0
  7. package/dist/dashboard/dashboard/dashboard.controller.js +88 -0
  8. package/dist/dashboard/dashboard/dashboard.controller.js.map +1 -0
  9. package/dist/dashboard/dashboard/dashboard.module.d.ts +3 -0
  10. package/dist/dashboard/dashboard/dashboard.module.d.ts.map +1 -0
  11. package/dist/dashboard/dashboard/dashboard.module.js +26 -0
  12. package/dist/dashboard/dashboard/dashboard.module.js.map +1 -0
  13. package/dist/dashboard/dashboard/dashboard.service.d.ts +30 -0
  14. package/dist/dashboard/dashboard/dashboard.service.d.ts.map +1 -0
  15. package/dist/dashboard/dashboard/dashboard.service.js +61 -0
  16. package/dist/dashboard/dashboard/dashboard.service.js.map +1 -0
  17. package/dist/dashboard/dashboard/dto/create.dto.d.ts +5 -0
  18. package/dist/dashboard/dashboard/dto/create.dto.d.ts.map +1 -0
  19. package/dist/dashboard/dashboard/dto/create.dto.js +23 -0
  20. package/dist/dashboard/dashboard/dto/create.dto.js.map +1 -0
  21. package/dist/dashboard/dashboard/dto/update.dto.d.ts +6 -0
  22. package/dist/dashboard/dashboard/dto/update.dto.d.ts.map +1 -0
  23. package/dist/dashboard/dashboard/dto/update.dto.js +9 -0
  24. package/dist/dashboard/dashboard/dto/update.dto.js.map +1 -0
  25. package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts +22 -0
  26. package/dist/dashboard/dashboard-component/dashboard-component.controller.d.ts.map +1 -0
  27. package/dist/dashboard/dashboard-component/dashboard-component.controller.js +90 -0
  28. package/dist/dashboard/dashboard-component/dashboard-component.controller.js.map +1 -0
  29. package/dist/dashboard/dashboard-component/dashboard-component.module.d.ts +3 -0
  30. package/dist/dashboard/dashboard-component/dashboard-component.module.d.ts.map +1 -0
  31. package/dist/dashboard/dashboard-component/dashboard-component.module.js +26 -0
  32. package/dist/dashboard/dashboard-component/dashboard-component.module.js.map +1 -0
  33. package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts +30 -0
  34. package/dist/dashboard/dashboard-component/dashboard-component.service.d.ts.map +1 -0
  35. package/dist/dashboard/dashboard-component/dashboard-component.service.js +59 -0
  36. package/dist/dashboard/dashboard-component/dashboard-component.service.js.map +1 -0
  37. package/dist/dashboard/dashboard-component/dto/create.dto.d.ts +13 -0
  38. package/dist/dashboard/dashboard-component/dto/create.dto.d.ts.map +1 -0
  39. package/dist/dashboard/dashboard-component/dto/create.dto.js +59 -0
  40. package/dist/dashboard/dashboard-component/dto/create.dto.js.map +1 -0
  41. package/dist/dashboard/dashboard-component/dto/update.dto.d.ts +6 -0
  42. package/dist/dashboard/dashboard-component/dto/update.dto.d.ts.map +1 -0
  43. package/dist/dashboard/dashboard-component/dto/update.dto.js +9 -0
  44. package/dist/dashboard/dashboard-component/dto/update.dto.js.map +1 -0
  45. package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts +52 -0
  46. package/dist/dashboard/dashboard-item/dashboard-item.controller.d.ts.map +1 -0
  47. package/dist/dashboard/dashboard-item/dashboard-item.controller.js +88 -0
  48. package/dist/dashboard/dashboard-item/dashboard-item.controller.js.map +1 -0
  49. package/dist/dashboard/dashboard-item/dashboard-item.module.d.ts +3 -0
  50. package/dist/dashboard/dashboard-item/dashboard-item.module.d.ts.map +1 -0
  51. package/dist/dashboard/dashboard-item/dashboard-item.module.js +26 -0
  52. package/dist/dashboard/dashboard-item/dashboard-item.module.js.map +1 -0
  53. package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts +57 -0
  54. package/dist/dashboard/dashboard-item/dashboard-item.service.d.ts.map +1 -0
  55. package/dist/dashboard/dashboard-item/dashboard-item.service.js +77 -0
  56. package/dist/dashboard/dashboard-item/dashboard-item.service.js.map +1 -0
  57. package/dist/dashboard/dashboard-item/dto/create.dto.d.ts +9 -0
  58. package/dist/dashboard/dashboard-item/dto/create.dto.d.ts.map +1 -0
  59. package/dist/dashboard/dashboard-item/dto/create.dto.js +41 -0
  60. package/dist/dashboard/dashboard-item/dto/create.dto.js.map +1 -0
  61. package/dist/dashboard/dashboard-item/dto/update.dto.d.ts +6 -0
  62. package/dist/dashboard/dashboard-item/dto/update.dto.d.ts.map +1 -0
  63. package/dist/dashboard/dashboard-item/dto/update.dto.js +9 -0
  64. package/dist/dashboard/dashboard-item/dto/update.dto.js.map +1 -0
  65. package/dist/dashboard/dashboard-user/dashboard-user.controller.d.ts +52 -0
  66. package/dist/dashboard/dashboard-user/dashboard-user.controller.d.ts.map +1 -0
  67. package/dist/dashboard/dashboard-user/dashboard-user.controller.js +88 -0
  68. package/dist/dashboard/dashboard-user/dashboard-user.controller.js.map +1 -0
  69. package/dist/dashboard/dashboard-user/dashboard-user.module.d.ts +3 -0
  70. package/dist/dashboard/dashboard-user/dashboard-user.module.d.ts.map +1 -0
  71. package/dist/dashboard/dashboard-user/dashboard-user.module.js +26 -0
  72. package/dist/dashboard/dashboard-user/dashboard-user.module.js.map +1 -0
  73. package/dist/dashboard/dashboard-user/dashboard-user.service.d.ts +59 -0
  74. package/dist/dashboard/dashboard-user/dashboard-user.service.d.ts.map +1 -0
  75. package/dist/dashboard/dashboard-user/dashboard-user.service.js +83 -0
  76. package/dist/dashboard/dashboard-user/dashboard-user.service.js.map +1 -0
  77. package/dist/dashboard/dashboard-user/dto/create.dto.d.ts +10 -0
  78. package/dist/dashboard/dashboard-user/dto/create.dto.d.ts.map +1 -0
  79. package/dist/dashboard/dashboard-user/dto/create.dto.js +42 -0
  80. package/dist/dashboard/dashboard-user/dto/create.dto.js.map +1 -0
  81. package/dist/dashboard/dashboard-user/dto/update.dto.d.ts +6 -0
  82. package/dist/dashboard/dashboard-user/dto/update.dto.d.ts.map +1 -0
  83. package/dist/dashboard/dashboard-user/dto/update.dto.js +9 -0
  84. package/dist/dashboard/dashboard-user/dto/update.dto.js.map +1 -0
  85. package/dist/dashboard/dashboard.module.d.ts +3 -0
  86. package/dist/dashboard/dashboard.module.d.ts.map +1 -0
  87. package/dist/dashboard/dashboard.module.js +35 -0
  88. package/dist/dashboard/dashboard.module.js.map +1 -0
  89. package/dist/dashboard/index.d.ts +2 -0
  90. package/dist/dashboard/index.d.ts.map +1 -0
  91. package/dist/dashboard/index.js +18 -0
  92. package/dist/dashboard/index.js.map +1 -0
  93. package/dist/emails/lib.d.ts.map +1 -1
  94. package/frontend/dashboard/components/create-panel.tsx.ejs +63 -0
  95. package/frontend/dashboard/components/dashboard.screen.tsx.ejs +116 -0
  96. package/frontend/dashboard/components/update-panel.tsx.ejs +80 -0
  97. package/frontend/dashboard/locales/en/dashboard.dashboard.json +11 -0
  98. package/frontend/dashboard/locales/pt/dashboard.dashboard.json +11 -0
  99. package/frontend/dashboard/react-query/handlers.ts.ejs +28 -0
  100. package/frontend/dashboard/react-query/requests.ts.ejs +56 -0
  101. package/frontend/dashboard-component/components/create-panel.tsx.ejs +130 -0
  102. package/frontend/dashboard-component/components/dashboard-component.screen.tsx.ejs +135 -0
  103. package/frontend/dashboard-component/components/update-panel.tsx.ejs +164 -0
  104. package/frontend/dashboard-component/locales/en/dashboard.dashboard-component.json +11 -0
  105. package/frontend/dashboard-component/locales/pt/dashboard.dashboard-component.json +11 -0
  106. package/frontend/dashboard-component/react-query/handlers.ts.ejs +28 -0
  107. package/frontend/dashboard-component/react-query/requests.ts.ejs +61 -0
  108. package/frontend/dashboard-item/components/create-panel.tsx.ejs +108 -0
  109. package/frontend/dashboard-item/components/dashboard-item.screen.tsx.ejs +133 -0
  110. package/frontend/dashboard-item/components/update-panel.tsx.ejs +141 -0
  111. package/frontend/dashboard-item/locales/en/dashboard.dashboard-item.json +11 -0
  112. package/frontend/dashboard-item/locales/pt/dashboard.dashboard-item.json +11 -0
  113. package/frontend/dashboard-item/react-query/handlers.ts.ejs +28 -0
  114. package/frontend/dashboard-item/react-query/requests.ts.ejs +58 -0
  115. package/frontend/dashboard-user/components/create-panel.tsx.ejs +108 -0
  116. package/frontend/dashboard-user/components/dashboard-user.screen.tsx.ejs +131 -0
  117. package/frontend/dashboard-user/components/update-panel.tsx.ejs +138 -0
  118. package/frontend/dashboard-user/locales/en/dashboard.dashboard-user.json +11 -0
  119. package/frontend/dashboard-user/locales/pt/dashboard.dashboard-user.json +11 -0
  120. package/frontend/dashboard-user/react-query/handlers.ts.ejs +28 -0
  121. package/frontend/dashboard-user/react-query/requests.ts.ejs +58 -0
  122. package/frontend/translation/fields/en.json +23 -1
  123. package/frontend/translation/fields/pt.json +27 -1
  124. package/frontend/translation/modules/en.json +6 -1
  125. package/frontend/translation/modules/pt.json +6 -1
  126. package/hedhog.yaml +439 -0
  127. package/package.json +2 -2
  128. package/src/admin.module.ts +2 -0
  129. package/src/dashboard/dashboard/dashboard.controller.ts +49 -0
  130. package/src/dashboard/dashboard/dashboard.module.ts +13 -0
  131. package/src/dashboard/dashboard/dashboard.service.ts +71 -0
  132. package/src/dashboard/dashboard/dto/create.dto.ts +8 -0
  133. package/src/dashboard/dashboard/dto/update.dto.ts +4 -0
  134. package/src/dashboard/dashboard-component/dashboard-component.controller.ts +55 -0
  135. package/src/dashboard/dashboard-component/dashboard-component.module.ts +14 -0
  136. package/src/dashboard/dashboard-component/dashboard-component.service.ts +70 -0
  137. package/src/dashboard/dashboard-component/dto/create.dto.ts +36 -0
  138. package/src/dashboard/dashboard-component/dto/update.dto.ts +4 -0
  139. package/src/dashboard/dashboard-item/dashboard-item.controller.ts +55 -0
  140. package/src/dashboard/dashboard-item/dashboard-item.module.ts +13 -0
  141. package/src/dashboard/dashboard-item/dashboard-item.service.ts +82 -0
  142. package/src/dashboard/dashboard-item/dto/create.dto.ts +22 -0
  143. package/src/dashboard/dashboard-item/dto/update.dto.ts +4 -0
  144. package/src/dashboard/dashboard-user/dashboard-user.controller.ts +55 -0
  145. package/src/dashboard/dashboard-user/dashboard-user.module.ts +13 -0
  146. package/src/dashboard/dashboard-user/dashboard-user.service.ts +89 -0
  147. package/src/dashboard/dashboard-user/dto/create.dto.ts +22 -0
  148. package/src/dashboard/dashboard-user/dto/update.dto.ts +4 -0
  149. package/src/dashboard/dashboard.module.ts +22 -0
  150. package/src/dashboard/index.ts +1 -0
  151. package/frontend/menu-locale/locales/en/admin.menu-locale.json +0 -11
  152. package/frontend/menu-locale/locales/pt/admin.menu-locale.json +0 -11
  153. package/frontend/menu-screen/locales/en/admin.menu-screen.json +0 -11
  154. package/frontend/menu-screen/locales/pt/admin.menu-screen.json +0 -11
  155. package/frontend/multifactor-locale/locales/en/admin.multifactor-locale.json +0 -11
  156. package/frontend/multifactor-locale/locales/pt/admin.multifactor-locale.json +0 -11
  157. package/frontend/screen-locale/locales/en/admin.screen-locale.json +0 -11
  158. package/frontend/screen-locale/locales/pt/admin.screen-locale.json +0 -11
  159. package/frontend/translation/components/create-panel.tsx.ejs +0 -52
  160. package/frontend/translation/components/update-panel.tsx.ejs +0 -67
  161. package/frontend/translation/locales/en/admin.translation.json +0 -11
  162. package/frontend/translation/locales/pt/admin.translation.json +0 -11
  163. package/frontend/translation/react-query/handlers.ts.ejs +0 -28
  164. package/frontend/translation/react-query/requests.ts.ejs +0 -58
  165. package/frontend/translation-namespace/components/create-panel.tsx.ejs +0 -53
  166. package/frontend/translation-namespace/components/update-panel.tsx.ejs +0 -70
  167. package/frontend/translation-namespace/locales/en/admin.translation-namespace.json +0 -11
  168. package/frontend/translation-namespace/locales/pt/admin.translation-namespace.json +0 -11
  169. package/frontend/translation-namespace/react-query/handlers.ts.ejs +0 -28
  170. package/frontend/translation-namespace/react-query/requests.ts.ejs +0 -60
@@ -1,67 +0,0 @@
1
- import FormPanel, { FormPanelRef } from "@/components/panels/form-panel";
2
- import { Overlay } from "@/components/custom/overlay";
3
- import { TabPanel } from "@/components/panels/tab-panel";
4
- import {
5
- useTranslationGet,
6
- useTranslationUpdate,
7
- } from "@/features/admin/translation";
8
- import useEffectAfterFirstUpdate from "@/hooks/use-effect-after-first-update";
9
- import { Translation } from "@/types/models";
10
- import { useState, forwardRef, useImperativeHandle, useRef } from "react";
11
- import { useTranslation } from "react-i18next";
12
- import { IconEdit, IconPlus, IconTrash } from "@tabler/icons-react";
13
-
14
- export type TranslationUpdatePanelProps = {
15
- data: Translation;
16
- onUpdated?: (data: Translation) => void;
17
- };
18
-
19
- const TranslationUpdatePanel = forwardRef(
20
- ({ data, onUpdated }: TranslationUpdatePanelProps, ref) => {
21
- const { t } = useTranslation(["actions", "fields", "translations"]);
22
- const { data: item, isLoading } = useTranslationGet(data.id as number);
23
- const { mutate: translationUpdate } = useTranslationUpdate();
24
- const formRef = useRef<FormPanelRef>(null);
25
-
26
- useEffectAfterFirstUpdate(() => {
27
- if (item && formRef.current) {
28
- formRef.current.setValuesFromItem(item);
29
- }
30
- }, [item]);
31
-
32
- useImperativeHandle(ref, () => ({}));
33
-
34
- return (
35
- <TabPanel
36
- activeTabIndex={0}
37
- tabs={[
38
- {
39
- title: t("details", { ns: "actions" }),
40
- children: (
41
- <Overlay loading={isLoading}>
42
- <FormPanel
43
- ref={formRef}
44
- fields={[]}
45
- button={{ text: t("save", { ns: "actions" }) }}
46
- onSubmit={(data) => {
47
- translationUpdate({
48
- id: data.id,
49
- data,
50
- });
51
- if (typeof onUpdated === "function") {
52
- onUpdated(data);
53
- }
54
- }}
55
- />
56
- </Overlay>
57
- ),
58
- },
59
- ]}
60
- />
61
- );
62
- },
63
- );
64
-
65
- TranslationUpdatePanel.displayName = "TranslationUpdatePanel";
66
-
67
- export default TranslationUpdatePanel;
@@ -1,11 +0,0 @@
1
- {
2
- "create": "Create translation",
3
- "createText": "Fill the translation informations.",
4
- "createTooltip": "Create new translation",
5
- "delete": "Delete translation",
6
- "deleteText": "Are you sure to delete these translation?",
7
- "deleteTooltip": "Delete the selected translation",
8
- "edit": "Edit translation",
9
- "editText": "View and edit translation information.",
10
- "editTooltip": "Edit the selected translation"
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "create": "Criar translation",
3
- "createText": "Preencha as informações da translation.",
4
- "createTooltip": "Criar nova translation",
5
- "delete": "Excluir translation",
6
- "deleteText": "Você tem certeza de que deseja excluir estas translation?",
7
- "deleteTooltip": "Excluir a translation selecionada",
8
- "edit": "Editar translation",
9
- "editText": "Ver e editar as informações da translation.",
10
- "editTooltip": "Editar a translation selecionada"
11
- }
@@ -1,28 +0,0 @@
1
- import { useDefaultMutation } from "@/hooks/use-default-mutation";
2
- import { useQuery } from "@tanstack/react-query";
3
- import { requests } from "./requests";
4
-
5
- const scope = "translation";
6
-
7
- export function useTranslationCreate() {
8
- const { translationCreate } = requests();
9
- return useDefaultMutation(scope, "create", translationCreate);
10
- }
11
-
12
- export function useTranslationDelete() {
13
- const { translationDelete } = requests();
14
- return useDefaultMutation(scope, "delete", translationDelete);
15
- }
16
-
17
- export function useTranslationUpdate() {
18
- const { translationUpdate } = requests();
19
- return useDefaultMutation(scope, "update", translationUpdate);
20
- }
21
-
22
- export function useTranslationGet(id: number) {
23
- const { translationGet } = requests();
24
- return useQuery({
25
- queryKey: [scope, "get"],
26
- queryFn: () => translationGet(id),
27
- });
28
- }
@@ -1,58 +0,0 @@
1
- import { useApp } from "@/hooks/use-app";
2
- import { Delete, PaginationParams, PaginationResult } from "@/types";
3
- import { Translation } from "@/types/models";
4
- import { HttpMethod } from "@/types/http-method";
5
-
6
- export function requests() {
7
- const { request } = useApp();
8
-
9
- const translationList = async (params: PaginationParams) => {
10
- return request<PaginationResult<Translation>>({
11
- url: "/translation",
12
- params,
13
- }).then((res) => res.data);
14
- };
15
-
16
- const translationGet = async (id: number) => {
17
- return request<Translation>({
18
- url: `/translation/${id}`,
19
- }).then((res) => res.data);
20
- };
21
-
22
- const translationCreate = async (params: { data: Translation }) => {
23
- const { data } = params;
24
- return request<Translation>({
25
- url: "/translation",
26
- method: HttpMethod.POST,
27
- data: data,
28
- }).then((res) => res.data);
29
- };
30
-
31
- const translationDelete = async (ids: number[]) => {
32
- return request<Delete>({
33
- url: "/translation",
34
- data: { ids },
35
- method: HttpMethod.DELETE,
36
- }).then((res) => res.data);
37
- };
38
-
39
- const translationUpdate = async (params: {
40
- id: number;
41
- data: Translation;
42
- }) => {
43
- const { id, data } = params;
44
- return request<Translation>({
45
- url: `/translation/${id}`,
46
- method: HttpMethod.PATCH,
47
- data: data,
48
- }).then((res) => res.data);
49
- };
50
-
51
- return {
52
- translationCreate,
53
- translationUpdate,
54
- translationDelete,
55
- translationList,
56
- translationGet,
57
- };
58
- }
@@ -1,53 +0,0 @@
1
- import FormPanel, { FormPanelRef } from "@/components/panels/form-panel";
2
-
3
- import { useTranslationNamespaceCreate } from "@/features/admin/translation-namespace";
4
- import { TranslationNamespace } from "@/types/models";
5
- import { forwardRef, useImperativeHandle, useRef } from "react";
6
- import { useTranslation } from "react-i18next";
7
-
8
- export type TranslationNamespaceCreatePanelRef = {
9
- submit: () => void;
10
- };
11
-
12
- export type TranslationNamespaceCreatePanelProps = {
13
- onCreated?: (data: TranslationNamespace) => void;
14
- };
15
-
16
- const TranslationNamespaceCreatePanel = forwardRef(
17
- ({ onCreated }: TranslationNamespaceCreatePanelProps, ref) => {
18
- const formRef = useRef<FormPanelRef>(null);
19
- const { t } = useTranslation(["actions", "fields", "translations"]);
20
- const { mutateAsync: createTranslationNamespace } =
21
- useTranslationNamespaceCreate();
22
-
23
- useImperativeHandle(
24
- ref,
25
- () => ({
26
- submit: () => {
27
- formRef.current?.submit();
28
- },
29
- }),
30
- [formRef],
31
- );
32
-
33
- return (
34
- <FormPanel
35
- ref={formRef}
36
- fields={[]}
37
- button={{ text: t("create", { ns: "actions" }) }}
38
- onSubmit={async (data) => {
39
- const createdData = await createTranslationNamespace({
40
- data,
41
- });
42
- if (typeof onCreated === "function") {
43
- onCreated(createdData as any);
44
- }
45
- }}
46
- />
47
- );
48
- },
49
- );
50
-
51
- TranslationNamespaceCreatePanel.displayName = "TranslationNamespaceCreatePanel";
52
-
53
- export default TranslationNamespaceCreatePanel;
@@ -1,70 +0,0 @@
1
- import FormPanel, { FormPanelRef } from "@/components/panels/form-panel";
2
- import { Overlay } from "@/components/custom/overlay";
3
- import { TabPanel } from "@/components/panels/tab-panel";
4
- import {
5
- useTranslationNamespaceGet,
6
- useTranslationNamespaceUpdate,
7
- } from "@/features/admin/translation-namespace";
8
- import useEffectAfterFirstUpdate from "@/hooks/use-effect-after-first-update";
9
- import { TranslationNamespace } from "@/types/models";
10
- import { useState, forwardRef, useImperativeHandle, useRef } from "react";
11
- import { useTranslation } from "react-i18next";
12
- import { IconEdit, IconPlus, IconTrash } from "@tabler/icons-react";
13
-
14
- export type TranslationNamespaceUpdatePanelProps = {
15
- data: TranslationNamespace;
16
- onUpdated?: (data: TranslationNamespace) => void;
17
- };
18
-
19
- const TranslationNamespaceUpdatePanel = forwardRef(
20
- ({ data, onUpdated }: TranslationNamespaceUpdatePanelProps, ref) => {
21
- const { t } = useTranslation(["actions", "fields", "translations"]);
22
- const { data: item, isLoading } = useTranslationNamespaceGet(
23
- data.id as number,
24
- );
25
- const { mutate: translationNamespaceUpdate } =
26
- useTranslationNamespaceUpdate();
27
- const formRef = useRef<FormPanelRef>(null);
28
-
29
- useEffectAfterFirstUpdate(() => {
30
- if (item && formRef.current) {
31
- formRef.current.setValuesFromItem(item);
32
- }
33
- }, [item]);
34
-
35
- useImperativeHandle(ref, () => ({}));
36
-
37
- return (
38
- <TabPanel
39
- activeTabIndex={0}
40
- tabs={[
41
- {
42
- title: t("details", { ns: "actions" }),
43
- children: (
44
- <Overlay loading={isLoading}>
45
- <FormPanel
46
- ref={formRef}
47
- fields={[]}
48
- button={{ text: t("save", { ns: "actions" }) }}
49
- onSubmit={(data) => {
50
- translationNamespaceUpdate({
51
- id: data.id,
52
- data,
53
- });
54
- if (typeof onUpdated === "function") {
55
- onUpdated(data);
56
- }
57
- }}
58
- />
59
- </Overlay>
60
- ),
61
- },
62
- ]}
63
- />
64
- );
65
- },
66
- );
67
-
68
- TranslationNamespaceUpdatePanel.displayName = "TranslationNamespaceUpdatePanel";
69
-
70
- export default TranslationNamespaceUpdatePanel;
@@ -1,11 +0,0 @@
1
- {
2
- "create": "Create translation namespace",
3
- "createText": "Fill the translation namespace informations.",
4
- "createTooltip": "Create new translation namespace",
5
- "delete": "Delete translation namespace",
6
- "deleteText": "Are you sure to delete these translation namespace?",
7
- "deleteTooltip": "Delete the selected translation namespace",
8
- "edit": "Edit translation namespace",
9
- "editText": "View and edit translation namespace information.",
10
- "editTooltip": "Edit the selected translation namespace"
11
- }
@@ -1,11 +0,0 @@
1
- {
2
- "create": "Criar translation namespace",
3
- "createText": "Preencha as informações do translation namespace.",
4
- "createTooltip": "Criar novo translation namespace",
5
- "delete": "Excluir translation namespace",
6
- "deleteText": "Você tem certeza de que deseja excluir estes translation namespace?",
7
- "deleteTooltip": "Excluir o translation namespace selecionado",
8
- "edit": "Editar translation namespace",
9
- "editText": "Visualizar e editar informações do translation namespace.",
10
- "editTooltip": "Editar o translation namespace selecionado"
11
- }
@@ -1,28 +0,0 @@
1
- import { useDefaultMutation } from "@/hooks/use-default-mutation";
2
- import { useQuery } from "@tanstack/react-query";
3
- import { requests } from "./requests";
4
-
5
- const scope = "translation-namespace";
6
-
7
- export function useTranslationNamespaceCreate() {
8
- const { translationNamespaceCreate } = requests();
9
- return useDefaultMutation(scope, "create", translationNamespaceCreate);
10
- }
11
-
12
- export function useTranslationNamespaceDelete() {
13
- const { translationNamespaceDelete } = requests();
14
- return useDefaultMutation(scope, "delete", translationNamespaceDelete);
15
- }
16
-
17
- export function useTranslationNamespaceUpdate() {
18
- const { translationNamespaceUpdate } = requests();
19
- return useDefaultMutation(scope, "update", translationNamespaceUpdate);
20
- }
21
-
22
- export function useTranslationNamespaceGet(id: number) {
23
- const { translationNamespaceGet } = requests();
24
- return useQuery({
25
- queryKey: [scope, "get"],
26
- queryFn: () => translationNamespaceGet(id),
27
- });
28
- }
@@ -1,60 +0,0 @@
1
- import { useApp } from "@/hooks/use-app";
2
- import { Delete, PaginationParams, PaginationResult } from "@/types";
3
- import { TranslationNamespace } from "@/types/models";
4
- import { HttpMethod } from "@/types/http-method";
5
-
6
- export function requests() {
7
- const { request } = useApp();
8
-
9
- const translationNamespaceList = async (params: PaginationParams) => {
10
- return request<PaginationResult<TranslationNamespace>>({
11
- url: "/translation-namespace",
12
- params,
13
- }).then((res) => res.data);
14
- };
15
-
16
- const translationNamespaceGet = async (id: number) => {
17
- return request<TranslationNamespace>({
18
- url: `/translation-namespace/${id}`,
19
- }).then((res) => res.data);
20
- };
21
-
22
- const translationNamespaceCreate = async (params: {
23
- data: TranslationNamespace;
24
- }) => {
25
- const { data } = params;
26
- return request<TranslationNamespace>({
27
- url: "/translation-namespace",
28
- method: HttpMethod.POST,
29
- data: data,
30
- }).then((res) => res.data);
31
- };
32
-
33
- const translationNamespaceDelete = async (ids: number[]) => {
34
- return request<Delete>({
35
- url: "/translation-namespace",
36
- data: { ids },
37
- method: HttpMethod.DELETE,
38
- }).then((res) => res.data);
39
- };
40
-
41
- const translationNamespaceUpdate = async (params: {
42
- id: number;
43
- data: TranslationNamespace;
44
- }) => {
45
- const { id, data } = params;
46
- return request<TranslationNamespace>({
47
- url: `/translation-namespace/${id}`,
48
- method: HttpMethod.PATCH,
49
- data: data,
50
- }).then((res) => res.data);
51
- };
52
-
53
- return {
54
- translationNamespaceCreate,
55
- translationNamespaceUpdate,
56
- translationNamespaceDelete,
57
- translationNamespaceList,
58
- translationNamespaceGet,
59
- };
60
- }