trithuc-mvc-react 2.6.4 → 2.6.5

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.
@@ -37,6 +37,7 @@ DataManagement.propTypes = {
37
37
  disableStatus: PropTypes.bool,
38
38
  disableAdd: PropTypes.bool,
39
39
  disableCellThaoTac: PropTypes.bool,
40
+ reserPage: PropTypes.string,
40
41
  statusKey: PropTypes.string,
41
42
  tableActions: PropTypes.array,
42
43
  disableEditor: PropTypes.bool,
@@ -52,6 +53,7 @@ const getDefaultValues = (filters = []) => {
52
53
  return defaultValues;
53
54
  };
54
55
  function DataManagement({
56
+ reserPage = false,
55
57
  sttLuyKe = false,
56
58
  columns = [],
57
59
  title,
@@ -87,7 +89,7 @@ function DataManagement({
87
89
  const [selectedEditItem, setSelectedEditItem] = useState(null);
88
90
  const [openViewDialog, setOpenViewDialog] = useState(false);
89
91
 
90
- const { canCreate } = usePermission(apiUrl?apiUrl:tableName);
92
+ const { canCreate } = usePermission(apiUrl ? apiUrl : tableName);
91
93
  const { defaults, filters } = useMemo(() => {
92
94
  const filters = tableFilters.filter(({ type }) => type !== "default");
93
95
  const defaultFilters = tableFilters.filter(({ type }) => type === "default");
@@ -113,9 +115,16 @@ function DataManagement({
113
115
  const [dataSearch, setDataSearch] = useState({ ...defaults, ...getDefaultValues(filters) });
114
116
  const [page, setPage] = useState(0);
115
117
 
118
+ useEffect(() => {
119
+ if (reserPage) {
120
+ setPage(0);
121
+ }
122
+ }, [reserPage]);
123
+
116
124
  const values = useMemo(() => {
117
125
  const hasTabpanel = !!tabPanel;
118
126
  return {
127
+ reserPage,
119
128
  sttLuyKe,
120
129
  apiUrl,
121
130
  tableName,
@@ -140,6 +149,7 @@ function DataManagement({
140
149
  defaultRowsPerPage
141
150
  };
142
151
  }, [
152
+ reserPage,
143
153
  sttLuyKe,
144
154
  apiUrl,
145
155
  tableName,
@@ -215,7 +225,13 @@ function DataManagement({
215
225
  {tabPanel}
216
226
  <FilterGod filters={filters} elementSize={elementSize} setPage={setPage} />
217
227
  {backParentNavigator}
218
- <DataTable multipleActions={multipleActions} page={page} setPage={setPage} disableEdit={disableEdit} disableDelete = {disableDelete}/>
228
+ <DataTable
229
+ multipleActions={multipleActions}
230
+ page={page}
231
+ setPage={setPage}
232
+ disableEdit={disableEdit}
233
+ disableDelete={disableDelete}
234
+ />
219
235
  </Card>
220
236
  </FormProvider>
221
237
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trithuc-mvc-react",
3
- "version": "2.6.4",
3
+ "version": "2.6.5",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"