adminizer 4.1.0-build.3 → 4.1.0-build.30
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.
- package/Readme.md +11 -1
- package/assets/{VanillaJSONEditor-FUe77pIA.js → VanillaJSONEditor-DKF_Ft1S.js} +96 -96
- package/assets/add-BA0ZgbVP.js +1 -0
- package/assets/add-form-D5PNdz6X.js +1 -0
- package/assets/add-group-BqvmQRDY.js +1 -0
- package/assets/{add-group-form-dzadPSfL.js → add-group-form-D1P6v9Fm.js} +1 -1
- package/assets/add-user-C31g3pXW.js +1 -0
- package/assets/add-user-form-DyczuE4l.js +1 -0
- package/assets/{app-DMmad2-f.css → app-ClS67l37.css} +1 -1
- package/assets/app-layout-CQTlWDgg.js +1 -0
- package/assets/{app-shell-BWMRMkHM.js → app-shell-B4pzTbiN.js} +1 -1
- package/assets/app-sidebar-DX9Shcd3.js +1 -0
- package/assets/{app-sidebar-header-DLAFi13E.js → app-sidebar-header-BcZ0JSSJ.js} +1 -1
- package/assets/app.js +9 -9
- package/assets/{breadcrumbs-CQNon4Vl.js → breadcrumbs-DIhfOCvh.js} +1 -1
- package/assets/{button-CQ9t1kLz.js → button-DleSKY4-.js} +1 -1
- package/assets/catalog-BHbLV-zr.js +12 -0
- package/assets/catalog-CZUI8zho.css +1 -0
- package/assets/{checkbox-W0nGAXIj.js → checkbox-DgmLwxEt.js} +1 -1
- package/assets/{compiler-runtime-tM4jBQ-T.js → compiler-runtime-CMDe02AS.js} +1 -1
- package/assets/dashboard-BOltB2Hq.css +1 -0
- package/assets/dashboard-BiycZ-vC.js +3 -0
- package/assets/{date-picker-B__dVVqj.js → date-picker-Cb6A4Zx_.js} +1 -1
- package/assets/dialog-stack-DU4Ow4Oa.js +1 -0
- package/assets/{dropdown-menu-SEBnEIiL.js → dropdown-menu-D3vlxbLx.js} +1 -1
- package/assets/{field-renderer-CapylJU9.js → field-renderer-CW8TLtlI.js} +3 -3
- package/assets/form-CLP53RtV.js +1 -0
- package/assets/form-CwSId-Cu.js +1 -0
- package/assets/{geo-json-CwteYDGB.js → geo-json-BNgLxoVs.js} +1 -1
- package/assets/group-add-Brshb-tH.js +1 -0
- package/assets/{handsontable-BCnjOpBr.js → handsontable-BI4C0OBe.js} +1 -1
- package/assets/home-BRJ6eKVn.js +2 -0
- package/assets/{icon-Bz9BMaD0.js → icon-DLHMhF_-.js} +1 -1
- package/assets/{index-BcE9FUM6.js → index-BRQOFOzQ.js} +1 -1
- package/assets/{index-C0SL3SHw.js → index-BZZx7KCI.js} +1 -1
- package/assets/{index-DTRTjOmh.js → index-BpVWRzP4.js} +2 -2
- package/assets/{index-BbXEMx9n.js → index-Bz0y23v2.js} +1 -1
- package/assets/index-C148XJoK.js +1 -0
- package/assets/index-C8anOJBB.js +1 -0
- package/assets/{index-DEk3sC8d.js → index-CS5ssiKu.js} +1 -1
- package/assets/index-CsMwA9pu.js +1 -0
- package/assets/{index-DrWfGwtf.js → index-HZzILD42.js} +1 -1
- package/assets/{index-BC0yfOHo.js → index-kzaPFHKt.js} +1 -1
- package/assets/{init-user-D9mW-g14.js → init-user-VMPNdivw.js} +1 -1
- package/assets/{input-DF7Ue23C.js → input-CZTX-THl.js} +1 -1
- package/assets/{input-error-BBygona6.js → input-error-DpUrcJaR.js} +1 -1
- package/assets/item-add-1duKvWXz.js +1 -0
- package/assets/{label-Z506NKsW.js → label-B1wVTLjK.js} +1 -1
- package/assets/list-C07llS61.js +1 -0
- package/assets/{list-table-DB1sEQLF.js → list-table-Bh8E-zkN.js} +11 -16
- package/assets/{login-DrGaTWhY.js → login-Dl59_ycU.js} +1 -1
- package/assets/manifest.json +735 -564
- package/assets/{material-icon-CItZiB53.js → material-icon-C9IuCi5R.js} +1 -1
- package/assets/module-DwX7rlQ2.js +1 -0
- package/assets/{monaco-editor-DqAqwxw4.js → monaco-editor-DjLNSn-O.js} +1 -1
- package/assets/{multi-select-oabtVhUP.js → multi-select-CvcWwfki.js} +2 -2
- package/assets/{nav-footer-CM-yHiRs.js → nav-footer-C7_pEHmX.js} +1 -1
- package/assets/{nav-main-Q3xofGRT.js → nav-main-CwwCPIYf.js} +1 -1
- package/assets/{nav-user-Ds8i0Pa2.js → nav-user-K0xXPEmb.js} +1 -1
- package/assets/{pagination-render-B57pOpFy.js → pagination-render-BYBw11L4.js} +1 -1
- package/assets/pencil-CewBKDRo.js +6 -0
- package/assets/{popover-I249Gg2O.js → popover-vHKm7zkm.js} +1 -1
- package/assets/{register-C9FQIDtS.js → register-CRsK6KgL.js} +1 -1
- package/assets/{select-D1N8zRPY.js → select-Bs9mijkr.js} +2 -2
- package/assets/{sidebar-4D-sX2l4.js → sidebar-DflSp1X1.js} +2 -2
- package/assets/skeleton-C6UluiCK.js +1 -0
- package/assets/{sonner-Dzckw3U3.js → sonner-Cn7ueXZc.js} +1 -1
- package/assets/{toast-editor-FbrFd1ft.js → toast-editor-FNxkBiFw.js} +1 -1
- package/assets/{tooltip-D2ehgLlB.js → tooltip-BlR1mf2V.js} +1 -1
- package/assets/{use-appearance-Co6mO0dV.js → use-appearance-CL1-5ZfQ.js} +1 -1
- package/assets/{use-window-size-B8l6Bpkf.js → use-window-size-ciZdUHrJ.js} +1 -1
- package/assets/{user-info-DBYoAJYJ.js → user-info-qduQAMOl.js} +2 -2
- package/assets/{user-menu-content-qkvdkUVd.js → user-menu-content-Cjq658jE.js} +2 -2
- package/assets/welcome-CbHEVD33.js +1 -0
- package/controllers/add.js +9 -10
- package/controllers/addGroup.js +2 -4
- package/controllers/addUser.js +4 -6
- package/controllers/catalog/Catalog.d.ts +1 -1
- package/controllers/catalog/Catalog.js +42 -34
- package/controllers/catalog/FrontentCatalogAdapter.d.ts +43 -21
- package/controllers/catalog/FrontentCatalogAdapter.js +49 -30
- package/controllers/ckeditorUpload.js +2 -3
- package/controllers/dashboard.js +16 -2
- package/controllers/edit.js +4 -5
- package/controllers/editGroup.js +2 -4
- package/controllers/editUser.js +3 -5
- package/controllers/form.js +2 -3
- package/controllers/getAllWidgets.js +3 -3
- package/controllers/initUser.js +1 -2
- package/controllers/list.js +6 -6
- package/controllers/login.js +31 -15
- package/controllers/media-manager/mediaManagerAdapter.js +1 -2
- package/controllers/media-manager/mediaManagerApi.js +2 -2
- package/controllers/navigation/edit.js +2 -2
- package/controllers/register.js +1 -4
- package/controllers/remove.js +3 -3
- package/controllers/timezones.js +1 -1
- package/controllers/view.js +3 -3
- package/controllers/welcome.js +1 -1
- package/controllers/widgets/Action.js +2 -2
- package/controllers/widgets/Custom.js +2 -2
- package/controllers/widgets/Info.js +2 -2
- package/controllers/widgets/switch.js +2 -2
- package/controllers/widgetsDB.js +5 -5
- package/helpers/JsUtils.d.ts +1 -0
- package/helpers/JsUtils.js +3 -0
- package/helpers/accessRightsHelper.d.ts +6 -2
- package/helpers/accessRightsHelper.js +26 -3
- package/helpers/configHelper.js +2 -1
- package/helpers/controllerHelper.js +1 -1
- package/helpers/fieldsHelper.d.ts +4 -3
- package/helpers/fieldsHelper.js +5 -1
- package/helpers/inertiaActionsHelper.js +1 -1
- package/helpers/inertiaAddHelper.d.ts +3 -4
- package/helpers/inertiaAddHelper.js +27 -7
- package/helpers/inertiaFromHelper.js +2 -0
- package/helpers/inertiaGroupHelper.d.ts +4 -2
- package/helpers/inertiaGroupHelper.js +1 -1
- package/helpers/inertiaListHelper.js +5 -5
- package/helpers/inertiaMenuHelper.d.ts +1 -1
- package/helpers/inertiaMenuHelper.js +2 -2
- package/helpers/inertiaUserHelper.d.ts +7 -1
- package/helpers/inertiaUserHelper.js +5 -1
- package/helpers/menuHelper.d.ts +4 -3
- package/helpers/menuHelper.js +22 -15
- package/index.d.ts +5 -3
- package/index.js +8 -3
- package/interfaces/adminpanelConfig.d.ts +28 -31
- package/interfaces/global.d.ts +10 -28
- package/interfaces/types.d.ts +1 -1
- package/lib/Adminizer.d.ts +4 -2
- package/lib/Adminizer.js +32 -10
- package/lib/media-manager/AbstractMediaManager.d.ts +2 -2
- package/lib/media-manager/AbstractMediaManager.js +1 -1
- package/lib/media-manager/Items.js +0 -3
- package/lib/requestProcessor.js +10 -3
- package/lib/v4/DataAccessor.d.ts +5 -2
- package/lib/v4/DataAccessor.js +44 -19
- package/lib/v4/I18n.js +2 -0
- package/lib/v4/POWCaptcha.js +0 -1
- package/lib/v4/PolicyManager.js +0 -1
- package/lib/{catalog → v4/catalog}/AbstractCatalog.d.ts +87 -31
- package/lib/{catalog → v4/catalog}/AbstractCatalog.js +38 -34
- package/lib/v4/catalog/Navigation.d.ts +43 -0
- package/lib/v4/catalog/Navigation.js +462 -0
- package/lib/{controls → v4/controls}/AbstractControls.d.ts +1 -1
- package/lib/{controls → v4/controls}/codeEditor/MonacoEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/geojsoneditor/GeoEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/jsoneditor/JsonEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/markdown/ToastUiEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/table/Handsontable.d.ts +1 -1
- package/lib/{controls → v4/controls}/wysiwyg/CKeditor.d.ts +1 -1
- package/lib/{datatable → v4/datatable}/NodeTable.d.ts +3 -3
- package/lib/{datatable → v4/datatable}/NodeTable.js +8 -8
- package/lib/v4/helper/jwt.d.ts +10 -0
- package/lib/v4/helper/jwt.js +18 -0
- package/lib/{inertia → v4/inertia}/inertiaAdapter.js +0 -1
- package/lib/v4/model/AbstractModel.d.ts +5 -1
- package/lib/v4/model/AbstractModel.js +2 -3
- package/lib/v4/model/ModelHandler.js +1 -1
- package/lib/v4/model/adapter/sequelize.d.ts +11 -2
- package/lib/v4/model/adapter/sequelize.js +451 -118
- package/lib/v4/model/adapter/waterline.js +5 -3
- package/lib/{widgets → v4/widgets}/abstractAction.d.ts +1 -1
- package/lib/v4/widgets/abstractCustom.d.ts +28 -0
- package/lib/v4/widgets/abstractCustom.js +9 -0
- package/lib/{widgets → v4/widgets}/abstractInfo.d.ts +1 -1
- package/lib/{widgets → v4/widgets}/abstractInfo.js +1 -1
- package/lib/{widgets → v4/widgets}/abstractLink.d.ts +2 -1
- package/lib/{widgets → v4/widgets}/abstractSwitch.d.ts +1 -1
- package/lib/{widgets → v4/widgets}/abstractWidgetBase.d.ts +2 -2
- package/lib/{widgets → v4/widgets}/widgetHandler.d.ts +29 -5
- package/lib/{widgets → v4/widgets}/widgetHandler.js +25 -25
- package/models/GroupAP.d.ts +8 -0
- package/models/NavigationAP.d.ts +7 -3
- package/models/NavigationAP.js +5 -6
- package/models/UserAP.d.ts +24 -2
- package/models/UserAP.js +2 -2
- package/package.json +25 -13
- package/policies/checkAuth.js +4 -3
- package/policies/setLocale.js +2 -2
- package/system/Router.js +8 -16
- package/system/bindAccessRights.js +0 -4
- package/system/bindAuthorization.js +4 -5
- package/system/bindControls.js +6 -6
- package/system/bindDev.js +1 -0
- package/system/bindInertia.js +12 -11
- package/system/bindMediaManager.js +0 -1
- package/system/bindModels.js +7 -2
- package/system/bindNavigation.d.ts +2 -0
- package/system/bindNavigation.js +42 -42
- package/system/bindReqFunctions.js +15 -0
- package/translations/ru.json +17 -8
- package/assets/add-ZITr43GJ.js +0 -1
- package/assets/add-form-CYOfr0Ef.js +0 -1
- package/assets/add-group-B332wN8K.js +0 -1
- package/assets/add-user-TC-mYdsB.js +0 -1
- package/assets/add-user-form-y2f_1_lM.js +0 -1
- package/assets/app-layout-D1m9Kvxq.js +0 -1
- package/assets/app-sidebar-BCtaEFGb.js +0 -1
- package/assets/dashboard-BR602KhL.js +0 -1
- package/assets/form-DOUNk3o2.js +0 -1
- package/assets/form-lOKv4Qbw.js +0 -1
- package/assets/home-Ch6QfTIt.js +0 -2
- package/assets/index-Cdb9ACvz.js +0 -1
- package/assets/index-K81GbF6O.js +0 -1
- package/assets/list-Qyd7ecQH.js +0 -1
- package/assets/module-DBaykv8l.js +0 -1
- package/assets/welcome-D2adQ8EU.js +0 -1
- package/controllers/processInstallFinalize.d.ts +0 -1
- package/controllers/processInstallFinalize.js +0 -16
- package/controllers/processInstallStep.d.ts +0 -1
- package/controllers/processInstallStep.js +0 -132
- package/lib/catalog/Navigation.d.ts +0 -0
- package/lib/catalog/Navigation.js +0 -532
- package/lib/installStepper/InstallStepAbstract.d.ts +0 -52
- package/lib/installStepper/InstallStepAbstract.js +0 -69
- package/lib/installStepper/finalizeStep.d.ts +0 -21
- package/lib/installStepper/finalizeStep.js +0 -48
- package/lib/installStepper/installStepper.d.ts +0 -40
- package/lib/installStepper/installStepper.js +0 -195
- package/lib/widgets/abstractCustom.d.ts +0 -13
- package/lib/widgets/abstractCustom.js +0 -3
- package/models/MediaManagerAP.d.ts +0 -46
- package/models/MediaManagerAP.js +0 -45
- package/models/MediaManagerAssociationsAP.d.ts +0 -28
- package/models/MediaManagerAssociationsAP.js +0 -27
- package/models/MediaManagerMetaAP.d.ts +0 -22
- package/models/MediaManagerMetaAP.js +0 -21
- package/system/bindInstallStepper.d.ts +0 -2
- package/system/bindInstallStepper.js +0 -23
- /package/lib/{catalog → v4/catalog}/CatalogHandler.d.ts +0 -0
- /package/lib/{catalog → v4/catalog}/CatalogHandler.js +0 -0
- /package/lib/{controls → v4/controls}/AbstractControls.js +0 -0
- /package/lib/{controls → v4/controls}/ControlsHandler.d.ts +0 -0
- /package/lib/{controls → v4/controls}/ControlsHandler.js +0 -0
- /package/lib/{controls → v4/controls}/codeEditor/MonacoEditor.js +0 -0
- /package/lib/{controls → v4/controls}/geojsoneditor/GeoEditor.js +0 -0
- /package/lib/{controls → v4/controls}/jsoneditor/JsonEditor.js +0 -0
- /package/lib/{controls → v4/controls}/markdown/ToastUiEditor.js +0 -0
- /package/lib/{controls → v4/controls}/table/Handsontable.js +0 -0
- /package/lib/{controls → v4/controls}/wysiwyg/CKeditor.js +0 -0
- /package/lib/{inertia → v4/inertia}/flash.d.ts +0 -0
- /package/lib/{inertia → v4/inertia}/flash.js +0 -0
- /package/lib/{inertia → v4/inertia}/inertiaAdapter.d.ts +0 -0
- /package/lib/{widgets → v4/widgets}/abstractAction.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractLink.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractSwitch.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractWidgetBase.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as F,r as g,j as c}from"./app.js";import{c as S}from"./compiler-runtime-CMDe02AS.js";import{c as U,a as M,u as w}from"./index-D5ir9iUV.js";import{P as y}from"./index-CsMwA9pu.js";import{c as I}from"./utils-DjqsqOe8.js";import"./index-HZzILD42.js";var E={exports:{}},A={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* use-sync-external-store-shim.production.js
|
|
4
4
|
*
|
|
@@ -6,4 +6,4 @@ import{d as F,r as g,j as c}from"./app.js";import{c as S}from"./compiler-runtime
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var j;function P(){if(j)return A;j=1;var a=F();function e(o,i){return o===i&&(o!==0||1/o===1/i)||o!==o&&i!==i}var t=typeof Object.is=="function"?Object.is:e,r=a.useState,s=a.useEffect,n=a.useLayoutEffect,f=a.useDebugValue;function l(o,i){var m=i(),h=r({inst:{value:m,getSnapshot:i}}),p=h[0].inst,x=h[1];return n(function(){p.value=m,p.getSnapshot=i,u(p)&&x({inst:p})},[o,m,i]),s(function(){return u(p)&&x({inst:p}),o(function(){u(p)&&x({inst:p})})},[o]),f(m),m}function u(o){var i=o.getSnapshot;o=o.value;try{var m=i();return!t(o,m)}catch{return!0}}function d(o,i){return i()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return A.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:v,A}var
|
|
9
|
+
*/var j;function P(){if(j)return A;j=1;var a=F();function e(o,i){return o===i&&(o!==0||1/o===1/i)||o!==o&&i!==i}var t=typeof Object.is=="function"?Object.is:e,r=a.useState,s=a.useEffect,n=a.useLayoutEffect,f=a.useDebugValue;function l(o,i){var m=i(),h=r({inst:{value:m,getSnapshot:i}}),p=h[0].inst,x=h[1];return n(function(){p.value=m,p.getSnapshot=i,u(p)&&x({inst:p})},[o,m,i]),s(function(){return u(p)&&x({inst:p}),o(function(){u(p)&&x({inst:p})})},[o]),f(m),m}function u(o){var i=o.getSnapshot;o=o.value;try{var m=i();return!t(o,m)}catch{return!0}}function d(o,i){return i()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return A.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:v,A}var b;function z(){return b||(b=1,E.exports=P()),E.exports}var T=z();function V(){return T.useSyncExternalStore(D,()=>!0,()=>!1)}function D(){return()=>{}}var L="Avatar",[G,oe]=U(L),[H,R]=G(L),_=g.forwardRef((a,e)=>{const{__scopeAvatar:t,...r}=a,[s,n]=g.useState("idle");return c.jsx(H,{scope:t,imageLoadingStatus:s,onImageLoadingStatusChange:n,children:c.jsx(y.span,{...r,ref:e})})});_.displayName=L;var C="AvatarImage",k=g.forwardRef((a,e)=>{const{__scopeAvatar:t,src:r,onLoadingStatusChange:s=()=>{},...n}=a,f=R(C,t),l=B(r,n),u=M(d=>{s(d),f.onImageLoadingStatusChange(d)});return w(()=>{l!=="idle"&&u(l)},[l,u]),l==="loaded"?c.jsx(y.img,{...n,ref:e,src:r}):null});k.displayName=C;var $="AvatarFallback",q=g.forwardRef((a,e)=>{const{__scopeAvatar:t,delayMs:r,...s}=a,n=R($,t),[f,l]=g.useState(r===void 0);return g.useEffect(()=>{if(r!==void 0){const u=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(u)}},[r]),f&&n.imageLoadingStatus!=="loaded"?c.jsx(y.span,{...s,ref:e}):null});q.displayName=$;function N(a,e){return a?e?(a.src!==e&&(a.src=e),a.complete&&a.naturalWidth>0?"loaded":"loading"):"error":"idle"}function B(a,{referrerPolicy:e,crossOrigin:t}){const r=V(),s=g.useRef(null),n=r?(s.current||(s.current=new window.Image),s.current):null,[f,l]=g.useState(()=>N(n,a));return w(()=>{l(N(n,a))},[n,a]),w(()=>{const u=o=>()=>{l(o)};if(!n)return;const d=u("loaded"),v=u("error");return n.addEventListener("load",d),n.addEventListener("error",v),e&&(n.referrerPolicy=e),typeof t=="string"&&(n.crossOrigin=t),()=>{n.removeEventListener("load",d),n.removeEventListener("error",v)}},[n,t,e]),f}var K=_,O=k,W=q;function J(a){const e=S.c(8);let t,r;e[0]!==a?({className:t,...r}=a,e[0]=a,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=I("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),e[3]=t,e[4]=s):s=e[4];let n;return e[5]!==r||e[6]!==s?(n=c.jsx(K,{"data-slot":"avatar",className:s,...r}),e[5]=r,e[6]=s,e[7]=n):n=e[7],n}function Q(a){const e=S.c(8);let t,r;e[0]!==a?({className:t,...r}=a,e[0]=a,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=I("aspect-square size-full",t),e[3]=t,e[4]=s):s=e[4];let n;return e[5]!==r||e[6]!==s?(n=c.jsx(O,{"data-slot":"avatar-image",className:s,...r}),e[5]=r,e[6]=s,e[7]=n):n=e[7],n}function X(a){const e=S.c(8);let t,r;e[0]!==a?({className:t,...r}=a,e[0]=a,e[1]=t,e[2]=r):(t=e[1],r=e[2]);let s;e[3]!==t?(s=I("bg-muted flex size-full items-center justify-center rounded-full",t),e[3]=t,e[4]=s):s=e[4];let n;return e[5]!==r||e[6]!==s?(n=c.jsx(W,{"data-slot":"avatar-fallback",className:s,...r}),e[5]=r,e[6]=s,e[7]=n):n=e[7],n}function Y(){return Z}function Z(a){const e=a.trim().split(" ");if(e.length===0)return"";if(e.length===1)return e[0].charAt(0).toUpperCase();const t=e[0].charAt(0),r=e[e.length-1].charAt(0);return`${t}${r}`.toUpperCase()}function ie(a){const e=S.c(22),{user:t,showEmail:r}=a,s=r===void 0?!1:r,n=Y();let f;e[0]!==t.avatar||e[1]!==t.login?(f=c.jsx(Q,{src:t.avatar,alt:t.login}),e[0]=t.avatar,e[1]=t.login,e[2]=f):f=e[2];let l;e[3]!==n||e[4]!==t.login?(l=n(t.login),e[3]=n,e[4]=t.login,e[5]=l):l=e[5];let u;e[6]!==l?(u=c.jsx(X,{className:"rounded-lg bg-neutral-200 text-black dark:bg-neutral-700 dark:text-white",children:l}),e[6]=l,e[7]=u):u=e[7];let d;e[8]!==f||e[9]!==u?(d=c.jsxs(J,{className:"h-8 w-8 overflow-hidden rounded-full",children:[f,u]}),e[8]=f,e[9]=u,e[10]=d):d=e[10];let v;e[11]!==t.login?(v=c.jsx("span",{className:"truncate font-medium",children:t.login}),e[11]=t.login,e[12]=v):v=e[12];let o;e[13]!==s||e[14]!==t.email?(o=s&&c.jsx("span",{className:"text-muted-foreground truncate text-xs",children:t.email}),e[13]=s,e[14]=t.email,e[15]=o):o=e[15];let i;e[16]!==v||e[17]!==o?(i=c.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[v,o]}),e[16]=v,e[17]=o,e[18]=i):i=e[18];let m;return e[19]!==d||e[20]!==i?(m=c.jsxs(c.Fragment,{children:[d,i]}),e[19]=d,e[20]=i,e[21]=m):m=e[21],m}export{ie as UserInfo};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{j as t,J as u}from"./app.js";import{c as f}from"./compiler-runtime-
|
|
1
|
+
import{j as t,J as u}from"./app.js";import{c as f}from"./compiler-runtime-CMDe02AS.js";import{c as d,d as x,e as h}from"./dropdown-menu-D3vlxbLx.js";import{UserInfo as y}from"./user-info-qduQAMOl.js";import{c as j}from"./createLucideIcon-BFG25zNo.js";import"./index-C8anOJBB.js";import"./index-D5ir9iUV.js";import"./index-CsMwA9pu.js";import"./index-HZzILD42.js";import"./index-CS5ssiKu.js";import"./index-Bz0y23v2.js";import"./index-BZZx7KCI.js";import"./index-kzaPFHKt.js";import"./utils-DjqsqOe8.js";/**
|
|
2
2
|
* @license lucide-react v0.485.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const g=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],b=j("log-out",g);function _(){return M}function M(){document.body.style.removeProperty("pointer-events")}function B(p){const e=f.c(11),{user:l,logout:m,logoutBtn:c}=p,a=_();let o;e[0]!==l?(o=t.jsx(d,{className:"p-0 font-normal",children:t.jsx("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:t.jsx(y,{user:l,showEmail:!0})})}),e[0]=l,e[1]=o):o=e[1];let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=t.jsx(x,{}),e[2]=s):s=e[2];let n;e[3]===Symbol.for("react.memo_cache_sentinel")?(n=t.jsx(b,{className:"mr-2"}),e[3]=n):n=e[3];let r;e[4]!==a||e[5]!==m||e[6]!==c?(r=t.jsx(h,{asChild:!0,children:t.jsxs(u,{className:"block w-full cursor-pointer",method:"get",href:m,as:"button",onClick:a,children:[n,c]})}),e[4]=a,e[5]=m,e[6]=c,e[7]=r):r=e[7];let i;return e[8]!==o||e[9]!==r?(i=t.jsxs(t.Fragment,{children:[o,s,r]}),e[8]=o,e[9]=r,e[10]=i):i=e[10],i}export{B as UserMenuContent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as s,j as i}from"./app.js";import{c as l}from"./compiler-runtime-CMDe02AS.js";import{A as x}from"./app-layout-CQTlWDgg.js";import"./sidebar-DflSp1X1.js";import"./index-HZzILD42.js";import"./button-DleSKY4-.js";import"./utils-DjqsqOe8.js";import"./index-BpVWRzP4.js";import"./createLucideIcon-BFG25zNo.js";import"./index-C8anOJBB.js";import"./index-D5ir9iUV.js";import"./index-CsMwA9pu.js";import"./index-BZZx7KCI.js";import"./index-kzaPFHKt.js";import"./tooltip-BlR1mf2V.js";import"./index-BRQOFOzQ.js";import"./app-shell-B4pzTbiN.js";import"./app-sidebar-DX9Shcd3.js";import"./nav-main-CwwCPIYf.js";import"./material-icon-C9IuCi5R.js";import"./chevron-right-D5q8rF7h.js";import"./index-Bz0y23v2.js";import"./index-CS5ssiKu.js";import"./chevrons-up-down-kALltqHV.js";import"./app-sidebar-header-BcZ0JSSJ.js";import"./breadcrumbs-DIhfOCvh.js";import"./nav-user-K0xXPEmb.js";import"./dropdown-menu-D3vlxbLx.js";import"./user-info-qduQAMOl.js";import"./user-menu-content-Cjq658jE.js";import"./icon-DLHMhF_-.js";import"./use-appearance-CL1-5ZfQ.js";const a=[];function J(){const t=l.c(8),r=s();let o;t[0]!==r.props.title?(o=r.props.title&&i.jsx("div",{className:"text-3xl mb-8",children:r.props.title}),t[0]=r.props.title,t[1]=o):o=t[1];let e;t[2]===Symbol.for("react.memo_cache_sentinel")?(e=i.jsx("div",{className:"text-3xl mb-8",children:"Adminizer"}),t[2]=e):e=t[2];let p;t[3]!==r.props.text?(p=r.props.text&&i.jsx("div",{dangerouslySetInnerHTML:{__html:r.props.text}}),t[3]=r.props.text,t[4]=p):p=t[4];let m;return t[5]!==o||t[6]!==p?(m=i.jsx(x,{breadcrumbs:a,children:i.jsxs("div",{className:"flex h-full flex-1 flex-col gap-4 rounded-xl p-4",children:[o,e,p]})}),t[5]=o,t[6]=p,t[7]=m):m=t[7],m}export{J as default};
|
package/controllers/add.js
CHANGED
|
@@ -7,6 +7,7 @@ import { Adminizer } from "../lib/Adminizer";
|
|
|
7
7
|
import inertiaAddHelper from "../helpers/inertiaAddHelper";
|
|
8
8
|
export default async function add(req, res) {
|
|
9
9
|
let entity = ControllerHelper.findEntityObject(req);
|
|
10
|
+
console.log(entity);
|
|
10
11
|
if (!entity.model) {
|
|
11
12
|
return res.status(404).send({ error: 'Model not Found' });
|
|
12
13
|
}
|
|
@@ -14,14 +15,14 @@ export default async function add(req, res) {
|
|
|
14
15
|
return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/${entity.uri}`);
|
|
15
16
|
}
|
|
16
17
|
if (req.adminizer.config.auth.enable) {
|
|
17
|
-
if (!req.
|
|
18
|
+
if (!req.user) {
|
|
18
19
|
return req.Inertia.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
19
20
|
}
|
|
20
|
-
else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.
|
|
21
|
+
else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.user)) {
|
|
21
22
|
return res.sendStatus(403);
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
|
-
let dataAccessor = new DataAccessor(req, entity, "add");
|
|
25
|
+
let dataAccessor = new DataAccessor(req.adminizer, req.user, entity, "add");
|
|
25
26
|
let fields = dataAccessor.getFieldsConfig();
|
|
26
27
|
// add deprecated 'records' to config
|
|
27
28
|
fields = await FieldsHelper.loadAssociations(req, fields, "add");
|
|
@@ -91,6 +92,7 @@ export default async function add(req, res) {
|
|
|
91
92
|
await saveRelationsMediaManager(fields, rawReqData, entity.model.identity, record.id);
|
|
92
93
|
Adminizer.log.debug(`A new record was created: `, record);
|
|
93
94
|
if (req.body.jsonPopupCatalog) {
|
|
95
|
+
// await new Promise(resolve => setTimeout(resolve, 2000));
|
|
94
96
|
return res.json({ record: record });
|
|
95
97
|
}
|
|
96
98
|
else {
|
|
@@ -104,16 +106,13 @@ export default async function add(req, res) {
|
|
|
104
106
|
data = reqData;
|
|
105
107
|
}
|
|
106
108
|
}
|
|
109
|
+
const props = inertiaAddHelper(req, entity, fields);
|
|
107
110
|
if (req.query?.without_layout) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
// data: data
|
|
112
|
-
// });
|
|
113
|
-
return null;
|
|
111
|
+
return res.json({
|
|
112
|
+
props: props
|
|
113
|
+
});
|
|
114
114
|
}
|
|
115
115
|
else {
|
|
116
|
-
const props = inertiaAddHelper(req, entity, fields);
|
|
117
116
|
return req.Inertia.render({
|
|
118
117
|
component: 'add',
|
|
119
118
|
props: props
|
package/controllers/addGroup.js
CHANGED
|
@@ -4,10 +4,10 @@ import { inertiaGroupHelper } from "../helpers/inertiaGroupHelper";
|
|
|
4
4
|
export default async function addGroup(req, res) {
|
|
5
5
|
let entity = ControllerHelper.findEntityObject(req);
|
|
6
6
|
if (req.adminizer.config.auth.enable) {
|
|
7
|
-
if (!req.
|
|
7
|
+
if (!req.user) {
|
|
8
8
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
9
9
|
}
|
|
10
|
-
else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.
|
|
10
|
+
else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.user)) {
|
|
11
11
|
return res.sendStatus(403);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -25,7 +25,6 @@ export default async function addGroup(req, res) {
|
|
|
25
25
|
groupedTokens[department] = req.adminizer.accessRightsHelper.getTokensByDepartment(department);
|
|
26
26
|
}
|
|
27
27
|
if (req.method.toUpperCase() === 'POST') {
|
|
28
|
-
// console.log(req.body);
|
|
29
28
|
let allTokens = req.adminizer.accessRightsHelper.getTokens();
|
|
30
29
|
let usersInThisGroup = [];
|
|
31
30
|
let tokensOfThisGroup = [];
|
|
@@ -60,7 +59,6 @@ export default async function addGroup(req, res) {
|
|
|
60
59
|
Adminizer.log.error(e);
|
|
61
60
|
req.session.messages.adminError.push(e.message || 'Something went wrong...');
|
|
62
61
|
}
|
|
63
|
-
// console.log(group)
|
|
64
62
|
}
|
|
65
63
|
const props = inertiaGroupHelper(entity, req, users, groupedTokens);
|
|
66
64
|
return req.Inertia.render({
|
package/controllers/addUser.js
CHANGED
|
@@ -5,10 +5,10 @@ import { inertiaUserHelper } from "../helpers/inertiaUserHelper";
|
|
|
5
5
|
export default async function (req, res) {
|
|
6
6
|
let entity = ControllerHelper.findEntityObject(req);
|
|
7
7
|
if (req.adminizer.config.auth.enable) {
|
|
8
|
-
if (!req.
|
|
8
|
+
if (!req.user) {
|
|
9
9
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
10
10
|
}
|
|
11
|
-
else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.
|
|
11
|
+
else if (!req.adminizer.accessRightsHelper.hasPermission(`create-${entity.name}-model`, req.user)) {
|
|
12
12
|
return res.sendStatus(403);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -22,7 +22,6 @@ export default async function (req, res) {
|
|
|
22
22
|
}
|
|
23
23
|
let user;
|
|
24
24
|
if (req.method.toUpperCase() === 'POST') {
|
|
25
|
-
// console.log(req.body);
|
|
26
25
|
let userGroups = [];
|
|
27
26
|
for (let key in req.body) {
|
|
28
27
|
if (key.startsWith("group-checkbox-") && req.body[key] === true) {
|
|
@@ -40,12 +39,12 @@ export default async function (req, res) {
|
|
|
40
39
|
locale = req.body.locale === 'default' ? req.adminizer.config.translation.defaultLocale : req.body.locale;
|
|
41
40
|
}
|
|
42
41
|
try {
|
|
43
|
-
let passwordHashed = generate(req.body.login + req.body.userPassword);
|
|
42
|
+
let passwordHashed = generate(req.body.login + req.body.userPassword + process.env.AP_PASSWORD_SALT);
|
|
44
43
|
let password = 'masked';
|
|
45
44
|
// TODO refactor CRUD functions for DataAccessor usage
|
|
46
45
|
user = await req.adminizer.modelHandler.model.get("UserAP")["_create"]({
|
|
47
46
|
login: req.body.login, fullName: req.body.fullName, email: req.body.email,
|
|
48
|
-
|
|
47
|
+
passwordHashed: passwordHashed, timezone: req.body.timezone, expires: req.body.date,
|
|
49
48
|
locale: locale, isAdministrator: isAdministrator, isConfirmed: isConfirmed, groups: userGroups
|
|
50
49
|
});
|
|
51
50
|
Adminizer.log.debug(`A new user was created: `, user);
|
|
@@ -56,7 +55,6 @@ export default async function (req, res) {
|
|
|
56
55
|
Adminizer.log.error(e);
|
|
57
56
|
req.session.messages.adminError.push(e.message || 'Something went wrong...');
|
|
58
57
|
}
|
|
59
|
-
// console.log(user)
|
|
60
58
|
}
|
|
61
59
|
const props = inertiaUserHelper(entity, req, groups);
|
|
62
60
|
return req.Inertia.render({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function catalogController(req: ReqType, res: ResType): Promise<void |
|
|
1
|
+
export declare function catalogController(req: ReqType, res: ResType): Promise<void | import("express").Response<any, Record<string, any>>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CatalogHandler } from "../../lib/catalog/CatalogHandler";
|
|
1
|
+
import { CatalogHandler } from "../../lib/v4/catalog/CatalogHandler";
|
|
2
2
|
import { VueCatalog } from "./FrontentCatalogAdapter";
|
|
3
3
|
import { Adminizer } from "../../lib/Adminizer";
|
|
4
4
|
export async function catalogController(req, res) {
|
|
@@ -6,10 +6,10 @@ export async function catalogController(req, res) {
|
|
|
6
6
|
let id = req.params.id ? req.params.id : '';
|
|
7
7
|
const postfix = id ? `${slug}-${id}` : `${slug}`;
|
|
8
8
|
if (req.adminizer.config.auth.enable) {
|
|
9
|
-
if (!req.
|
|
9
|
+
if (!req.user) {
|
|
10
10
|
return res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
11
11
|
}
|
|
12
|
-
else if (!req.adminizer.accessRightsHelper.hasPermission(`catalog-${postfix}`, req.
|
|
12
|
+
else if (!req.adminizer.accessRightsHelper.hasPermission(`catalog-${postfix}`, req.user)) {
|
|
13
13
|
return res.sendStatus(403);
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -28,64 +28,72 @@ export async function catalogController(req, res) {
|
|
|
28
28
|
}
|
|
29
29
|
const method = req.method.toUpperCase();
|
|
30
30
|
if (method === 'GET') {
|
|
31
|
-
return
|
|
31
|
+
return req.Inertia.render({
|
|
32
|
+
component: 'catalog',
|
|
33
|
+
props: null
|
|
34
|
+
});
|
|
32
35
|
}
|
|
33
36
|
if (method === 'POST' || method === 'PUT' || method === 'DELETE') {
|
|
34
37
|
const data = req.body;
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
38
|
+
const frontendCatalog = new VueCatalog(_catalog);
|
|
39
|
+
if (!frontendCatalog)
|
|
37
40
|
return res.status(404);
|
|
38
|
-
|
|
39
|
-
const item =
|
|
41
|
+
frontendCatalog.setId(id);
|
|
42
|
+
const item = frontendCatalog.getItemType(data.type);
|
|
40
43
|
switch (method) {
|
|
41
44
|
case 'POST':
|
|
42
45
|
switch (data._method) {
|
|
46
|
+
// TODO: deprecated, passing react module instead html
|
|
43
47
|
case 'getAddHTML':
|
|
44
|
-
return res.json(await
|
|
48
|
+
return res.json(await frontendCatalog.getAddHTML(item, req));
|
|
49
|
+
// TODO: deprecated, passing react module instead html
|
|
45
50
|
case 'getEditHTML':
|
|
46
|
-
return res.json(await
|
|
51
|
+
return res.json(await frontendCatalog.getEditHTML(item, data.id, req, data.modelId));
|
|
47
52
|
case 'getCatalog':
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
{
|
|
54
|
+
const __catalog = await frontendCatalog.getCatalog();
|
|
55
|
+
return res.json({
|
|
56
|
+
items: frontendCatalog.getitemTypes(),
|
|
57
|
+
catalog: {
|
|
58
|
+
nodes: __catalog,
|
|
59
|
+
movingGroupsRootOnly: _catalog.movingGroupsRootOnly ?? false,
|
|
60
|
+
catalogName: _catalog.name,
|
|
61
|
+
catalogId: _catalog.id,
|
|
62
|
+
catalogSlug: _catalog.slug,
|
|
63
|
+
idList: idList
|
|
64
|
+
},
|
|
65
|
+
toolsActions: await frontendCatalog.getActions([], 'tools')
|
|
66
|
+
});
|
|
67
|
+
}
|
|
61
68
|
case 'createItem':
|
|
62
|
-
return res.json({ 'data': await
|
|
69
|
+
return res.json({ 'data': await frontendCatalog.createItem(data.data, req) });
|
|
63
70
|
case 'getChilds':
|
|
64
|
-
return res.json({ data: await
|
|
71
|
+
return res.json({ data: await frontendCatalog.getChilds(data.data, req) });
|
|
65
72
|
case 'getActions':
|
|
66
|
-
return res.json({ data: await
|
|
73
|
+
return res.json({ data: await frontendCatalog.getActions(data.items, data.type) });
|
|
67
74
|
case 'search':
|
|
68
|
-
return res.json({ data: await
|
|
75
|
+
return res.json({ data: await frontendCatalog.search(data.s, req) });
|
|
69
76
|
case "getLocales":
|
|
70
|
-
return res.json({ data:
|
|
77
|
+
return res.json({ data: frontendCatalog.getLocales(req) });
|
|
71
78
|
}
|
|
72
79
|
break;
|
|
73
80
|
case 'PUT':
|
|
74
81
|
switch (data._method) {
|
|
75
82
|
case 'updateTree':
|
|
76
|
-
return res.json({ data: await
|
|
83
|
+
return res.json({ data: await frontendCatalog.updateTree(data.data, req) });
|
|
77
84
|
case 'getLink':
|
|
78
|
-
return res.json({ data: await
|
|
85
|
+
return res.json({ data: await frontendCatalog.getLink(data.actionId) });
|
|
79
86
|
case 'handleAction':
|
|
80
|
-
return res.json({ data: await
|
|
87
|
+
return res.json({ data: await frontendCatalog.handleAction(data.data.actionID, data.data.items, data.data.config, req) });
|
|
81
88
|
case 'getPopUpHTML':
|
|
82
|
-
|
|
89
|
+
// TODO: deprecated, passing react module instead html
|
|
90
|
+
return res.json({ data: await frontendCatalog.getPopUpHTML(data.actionId) });
|
|
83
91
|
case 'updateItem':
|
|
84
|
-
return res.json({ data: await
|
|
92
|
+
return res.json({ data: await frontendCatalog.updateItem(item, data.modelId, data.data, req) });
|
|
85
93
|
}
|
|
86
94
|
break;
|
|
87
95
|
case 'DELETE':
|
|
88
|
-
return res.json({ data: await
|
|
96
|
+
return res.json({ data: await frontendCatalog.deleteItem(data.data, req) });
|
|
89
97
|
}
|
|
90
98
|
}
|
|
91
99
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { AbstractCatalog, Item } from "../../lib/catalog/AbstractCatalog";
|
|
1
|
+
import { AbstractCatalog, Item } from "../../lib/v4/catalog/AbstractCatalog";
|
|
2
2
|
interface NodeModel<TDataType> {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
text: string;
|
|
4
|
+
droppable: boolean;
|
|
5
|
+
id: number;
|
|
6
|
+
parent: number;
|
|
7
7
|
data?: TDataType;
|
|
8
8
|
children?: NodeModel<TDataType>[];
|
|
9
9
|
isSelected?: boolean;
|
|
@@ -18,40 +18,62 @@ interface NodeModel<TDataType> {
|
|
|
18
18
|
}
|
|
19
19
|
interface NodeData extends Item {
|
|
20
20
|
}
|
|
21
|
-
interface obj {
|
|
22
|
-
[key: string]: string;
|
|
23
|
-
}
|
|
24
21
|
interface RequestData {
|
|
25
22
|
reqNode: NodeModel<NodeData>[];
|
|
26
23
|
reqParent: NodeModel<NodeData>;
|
|
27
24
|
_method: string;
|
|
28
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Now is React
|
|
28
|
+
* // TODO: refactor for react name
|
|
29
|
+
*/
|
|
29
30
|
export declare class VueCatalog {
|
|
30
31
|
catalog: AbstractCatalog;
|
|
31
32
|
constructor(_catalog: AbstractCatalog);
|
|
32
33
|
setId(id: string): void;
|
|
33
|
-
getItemType(type: string): import("../../lib/catalog/AbstractCatalog").BaseItem<Item>;
|
|
34
|
+
getItemType(type: string): import("../../lib/v4/catalog/AbstractCatalog").BaseItem<Item>;
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated reason: migration for intertia
|
|
37
|
+
* // TODO: need passing custom React module
|
|
38
|
+
*/
|
|
34
39
|
getAddHTML(item: any, req: ReqType): Promise<{
|
|
35
|
-
type: "
|
|
36
|
-
data:
|
|
40
|
+
type: "component" | "model" | string;
|
|
41
|
+
data: any;
|
|
37
42
|
}>;
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated reason: migration for intertia
|
|
45
|
+
* TODO need passing custom React module
|
|
46
|
+
*/
|
|
38
47
|
getEditHTML(item: any, id: string | number, req: ReqType, modelId: string | number): Promise<{
|
|
39
48
|
type: "link" | "html" | "jsonForm";
|
|
40
49
|
data: string;
|
|
41
50
|
}>;
|
|
42
|
-
getitemTypes():
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
51
|
+
getitemTypes(): {
|
|
52
|
+
type: string;
|
|
53
|
+
name: string;
|
|
54
|
+
isGroup: boolean;
|
|
55
|
+
allowedRoot: boolean;
|
|
56
|
+
icon: string;
|
|
57
|
+
actionHandlers: import("../../lib/v4/catalog/AbstractCatalog").ActionHandler[];
|
|
58
|
+
}[];
|
|
59
|
+
getLocales(req: ReqType): {
|
|
60
|
+
[key: string]: string;
|
|
61
|
+
};
|
|
62
|
+
getActions(items: NodeModel<any>[], type: string): Promise<import("../../lib/v4/catalog/AbstractCatalog").ActionHandler[]>;
|
|
63
|
+
handleAction(actionId: string, items: any[], config: any, req: ReqType): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* @deprecated reason: migration for intertia
|
|
66
|
+
* // TODO: need passing custom React module
|
|
67
|
+
*/
|
|
46
68
|
getPopUpHTML(actionId: string): Promise<string>;
|
|
47
69
|
getLink(actionId: string): Promise<string>;
|
|
48
70
|
getCatalog(): Promise<NodeModel<Item>[]>;
|
|
49
|
-
createItem(data: any): Promise<any>;
|
|
50
|
-
getChilds(data: any): Promise<NodeModel<Item>[]>;
|
|
51
|
-
search(s: string): Promise<NodeModel<Item>[]>;
|
|
52
|
-
updateTree(data: RequestData): Promise<any>;
|
|
53
|
-
updateItem(item: any, modelId: string, data: any): Promise<any>;
|
|
54
|
-
deleteItem(items: NodeModel<any>[]): Promise<{
|
|
71
|
+
createItem(data: any, req: ReqType): Promise<any>;
|
|
72
|
+
getChilds(data: any, req: ReqType): Promise<NodeModel<Item>[]>;
|
|
73
|
+
search(s: string, req: ReqType): Promise<NodeModel<Item>[]>;
|
|
74
|
+
updateTree(data: RequestData, req: ReqType): Promise<any>;
|
|
75
|
+
updateItem(item: any, modelId: string, data: any, req: ReqType): Promise<any>;
|
|
76
|
+
deleteItem(items: NodeModel<any>[], req: ReqType): Promise<{
|
|
55
77
|
ok: boolean;
|
|
56
78
|
}>;
|
|
57
79
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import { AbstractCatalog } from "../../lib/catalog/AbstractCatalog";
|
|
1
|
+
import { AbstractCatalog } from "../../lib/v4/catalog/AbstractCatalog";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Now is React
|
|
4
|
+
* // TODO: refactor for react name
|
|
5
|
+
*/
|
|
2
6
|
export class VueCatalog {
|
|
3
7
|
catalog;
|
|
4
8
|
constructor(_catalog) {
|
|
@@ -10,9 +14,17 @@ export class VueCatalog {
|
|
|
10
14
|
getItemType(type) {
|
|
11
15
|
return this.catalog.getItemType(type);
|
|
12
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated reason: migration for intertia
|
|
19
|
+
* // TODO: need passing custom React module
|
|
20
|
+
*/
|
|
13
21
|
getAddHTML(item, req) {
|
|
14
22
|
return this.catalog.getAddHTML(item, req);
|
|
15
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated reason: migration for intertia
|
|
26
|
+
* TODO need passing custom React module
|
|
27
|
+
*/
|
|
16
28
|
getEditHTML(item, id, req, modelId) {
|
|
17
29
|
return this.catalog.getEditHTML(item, id, req, modelId);
|
|
18
30
|
}
|
|
@@ -31,19 +43,21 @@ export class VueCatalog {
|
|
|
31
43
|
"No, cancel": "",
|
|
32
44
|
"Are you sure?": "",
|
|
33
45
|
"Yes, I'm sure": "",
|
|
34
|
-
"Select Ids": ""
|
|
46
|
+
"Select Ids": "",
|
|
47
|
+
"OR": "",
|
|
35
48
|
};
|
|
36
49
|
obj[this.catalog.name] = "";
|
|
37
50
|
for (const actionHandler of this.catalog.actionHandlers) {
|
|
38
51
|
obj[actionHandler.name] = "";
|
|
39
52
|
}
|
|
40
53
|
let messages = obj;
|
|
41
|
-
req.i18n.setLocale(req.session.UserAP.locale);
|
|
42
54
|
let outMessages = {};
|
|
43
55
|
for (const mess of Object.keys(messages)) {
|
|
44
56
|
outMessages[mess] = req.i18n.__(mess);
|
|
45
57
|
}
|
|
46
|
-
return
|
|
58
|
+
return {
|
|
59
|
+
...outMessages,
|
|
60
|
+
};
|
|
47
61
|
}
|
|
48
62
|
async getActions(items, type) {
|
|
49
63
|
let arrItems = [];
|
|
@@ -57,13 +71,17 @@ export class VueCatalog {
|
|
|
57
71
|
return (await this.catalog.getActions(arrItems))?.filter(e => e.displayContext);
|
|
58
72
|
}
|
|
59
73
|
}
|
|
60
|
-
async handleAction(actionId, items, config) {
|
|
74
|
+
async handleAction(actionId, items, config, req) {
|
|
61
75
|
let arrItems = [];
|
|
62
76
|
for (const item of items) {
|
|
63
77
|
arrItems.push(await this.catalog.find(item.data));
|
|
64
78
|
}
|
|
65
|
-
return this.catalog.handleAction(actionId, arrItems, config);
|
|
79
|
+
return this.catalog.handleAction(actionId, arrItems, config, req);
|
|
66
80
|
}
|
|
81
|
+
/**
|
|
82
|
+
* @deprecated reason: migration for intertia
|
|
83
|
+
* // TODO: need passing custom React module
|
|
84
|
+
*/
|
|
67
85
|
async getPopUpHTML(actionId) {
|
|
68
86
|
return this.catalog.getPopUpHTML(actionId);
|
|
69
87
|
}
|
|
@@ -72,35 +90,35 @@ export class VueCatalog {
|
|
|
72
90
|
}
|
|
73
91
|
//Below are the methods that require action
|
|
74
92
|
async getCatalog() {
|
|
75
|
-
let rootItems = await this.catalog.getChilds(
|
|
93
|
+
let rootItems = await this.catalog.getChilds(0);
|
|
76
94
|
return VueCatalogUtils.arrayToNode(rootItems, this.catalog.getGroupType().type);
|
|
77
95
|
}
|
|
78
|
-
createItem(data) {
|
|
96
|
+
async createItem(data, req) {
|
|
79
97
|
//data = VueCatalogUtils.refinement(data);
|
|
80
98
|
if (this.catalog.slug !== "navigation") {
|
|
81
99
|
let item = data.record;
|
|
82
100
|
item.parenId = data.parenId;
|
|
83
|
-
return this.catalog.createItem(item);
|
|
101
|
+
return await this.catalog.createItem(item, req);
|
|
84
102
|
}
|
|
85
103
|
else {
|
|
86
|
-
return this.catalog.createItem(data);
|
|
104
|
+
return await this.catalog.createItem(data, req);
|
|
87
105
|
}
|
|
88
106
|
}
|
|
89
|
-
async getChilds(data) {
|
|
107
|
+
async getChilds(data, req) {
|
|
90
108
|
data = VueCatalogUtils.refinement(data);
|
|
91
|
-
return VueCatalogUtils.arrayToNode(await this.catalog.getChilds(data.id), this.catalog.getGroupType().type);
|
|
109
|
+
return VueCatalogUtils.arrayToNode(await this.catalog.getChilds(data.id, undefined, req), this.catalog.getGroupType().type);
|
|
92
110
|
}
|
|
93
111
|
// Moved into actions
|
|
94
112
|
// getCreatedItems(data: any) {
|
|
95
113
|
// data = VueCatalogUtils.refinement(data);
|
|
96
114
|
// return this.catalog.getChilds(data.id);
|
|
97
115
|
// }
|
|
98
|
-
async search(s) {
|
|
99
|
-
let searchResult = await this.catalog.search(s);
|
|
116
|
+
async search(s, req) {
|
|
117
|
+
let searchResult = await this.catalog.search(s, undefined, req);
|
|
100
118
|
let itemsTree = AbstractCatalog.buildTree(searchResult);
|
|
101
119
|
return VueCatalogUtils.treeToNode(itemsTree, this.catalog.getGroupType().type);
|
|
102
120
|
}
|
|
103
|
-
async updateTree(data) {
|
|
121
|
+
async updateTree(data, req) {
|
|
104
122
|
let reqNodes = data.reqNode;
|
|
105
123
|
if (!Array.isArray(data.reqNode)) {
|
|
106
124
|
reqNodes = [data.reqNode];
|
|
@@ -114,8 +132,7 @@ export class VueCatalog {
|
|
|
114
132
|
}
|
|
115
133
|
// It’s unclear why he’s coming reqNodes
|
|
116
134
|
for (const reqNode of reqNodes) {
|
|
117
|
-
|
|
118
|
-
const item = await this.catalog.find(reqNode.data);
|
|
135
|
+
const item = await this.catalog.find(reqNode.data, req);
|
|
119
136
|
if (!item) {
|
|
120
137
|
throw `reqNode Item not found`;
|
|
121
138
|
}
|
|
@@ -125,26 +142,26 @@ export class VueCatalog {
|
|
|
125
142
|
for (const childNode of reqParent.children) {
|
|
126
143
|
childNode.data.sortOrder = sortCount;
|
|
127
144
|
childNode.data.parentId = reqParent.data.id;
|
|
128
|
-
await this.catalog.updateItem(childNode.data.id, childNode.data.type, childNode.data);
|
|
145
|
+
await this.catalog.updateItem(childNode.data.id, childNode.data.type, childNode.data, req);
|
|
129
146
|
sortCount++;
|
|
130
147
|
}
|
|
131
148
|
return Promise.resolve('ok');
|
|
132
149
|
}
|
|
133
|
-
async updateItem(item, modelId, data) {
|
|
150
|
+
async updateItem(item, modelId, data, req) {
|
|
134
151
|
//data = VueCatalogUtils.refinement(data);
|
|
135
152
|
if (this.catalog.slug !== "navigation") {
|
|
136
|
-
return await this.catalog.updateModelItems(data.modelId, data.type, data.record);
|
|
153
|
+
return await this.catalog.updateModelItems(data.modelId, data.type, data.record, req);
|
|
137
154
|
}
|
|
138
155
|
else {
|
|
139
|
-
return await this.catalog.updateModelItems(modelId, item.type, data);
|
|
156
|
+
return await this.catalog.updateModelItems(modelId, item.type, data, req);
|
|
140
157
|
}
|
|
141
158
|
}
|
|
142
|
-
async deleteItem(items) {
|
|
159
|
+
async deleteItem(items, req) {
|
|
143
160
|
for (const item1 of items) {
|
|
144
161
|
if (item1.children?.length) {
|
|
145
|
-
await this.deleteItem(item1.children);
|
|
162
|
+
await this.deleteItem(item1.children, req);
|
|
146
163
|
}
|
|
147
|
-
this.catalog.deleteItem(item1.data.type, item1.data.id);
|
|
164
|
+
await this.catalog.deleteItem(item1.data.type, item1.data.id, req);
|
|
148
165
|
}
|
|
149
166
|
return { ok: true };
|
|
150
167
|
}
|
|
@@ -162,16 +179,18 @@ export class VueCatalogUtils {
|
|
|
162
179
|
static toNode(data, groupTypeName) {
|
|
163
180
|
return {
|
|
164
181
|
data: data,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
182
|
+
// droppable: data.type !== groupTypeName,
|
|
183
|
+
droppable: true,
|
|
184
|
+
// isExpanded: false,
|
|
185
|
+
id: data.sortOrder + 1,
|
|
186
|
+
text: data.name,
|
|
187
|
+
parent: 0
|
|
169
188
|
};
|
|
170
189
|
}
|
|
171
190
|
static expandTo(vueCatalogData, theseItemIdsNeedToBeOpened) {
|
|
172
191
|
function expand(node) {
|
|
173
192
|
if (theseItemIdsNeedToBeOpened.includes(node.data.id)) {
|
|
174
|
-
node.isExpanded = true;
|
|
193
|
+
// node.isExpanded = true;
|
|
175
194
|
}
|
|
176
195
|
if (node.children) {
|
|
177
196
|
for (const child of node.children) {
|
|
@@ -192,7 +211,7 @@ export class VueCatalogUtils {
|
|
|
192
211
|
// Sort the children before building their nodes
|
|
193
212
|
item.childs.sort((a, b) => (a.sortOrder || 0) - (b.sortOrder || 0));
|
|
194
213
|
node.children = buildNodes(item.childs);
|
|
195
|
-
node.isExpanded = !node.
|
|
214
|
+
// node.isExpanded = !node.droppable;
|
|
196
215
|
}
|
|
197
216
|
return node;
|
|
198
217
|
});
|
|
@@ -2,10 +2,9 @@ import { ControllerHelper } from "../helpers/controllerHelper";
|
|
|
2
2
|
import * as fs from "fs";
|
|
3
3
|
import { Adminizer } from "../lib/Adminizer";
|
|
4
4
|
export default function upload(req, res) {
|
|
5
|
-
//console.log('admin > CK-upload');
|
|
6
5
|
let entity = ControllerHelper.findEntityObject(req);
|
|
7
6
|
if (req.adminizer.config.auth.enable) {
|
|
8
|
-
if (!req.
|
|
7
|
+
if (!req.user) {
|
|
9
8
|
res.redirect(`${req.adminizer.config.routePrefix}/model/userap/login`);
|
|
10
9
|
return;
|
|
11
10
|
}
|
|
@@ -14,7 +13,7 @@ export default function upload(req, res) {
|
|
|
14
13
|
`create-${entity.name}-model`,
|
|
15
14
|
`update-${entity.name}-form`,
|
|
16
15
|
`create-${entity.name}-form`
|
|
17
|
-
], req.
|
|
16
|
+
], req.user)) {
|
|
18
17
|
res.sendStatus(403);
|
|
19
18
|
return;
|
|
20
19
|
}
|