@galadrim/galadmin 0.0.57 → 0.0.61

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 (28) hide show
  1. package/dist/tsconfig.tsbuildinfo +1 -1
  2. package/dist/types/config.d.ts +4 -1
  3. package/package.json +1 -1
  4. package/src/front/build/asset-manifest.json +7 -7
  5. package/src/front/build/index.html +1 -1
  6. package/src/front/build/static/js/2.88bb9cea.chunk.js +3 -0
  7. package/src/front/build/static/js/{2.a36e796c.chunk.js.LICENSE.txt → 2.88bb9cea.chunk.js.LICENSE.txt} +0 -0
  8. package/src/front/build/static/js/2.88bb9cea.chunk.js.map +1 -0
  9. package/src/front/build/static/js/main.f671b7bf.chunk.js +2 -0
  10. package/src/front/build/static/js/main.f671b7bf.chunk.js.map +1 -0
  11. package/src/front/node_modules/.cache/.eslintcache +1 -1
  12. package/src/front/node_modules/.cache/babel-loader/4b3b5abfa752c54455d4121d45617b4c.json +1 -0
  13. package/src/front/node_modules/.cache/babel-loader/a39a631f24d0f6da6680c7a0eb1909b1.json +1 -0
  14. package/src/front/node_modules/.cache/babel-loader/cd53713ec61cb5f5e41e728d0d93a34d.json +1 -0
  15. package/src/front/node_modules/.cache/babel-loader/f4b762bafa9d1a3fcfbe0c8e214442c1.json +1 -0
  16. package/src/front/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/02/1c/cd922a30b837866c304e653fd02dc10a713290b65b1a3f8ab96fac6e8d3d8153afdd05cd2f39ac5a2b666bbc7c16e0a5a909a50abc0640d631f50f2d5405 +1 -0
  17. package/src/front/node_modules/.cache/terser-webpack-plugin/content-v2/sha512/d5/cf/96de587f0cb4e418c632ab27dbbd500bcab68ea7fb248ae81f6dd985dd6d246fb0e750a0d7ebb77492a99e8d2005508b59dbe9bba0648e953c16d59b3d7a +1 -0
  18. package/src/front/node_modules/.cache/terser-webpack-plugin/index-v5/32/f1/8264252bcf7c4f98cde13450968b415f55003188f30504894efa85c8e42b +2 -0
  19. package/src/front/node_modules/.cache/terser-webpack-plugin/index-v5/53/d5/b9bcc0fa8502a73041536a2125defd24a63f359a32b297f88427b557127b +2 -0
  20. package/src/front/src/App.js +5 -1
  21. package/src/front/src/components/RedirectToFirstView.js +24 -0
  22. package/src/front/src/pages/CreateRecord.js +5 -1
  23. package/src/front/src/pages/Record.js +1 -1
  24. package/src/types/config.ts +6 -1
  25. package/src/front/build/static/js/2.a36e796c.chunk.js +0 -3
  26. package/src/front/build/static/js/2.a36e796c.chunk.js.map +0 -1
  27. package/src/front/build/static/js/main.6ea0ec11.chunk.js +0 -2
  28. package/src/front/build/static/js/main.6ea0ec11.chunk.js.map +0 -1
@@ -0,0 +1,2 @@
1
+
2
+ 178999eb683bae88c3259dea7a5b5bd704b5f969 {"key":"{\"terser\":\"5.7.1\",\"terser-webpack-plugin\":\"4.2.3\",\"terser-webpack-plugin-options\":{\"test\":new RegExp(\"\\\\.[cm]?js(\\\\?.*)?$\", \"i\"),\"extractComments\":true,\"sourceMap\":true,\"cache\":true,\"cacheKeys\":defaultCacheKeys => defaultCacheKeys,\"parallel\":true,\"include\":undefined,\"exclude\":undefined,\"minify\":undefined,\"terserOptions\":{\"parse\":{\"ecma\":8},\"compress\":{\"ecma\":5,\"warnings\":false,\"comparisons\":false,\"inline\":2},\"mangle\":{\"safari10\":true},\"keep_classnames\":false,\"keep_fnames\":false,\"output\":{\"ecma\":5,\"comments\":false,\"ascii_only\":true},\"ecma\":5}},\"name\":\"static\\u002Fjs\\u002F2.88bb9cea.chunk.js\",\"contentHash\":\"01567565c347bca09e20\"}","integrity":"sha512-AhzNkiowuDeGbDBOZT/QLcEKcTKQtlsaP4q5b6xujT2BU6/dBc0vOaxaK2ZrvHwW4KWpCaUKvAZA1jH1Dy1UBQ==","time":1640166099977,"size":1866754}
@@ -0,0 +1,2 @@
1
+
2
+ 534b55100dc10a94d5fd5690a33c50cc4fe96803 {"key":"{\"terser\":\"5.7.1\",\"terser-webpack-plugin\":\"4.2.3\",\"terser-webpack-plugin-options\":{\"test\":new RegExp(\"\\\\.[cm]?js(\\\\?.*)?$\", \"i\"),\"extractComments\":true,\"sourceMap\":true,\"cache\":true,\"cacheKeys\":defaultCacheKeys => defaultCacheKeys,\"parallel\":true,\"include\":undefined,\"exclude\":undefined,\"minify\":undefined,\"terserOptions\":{\"parse\":{\"ecma\":8},\"compress\":{\"ecma\":5,\"warnings\":false,\"comparisons\":false,\"inline\":2},\"mangle\":{\"safari10\":true},\"keep_classnames\":false,\"keep_fnames\":false,\"output\":{\"ecma\":5,\"comments\":false,\"ascii_only\":true},\"ecma\":5}},\"name\":\"static\\u002Fjs\\u002Fmain.f671b7bf.chunk.js\",\"contentHash\":\"b61b105d61b94b29d737\"}","integrity":"sha512-1c+W3lh/DLTkGMYyqyfbvVALyraOp/skiugfbdmF3W0kb7DnUKDX67d0kqmejSAFUItZ2+m7oGSOlTwW1Zs9eg==","time":1640166096886,"size":335112}
@@ -6,6 +6,7 @@ import {
6
6
  import { useEffect, useState } from "react";
7
7
  import './App.css';
8
8
  import Sidebar from './components/Sidebar'
9
+ import RedirectToFirstView from './components/RedirectToFirstView'
9
10
  import CreateRecord from './pages/CreateRecord'
10
11
  import EditRecord from './pages/EditRecord'
11
12
  import Records from './pages/Records'
@@ -17,7 +18,7 @@ import { ConfigProvider } from './contexts/ConfigContext'
17
18
  import axios from "axios";
18
19
 
19
20
  axios.defaults.withCredentials = true;
20
- axios.defaults.baseURL = process.env.NODE_ENV === "development" ? 'http://localhost:6145/admin/api' : '/_HOMEPAGE_/api';
21
+ axios.defaults.baseURL = process.env.NODE_ENV === "development" ? 'http://localhost/admin/api' : '/_HOMEPAGE_/api';
21
22
 
22
23
  function App() {
23
24
  const [isAuthenticated, setIsAuthenticated] = useState(null);
@@ -53,6 +54,9 @@ function App() {
53
54
  <Route path="/customView/:viewIndex">
54
55
  <CustomView />
55
56
  </Route>
57
+ <Route path="/">
58
+ <RedirectToFirstView />
59
+ </Route>
56
60
  </Switch>
57
61
  </Router>
58
62
  </ConfigProvider>
@@ -0,0 +1,24 @@
1
+ import { useContext } from "react"
2
+ import {
3
+ Redirect
4
+ } from "react-router-dom";
5
+ import { ConfigContext } from '../contexts/ConfigContext'
6
+
7
+ export default () => {
8
+ const config = useContext(ConfigContext)
9
+ const firstView = config.views[0]
10
+
11
+ if (!firstView) {
12
+ return null
13
+ }
14
+ if (firstView.type === "table") {
15
+ return <Redirect to="/records/0" />
16
+ }
17
+ if (firstView.type === "iframe") {
18
+ return <Redirect to="/iframe/0" />
19
+ }
20
+ if (firstView.type === "custom") {
21
+ return <Redirect to="/customView/0" />
22
+ }
23
+ return null;
24
+ }
@@ -49,7 +49,11 @@ export default () => {
49
49
  data: data.current
50
50
  })
51
51
  setIsCreating(false)
52
- history.push(`/records/${viewIndex}`)
52
+ if (recordId) {
53
+ history.push(`/record/${viewIndex}/${recordId}`)
54
+ } else {
55
+ history.push(`/records/${viewIndex}`)
56
+ }
53
57
  } catch (error) {
54
58
  if (error.response.responseText) {
55
59
  window.swal({
@@ -19,7 +19,7 @@ export default () => {
19
19
  const [record, setRecord] = useState(null);
20
20
 
21
21
  const view = config.views[viewIndex]
22
- const filteredColumns = view.columns?.filter(x => !x.hideInTable && !x.hidden)
22
+ const filteredColumns = view.columns?.filter(x => !x.hidden)
23
23
 
24
24
  useEffect(() => {
25
25
  axios.get("/record", {
@@ -224,7 +224,12 @@ export type CustomView = {
224
224
  componentPath: string
225
225
  }
226
226
 
227
- export type View = TableView | IframeView | LinkView | CustomView
227
+ export type BaseTypeView = {
228
+ /** Cache la vue dans le menu latéral */
229
+ hidden?: boolean
230
+ }
231
+
232
+ export type View = BaseTypeView & (TableView | IframeView | LinkView | CustomView)
228
233
 
229
234
  export type Config = {
230
235
  /** Nom du projet */