@nocobase/plugin-data-source-manager 1.2.15-alpha → 1.2.17-alpha
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/dist/client/index.js +1 -1
- package/dist/externalVersion.js +7 -7
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -56,4 +56,4 @@
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
`),Nf=(e="main")=>({name:`dataSources/${e}/rolesResourcesScopes`,fields:[{type:"string",name:"name",interface:"input",uiSchema:{title:'{{t("Scope name")}}',type:"string","x-component":"Input",required:!0}}]}),Bf=()=>{const{name:e}=p.useContext(me),t=r.useFormBlockContext();return p.useEffect(()=>{t.form.setInitialValues({resourceName:e})},[e]),{form:t.form}},Vf=e=>{const t=Nf(e);return{type:"object",properties:{scope:{"x-component":"RecordPicker","x-component-props":{size:"small",fieldNames:{label:"name",value:"id"},multiple:!1,association:{target:"rolesResourcesScopes"},onChange:"{{ onChange }}"},properties:{selector:{type:"void",title:'{{ t("Select record") }}',"x-component":"RecordPicker.Selector","x-component-props":{className:"nb-record-picker-selector"},properties:{tableBlock:{type:"void","x-decorator":"TableSelectorProvider","x-decorator-props":{collection:t,resource:`dataSources/${e}/rolesResourcesScopes`,action:"list",params:{pageSize:20},useParams(){return{filter:{$or:[{resourceName:p.useContext(me).name},{resourceName:null}]}}},rowKey:"id"},"x-component":"BlockItem",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{create:{type:"void",title:'{{ t("Add new") }}',"x-action":"create","x-component":"Action","x-component-props":{icon:"PlusOutlined",openMode:"drawer",type:"primary"},properties:{drawer:{type:"void",title:'{{ t("Add record") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{formBlock:{type:"void","x-decorator":"FormBlockProvider","x-decorator-props":{resource:`dataSources/${e}/rolesResourcesScopes`,collection:t},"x-component":"CardItem",properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":Bf,properties:{name:{type:"string","x-component":"CollectionField","x-decorator":"FormItem"},scope:{type:"object",title:'{{t("Data scope")}}',name:"filter","x-decorator":"FormItem","x-component":r.withDynamicSchemaProps(o=>a.jsx(r.FlagProvider,{isVariableParsedInOtherContext:!0,children:a.jsx(r.Filter,T({},o))})),"x-use-component-props":()=>{const o=p.useContext(me);return{options:r.useFilterFieldOptions(o.fields)}},"x-component-props":{dynamicComponent:r.VariableInput}},actions:{type:"void","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{marginTop:24}},properties:{create:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useCreateActionProps","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}}}}}}},value:{type:"array","x-component":"TableV2.Selector","x-use-component-props":"useTableSelectorProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},properties:{column1:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-component":"TableV2.Column",properties:{actions:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"},properties:{edit:{type:"void",title:'{{ t("Edit") }}',"x-action":"update","x-decorator":"ACLActionProvider","x-component":"Action.Link","x-component-props":{openMode:"drawer",icon:"EditOutlined"},properties:{drawer:{type:"void",title:'{{ t("Edit record") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{formBlock:{type:"void","x-decorator":"FormBlockProvider","x-decorator-props":{resource:`dataSources/${e}/rolesResourcesScopes`,collection:t,action:"get",useParams:"{{ useParamsFromRecord }}"},"x-component":"CardItem",properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":"useFormBlockProps",properties:{name:{type:"string","x-component":"CollectionField","x-decorator":"FormItem"},scope:{type:"object",title:'{{t("Data scope")}}',name:"filter","x-decorator":"FormItem","x-component":r.withDynamicSchemaProps(o=>a.jsx(r.FlagProvider,{isVariableParsedInOtherContext:!0,children:a.jsx(r.Filter,T({},o))})),"x-use-component-props":()=>{const o=p.useContext(me);return{options:r.useFilterFieldOptions(o.fields)}},"x-component-props":{dynamicComponent:r.VariableInput}},actions:{type:"void","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{marginTop:24}},properties:{update:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useUpdateActionProps","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}}}}},destroy:{title:'{{ t("Delete") }}',"x-action":"destroy","x-decorator":"ACLActionProvider","x-component":"Action.Link","x-use-component-props":"useDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}}}}}}}}}},footer:{"x-component":"Action.Container.Footer","x-component-props":{},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{},properties:{submit:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"usePickActionProps","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}}}}}},Wo=p.createContext(null);Wo.displayName="RolesResourcesScopesSelectedRowKeysContext";const Lf=e=>{const[t,o]=p.useState([]);return a.jsx(Wo.Provider,{value:[t,o],children:e.children})},qf=e=>{const t=p.useMemo(()=>fe.createForm({values:{scope:e.value}}),[]),{key:o}=r.useRecord(),n=Vf(o);return a.jsx(r.FormProvider,{form:t,children:a.jsx(r.SchemaComponent,{components:{RolesResourcesScopesSelectedRowKeysProvider:Lf},scope:{onChange(i){var s;(s=e==null?void 0:e.onChange)==null||s.call(e,i)}},schema:n})})},Gf=e=>{var o;const t={};return(o=e==null?void 0:e.forEach)==null||o.call(e,n=>{n.name&&(t[n.name]=n,t[n.name].scope=Y.isEmpty(n.scope)?null:n.scope)}),t},me=p.createContext({});me.displayName="RoleResourceCollectionContext";const zf=F.connect(e=>{var v,d;const{styles:t}=Kf(),o=h=>{const g=h.map(b=>K(T({},b),{scope:Y.isEmpty(b.scope)?null:b.scope}));e.onChange(g)},n=r.useRecord(),i=Uo(),s=n.fields,c=r.useCompile(),{t:l}=B.useTranslation(),y=F.useField(),u=Gf(y.value||[]),f=(h,g)=>{var _;const b=u==null?void 0:u[h];return b?(_=b==null?void 0:b.fields)==null?void 0:_.includes(g):!1},m=i.filter(h=>h.allowConfigureFields),S=s==null?void 0:s.map(h=>{const g=T({},h);for(const b of m)g[b.name]=f(b.name,h.name);return g}),w=h=>{var g;u[h]?delete u[h]:u[h]={name:h,fields:(g=s==null?void 0:s.map)==null?void 0:g.call(s,b=>b.name)},o(Object.values(u))},A=(h,g)=>{u[h]?(u[h].scope=g,o(Object.values(u))):(w(h),u[h].scope=g,o(Object.values(u)))},C={};for(const h of m)C[h.name]=(s==null?void 0:s.length)===((d=(v=u==null?void 0:u[h.name])==null?void 0:v.fields)==null?void 0:d.length);return a.jsx("div",{children:a.jsx(me.Provider,{value:n,children:a.jsxs(ae.FormLayout,{layout:"vertical",children:[a.jsx(ae.FormItem,{label:l("Action permission"),children:a.jsx(x.Table,{className:t,size:"small",pagination:!1,columns:[{dataIndex:"displayName",title:l("Action display name"),render:h=>c(h)},{dataIndex:"onNewRecord",title:l("Action type"),render:h=>h?a.jsx(x.Tag,{color:"green",children:l("Action on new records")}):a.jsx(x.Tag,{color:"geekblue",children:l("Action on existing records")})},{dataIndex:"enabled",title:l("Allow"),render:(h,g)=>a.jsx(x.Checkbox,{checked:h,onChange:()=>{w(g.name)}})},{dataIndex:"scope",title:l("Data scope"),render:(h,g)=>!g.onNewRecord&&a.jsx(qf,{value:h,onChange:b=>{A(g.name,b)}})}],dataSource:i==null?void 0:i.map(h=>{let g=!1,b=null;return u[h.name]&&(g=!0,h.onNewRecord||(b=u[h.name].scope)),K(T({},h),{enabled:g,scope:b})})})}),a.jsx(ae.FormItem,{label:l("Field permission"),children:a.jsx(x.Table,{className:t,pagination:!1,dataSource:S,columns:[{dataIndex:["uiSchema","title"],title:l("Field display name"),render:(h,g)=>c(h)||g.name},...m.map(h=>{const g=C==null?void 0:C[h.name];return{dataIndex:h.name,title:a.jsxs(a.Fragment,{children:[a.jsx(x.Checkbox,{checked:g,onChange:()=>{var _;const b=u[h.name]||{name:h.name};g?b.fields=[]:b.fields=(_=s==null?void 0:s.map)==null?void 0:_.call(s,N=>N.name),u[h.name]=b,o(Object.values(u))}}),c(h.displayName)]}),render:(b,_)=>a.jsx(x.Checkbox,{checked:b,onChange:()=>{const N=u[h.name]||{name:h.name},E=N.fields||[];if(b){const D=E.indexOf(_.name);E.splice(D,1)}else E.push(_.name);N.fields=E,u[h.name]=N,o(Object.values(u))}})}})]})})]})})})}),Uf={type:"object",properties:{[V.uid()]:{"x-component":"DataSourceTable"}}},be=p.createContext({});be.displayName="CurrentRolesContext";const Hf=({role:e})=>a.jsx(x.Card,{"data-testid":"acl-pane-card",bordered:!1,children:a.jsx(be.Provider,{value:e,children:a.jsx(r.SchemaComponent,{components:{MenuConfigure:r.MenuConfigure,RoleConfigure:kf,RolesResourcesActions:zf,DataSourceTable:Mf,StrategyActions:jf,SettingsCenterConfigure:r.SettingsCenterConfigure,SettingCenterProvider:r.SettingCenterProvider,ResourceActionProvider:r.ResourceActionProvider,RoleRecordProvider:wf},schema:Uf})})});class xe extends r.Plugin{constructor(){super(...arguments);Xo(this,"types",new Map)}load(){return P(this,null,function*(){this.app.addComponents({DataSourcePermissionManager:Hf}),this.app.use(an),this.app.pluginSettingsManager.add(j,{title:`{{t("Data sources", { ns: "${j}" })}}`,icon:"ClusterOutlined",showTabs:!1,aclSnippet:"pm.data-source-manager*"}),this.app.pluginSettingsManager.add(`${j}.list`,{title:`{{t("Data sources", { ns: "${j}" })}}`,Component:of,sort:1,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),this.app.pluginSettingsManager.add(`${j}/:name`,{title:a.jsx(ht,{}),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),this.app.pluginSettingsManager.add(`${j}/main`,{title:a.jsx(ht,{}),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.pluginSettingsManager.add(`${j}/main.collections`,{title:`{{t("Collections", { ns: "${j}" })}}`,Component:Tf,topLevelName:`${j}/main`,pluginKey:j,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.pluginSettingsManager.add(`${j}/:name.collections`,{title:`{{t("Collections", { ns: "${j}" })}}`,Component:Zy,topLevelName:`${j}/:name`,pluginKey:j,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.dataSourceManager.addDataSources(this.getThirdDataSource.bind(this),yt)})}setDataSources(){return P(this,null,function*(){var n;const o=yield this.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1}});return(n=o==null?void 0:o.data)==null?void 0:n.data})}getThirdDataSource(){return P(this,null,function*(){var n;const o=yield this.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1,appends:["collections"]}});return(n=o==null?void 0:o.data)==null?void 0:n.data})}registerType(o,n){this.types.set(o,n)}}O.PluginDataSourceManagerClient=xe,O.default=xe,Object.defineProperties(O,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
59
|
+
`),Nf=(e="main")=>({name:`dataSources/${e}/rolesResourcesScopes`,fields:[{type:"string",name:"name",interface:"input",uiSchema:{title:'{{t("Scope name")}}',type:"string","x-component":"Input",required:!0}}]}),Bf=()=>{const{name:e}=p.useContext(me),t=r.useFormBlockContext();return p.useEffect(()=>{t.form.setInitialValues({resourceName:e})},[e]),{form:t.form}},Vf=e=>{const t=Nf(e);return{type:"object",properties:{scope:{"x-component":"RecordPicker","x-component-props":{size:"small",fieldNames:{label:"name",value:"id"},multiple:!1,association:{target:"rolesResourcesScopes"},onChange:"{{ onChange }}"},properties:{selector:{type:"void",title:'{{ t("Select record") }}',"x-component":"RecordPicker.Selector","x-component-props":{className:"nb-record-picker-selector"},properties:{tableBlock:{type:"void","x-decorator":"TableSelectorProvider","x-decorator-props":{collection:t,resource:`dataSources/${e}/rolesResourcesScopes`,action:"list",params:{pageSize:20},useParams(){return{filter:{$or:[{resourceName:p.useContext(me).name},{resourceName:null}]}}},rowKey:"id"},"x-component":"BlockItem",properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{style:{marginBottom:16}},properties:{create:{type:"void",title:'{{ t("Add new") }}',"x-action":"create","x-component":"Action","x-component-props":{icon:"PlusOutlined",openMode:"drawer",type:"primary"},properties:{drawer:{type:"void",title:'{{ t("Add record") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{formBlock:{type:"void","x-decorator":"FormBlockProvider","x-decorator-props":{resource:`dataSources/${e}/rolesResourcesScopes`,collection:t},"x-component":"CardItem",properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":Bf,properties:{name:{type:"string","x-component":"CollectionField","x-decorator":"FormItem"},scope:{type:"object",title:'{{t("Data scope")}}',name:"filter","x-decorator":"FormItem","x-component":r.withDynamicSchemaProps(o=>a.jsx(r.FlagProvider,{isVariableParsedInOtherContext:!0,children:a.jsx(r.Filter,T({},o))})),"x-use-component-props":()=>{const o=p.useContext(me);return{options:r.useFilterFieldOptions(o.fields)}},"x-component-props":{dynamicComponent:r.VariableInput}},actions:{type:"void","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{marginTop:24}},properties:{create:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useCreateActionProps","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}}}}}}},value:{type:"array","x-component":"TableV2.Selector","x-use-component-props":"useTableSelectorProps","x-component-props":{rowKey:"id",rowSelection:{type:"checkbox"}},properties:{column1:{type:"void","x-decorator":"TableV2.Column.Decorator","x-component":"TableV2.Column",properties:{name:{type:"string","x-component":"CollectionField","x-read-pretty":!0}}},actions:{type:"void",title:'{{ t("Actions") }}',"x-action-column":"actions","x-component":"TableV2.Column",properties:{actions:{type:"void","x-decorator":"DndContext","x-component":"Space","x-component-props":{split:"|"},properties:{edit:{type:"void",title:'{{ t("Edit") }}',"x-action":"update","x-decorator":"ACLActionProvider","x-component":"Action.Link","x-component-props":{openMode:"drawer",icon:"EditOutlined"},properties:{drawer:{type:"void",title:'{{ t("Edit record") }}',"x-component":"Action.Container","x-component-props":{className:"nb-action-popup"},properties:{formBlock:{type:"void","x-decorator":"FormBlockProvider","x-decorator-props":{resource:`dataSources/${e}/rolesResourcesScopes`,collection:t,action:"get",useParams:"{{ useParamsFromRecord }}"},"x-component":"CardItem",properties:{form:{type:"void","x-component":"FormV2","x-use-component-props":"useFormBlockProps",properties:{name:{type:"string","x-component":"CollectionField","x-decorator":"FormItem"},scope:{type:"object",title:'{{t("Data scope")}}',name:"filter","x-decorator":"FormItem","x-component":r.withDynamicSchemaProps(o=>a.jsx(r.FlagProvider,{isVariableParsedInOtherContext:!0,children:a.jsx(r.Filter,T({},o))})),"x-use-component-props":()=>{const o=p.useContext(me);return{options:r.useFilterFieldOptions(o.fields)}},"x-component-props":{dynamicComponent:r.VariableInput}},actions:{type:"void","x-component":"ActionBar","x-component-props":{layout:"one-column",style:{marginTop:24}},properties:{update:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"useUpdateActionProps","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}}}}},destroy:{title:'{{ t("Delete") }}',"x-action":"destroy","x-decorator":"ACLActionProvider","x-component":"Action.Link","x-use-component-props":"useDestroyActionProps","x-component-props":{icon:"DeleteOutlined",confirm:{title:"{{t('Delete record')}}",content:"{{t('Are you sure you want to delete it?')}}"}}}}}}}}}}},footer:{"x-component":"Action.Container.Footer","x-component-props":{},properties:{actions:{type:"void","x-component":"ActionBar","x-component-props":{},properties:{submit:{title:'{{ t("Submit") }}',"x-action":"submit","x-component":"Action","x-use-component-props":"usePickActionProps","x-component-props":{type:"primary",htmlType:"submit"}}}}}}}}}}}}},Wo=p.createContext(null);Wo.displayName="RolesResourcesScopesSelectedRowKeysContext";const Lf=e=>{const[t,o]=p.useState([]);return a.jsx(Wo.Provider,{value:[t,o],children:e.children})},qf=e=>{var i;const t=p.useMemo(()=>fe.createForm({values:{scope:e.value}}),[]),{key:o}=((i=r.useCollectionRecord())==null?void 0:i.parentRecord.data)||{},n=Vf(o);return a.jsx(r.FormProvider,{form:t,children:a.jsx(r.SchemaComponent,{components:{RolesResourcesScopesSelectedRowKeysProvider:Lf},scope:{onChange(s){var c;(c=e==null?void 0:e.onChange)==null||c.call(e,s)}},schema:n})})},Gf=e=>{var o;const t={};return(o=e==null?void 0:e.forEach)==null||o.call(e,n=>{n.name&&(t[n.name]=n,t[n.name].scope=Y.isEmpty(n.scope)?null:n.scope)}),t},me=p.createContext({});me.displayName="RoleResourceCollectionContext";const zf=F.connect(e=>{var v,d;const{styles:t}=Kf(),o=h=>{const g=h.map(b=>K(T({},b),{scope:Y.isEmpty(b.scope)?null:b.scope}));e.onChange(g)},n=r.useRecord(),i=Uo(),s=n.fields,c=r.useCompile(),{t:l}=B.useTranslation(),y=F.useField(),u=Gf(y.value||[]),f=(h,g)=>{var _;const b=u==null?void 0:u[h];return b?(_=b==null?void 0:b.fields)==null?void 0:_.includes(g):!1},m=i.filter(h=>h.allowConfigureFields),S=s==null?void 0:s.map(h=>{const g=T({},h);for(const b of m)g[b.name]=f(b.name,h.name);return g}),w=h=>{var g;u[h]?delete u[h]:u[h]={name:h,fields:(g=s==null?void 0:s.map)==null?void 0:g.call(s,b=>b.name)},o(Object.values(u))},A=(h,g)=>{u[h]?(u[h].scope=g,o(Object.values(u))):(w(h),u[h].scope=g,o(Object.values(u)))},C={};for(const h of m)C[h.name]=(s==null?void 0:s.length)===((d=(v=u==null?void 0:u[h.name])==null?void 0:v.fields)==null?void 0:d.length);return a.jsx("div",{children:a.jsx(me.Provider,{value:n,children:a.jsxs(ae.FormLayout,{layout:"vertical",children:[a.jsx(ae.FormItem,{label:l("Action permission"),children:a.jsx(x.Table,{className:t,size:"small",pagination:!1,columns:[{dataIndex:"displayName",title:l("Action display name"),render:h=>c(h)},{dataIndex:"onNewRecord",title:l("Action type"),render:h=>h?a.jsx(x.Tag,{color:"green",children:l("Action on new records")}):a.jsx(x.Tag,{color:"geekblue",children:l("Action on existing records")})},{dataIndex:"enabled",title:l("Allow"),render:(h,g)=>a.jsx(x.Checkbox,{checked:h,onChange:()=>{w(g.name)}})},{dataIndex:"scope",title:l("Data scope"),render:(h,g)=>!g.onNewRecord&&a.jsx(qf,{value:h,onChange:b=>{A(g.name,b)}})}],dataSource:i==null?void 0:i.map(h=>{let g=!1,b=null;return u[h.name]&&(g=!0,h.onNewRecord||(b=u[h.name].scope)),K(T({},h),{enabled:g,scope:b})})})}),a.jsx(ae.FormItem,{label:l("Field permission"),children:a.jsx(x.Table,{className:t,pagination:!1,dataSource:S,columns:[{dataIndex:["uiSchema","title"],title:l("Field display name"),render:(h,g)=>c(h)||g.name},...m.map(h=>{const g=C==null?void 0:C[h.name];return{dataIndex:h.name,title:a.jsxs(a.Fragment,{children:[a.jsx(x.Checkbox,{checked:g,onChange:()=>{var _;const b=u[h.name]||{name:h.name};g?b.fields=[]:b.fields=(_=s==null?void 0:s.map)==null?void 0:_.call(s,N=>N.name),u[h.name]=b,o(Object.values(u))}}),c(h.displayName)]}),render:(b,_)=>a.jsx(x.Checkbox,{checked:b,onChange:()=>{const N=u[h.name]||{name:h.name},E=N.fields||[];if(b){const D=E.indexOf(_.name);E.splice(D,1)}else E.push(_.name);N.fields=E,u[h.name]=N,o(Object.values(u))}})}})]})})]})})})}),Uf={type:"object",properties:{[V.uid()]:{"x-component":"DataSourceTable"}}},be=p.createContext({});be.displayName="CurrentRolesContext";const Hf=({role:e})=>a.jsx(x.Card,{"data-testid":"acl-pane-card",bordered:!1,children:a.jsx(be.Provider,{value:e,children:a.jsx(r.SchemaComponent,{components:{MenuConfigure:r.MenuConfigure,RoleConfigure:kf,RolesResourcesActions:zf,DataSourceTable:Mf,StrategyActions:jf,SettingsCenterConfigure:r.SettingsCenterConfigure,SettingCenterProvider:r.SettingCenterProvider,ResourceActionProvider:r.ResourceActionProvider,RoleRecordProvider:wf},schema:Uf})})});class xe extends r.Plugin{constructor(){super(...arguments);Xo(this,"types",new Map)}load(){return P(this,null,function*(){this.app.addComponents({DataSourcePermissionManager:Hf}),this.app.use(an),this.app.pluginSettingsManager.add(j,{title:`{{t("Data sources", { ns: "${j}" })}}`,icon:"ClusterOutlined",showTabs:!1,aclSnippet:"pm.data-source-manager*"}),this.app.pluginSettingsManager.add(`${j}.list`,{title:`{{t("Data sources", { ns: "${j}" })}}`,Component:of,sort:1,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),this.app.pluginSettingsManager.add(`${j}/:name`,{title:a.jsx(ht,{}),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager"}),this.app.pluginSettingsManager.add(`${j}/main`,{title:a.jsx(ht,{}),icon:"ClusterOutlined",isTopLevel:!1,sort:100,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.pluginSettingsManager.add(`${j}/main.collections`,{title:`{{t("Collections", { ns: "${j}" })}}`,Component:Tf,topLevelName:`${j}/main`,pluginKey:j,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.pluginSettingsManager.add(`${j}/:name.collections`,{title:`{{t("Collections", { ns: "${j}" })}}`,Component:Zy,topLevelName:`${j}/:name`,pluginKey:j,skipAclConfigure:!0,aclSnippet:"pm.data-source-manager.data-source-main"}),this.app.dataSourceManager.addDataSources(this.getThirdDataSource.bind(this),yt)})}setDataSources(){return P(this,null,function*(){var n;const o=yield this.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1}});return(n=o==null?void 0:o.data)==null?void 0:n.data})}getThirdDataSource(){return P(this,null,function*(){var n;const o=yield this.app.apiClient.request({resource:"dataSources",action:"listEnabled",params:{paginate:!1,appends:["collections"]}});return(n=o==null?void 0:o.data)==null?void 0:n.data})}registerType(o,n){this.types.set(o,n)}}O.PluginDataSourceManagerClient=xe,O.default=xe,Object.defineProperties(O,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.2.
|
|
11
|
+
"@nocobase/client": "1.2.17-alpha",
|
|
12
12
|
"react": "18.2.0",
|
|
13
|
-
"@nocobase/server": "1.2.
|
|
13
|
+
"@nocobase/server": "1.2.17-alpha",
|
|
14
14
|
"lodash": "4.17.21",
|
|
15
15
|
"@ant-design/icons": "5.2.6",
|
|
16
16
|
"antd": "5.12.8",
|
|
@@ -19,12 +19,12 @@ module.exports = {
|
|
|
19
19
|
"react-i18next": "11.18.6",
|
|
20
20
|
"@formily/react": "2.3.0",
|
|
21
21
|
"@emotion/css": "11.11.2",
|
|
22
|
-
"@nocobase/database": "1.2.
|
|
23
|
-
"@nocobase/utils": "1.2.
|
|
24
|
-
"@nocobase/plugin-acl": "1.2.
|
|
25
|
-
"@nocobase/acl": "1.2.
|
|
22
|
+
"@nocobase/database": "1.2.17-alpha",
|
|
23
|
+
"@nocobase/utils": "1.2.17-alpha",
|
|
24
|
+
"@nocobase/plugin-acl": "1.2.17-alpha",
|
|
25
|
+
"@nocobase/acl": "1.2.17-alpha",
|
|
26
26
|
"sequelize": "6.35.2",
|
|
27
|
-
"@nocobase/test": "1.2.
|
|
27
|
+
"@nocobase/test": "1.2.17-alpha",
|
|
28
28
|
"@formily/antd-v5": "1.1.9",
|
|
29
29
|
"@formily/core": "2.3.0",
|
|
30
30
|
"@formily/reactive": "2.3.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-data-source-manager",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.17-alpha",
|
|
4
4
|
"main": "dist/server/index.js",
|
|
5
5
|
"displayName": "Data source manager",
|
|
6
6
|
"displayName.zh-CN": "数据源管理",
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"keywords": [
|
|
17
17
|
"Data model tools"
|
|
18
18
|
],
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "76ca7a1be6d868a536cb7d4ce41c4f8629363d15"
|
|
20
20
|
}
|