@hrbolek/uoisfrontend-template 0.6.0
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/index.html +104 -0
- package/package.json +24 -0
- package/src/Base/Components/Attribute.jsx +51 -0
- package/src/Base/Components/CardCapsule.jsx +353 -0
- package/src/Base/Components/Col.jsx +36 -0
- package/src/Base/Components/ConfirmEdit.jsx +61 -0
- package/src/Base/Components/CopyButton.jsx +33 -0
- package/src/Base/Components/LargeCard.jsx +22 -0
- package/src/Base/Components/Link.jsx +42 -0
- package/src/Base/Components/LiveEdit.jsx +64 -0
- package/src/Base/Components/MediumCard.jsx +30 -0
- package/src/Base/Components/MediumContent.jsx +74 -0
- package/src/Base/Components/MediumEditableContent.jsx +52 -0
- package/src/Base/Components/ProxyLink.jsx +132 -0
- package/src/Base/Components/Row.jsx +23 -0
- package/src/Base/Components/Table.jsx +275 -0
- package/src/Base/Components/index.js +14 -0
- package/src/Base/Components/style.js +278 -0
- package/src/Base/FormControls/Collapsible.jsx +46 -0
- package/src/Base/FormControls/Dialog.jsx +75 -0
- package/src/Base/FormControls/EntityLookup.jsx +175 -0
- package/src/Base/FormControls/Filter.jsx +834 -0
- package/src/Base/FormControls/Input.jsx +163 -0
- package/src/Base/FormControls/Label.jsx +40 -0
- package/src/Base/FormControls/Select.jsx +150 -0
- package/src/Base/FormControls/TextArea.jsx +86 -0
- package/src/Base/FormControls/index.js +8 -0
- package/src/Base/Helpers/AsyncStateIndicator.jsx +9 -0
- package/src/Base/Helpers/GQLEntityProvider.jsx +163 -0
- package/src/Base/Helpers/NavigationHistoryProvider.jsx +178 -0
- package/src/Base/Helpers/PlaceChild.jsx +13 -0
- package/src/Base/Helpers/generateQuery.js +508 -0
- package/src/Base/Helpers/index.js +5 -0
- package/src/Base/Mutations/Create.jsx +152 -0
- package/src/Base/Mutations/Delete.jsx +237 -0
- package/src/Base/Mutations/General.jsx +241 -0
- package/src/Base/Mutations/InteractiveMutations.jsx +32 -0
- package/src/Base/Mutations/Update.jsx +270 -0
- package/src/Base/Mutations/helpers.jsx +7 -0
- package/src/Base/Mutations/index.js +5 -0
- package/src/Base/Pages/Page.jsx +235 -0
- package/src/Base/Pages/PageCatch.jsx +235 -0
- package/src/Base/Pages/PageNavbar.jsx +70 -0
- package/src/Base/Pages/PageVector.jsx +229 -0
- package/src/Base/Pages/RouterSegment.jsx +66 -0
- package/src/Base/Pages/index.js +5 -0
- package/src/Base/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/Base/Queries/Fragments.jsx +101 -0
- package/src/Base/Queries/InsertAsyncAction.jsx +40 -0
- package/src/Base/Queries/ReadAsyncAction.jsx +44 -0
- package/src/Base/Queries/ReadPageAsyncAction.jsx +16 -0
- package/src/Base/Queries/SearchAsyncAction.jsx +16 -0
- package/src/Base/Queries/UpdateAsyncAction.jsx +40 -0
- package/src/Base/Queries/index.js +6 -0
- package/src/Base/Scalars/ScalarAttribute.jsx +49 -0
- package/src/Base/Scalars/index.js +1 -0
- package/src/Base/Vectors/VectorAttribute.jsx +137 -0
- package/src/Base/Vectors/index.js +1 -0
- package/src/Base/index.js +32 -0
- package/src/GroupGQLModel/Components/CUDButton.jsx +128 -0
- package/src/GroupGQLModel/Components/CardCapsule.jsx +44 -0
- package/src/GroupGQLModel/Components/Children.jsx +31 -0
- package/src/GroupGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/GroupGQLModel/Components/Filter.jsx +14 -0
- package/src/GroupGQLModel/Components/LargeCard.jsx +68 -0
- package/src/GroupGQLModel/Components/Link.jsx +54 -0
- package/src/GroupGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/GroupGQLModel/Components/MediumCard.jsx +51 -0
- package/src/GroupGQLModel/Components/MediumContent.jsx +56 -0
- package/src/GroupGQLModel/Components/MediumEditableContent.jsx +52 -0
- package/src/GroupGQLModel/Components/Table.jsx +70 -0
- package/src/GroupGQLModel/Components/index.js +14 -0
- package/src/GroupGQLModel/Mutations/AddMembership.jsx +156 -0
- package/src/GroupGQLModel/Mutations/Create.jsx +67 -0
- package/src/GroupGQLModel/Mutations/Delete.jsx +81 -0
- package/src/GroupGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/GroupGQLModel/Mutations/Update.jsx +74 -0
- package/src/GroupGQLModel/Pages/PageBase.jsx +56 -0
- package/src/GroupGQLModel/Pages/PageCreateItem.jsx +27 -0
- package/src/GroupGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/GroupGQLModel/Pages/PageNavbar.jsx +264 -0
- package/src/GroupGQLModel/Pages/PageReadItem.jsx +12 -0
- package/src/GroupGQLModel/Pages/PageReadItemEx.jsx +57 -0
- package/src/GroupGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/GroupGQLModel/Pages/PageVector.jsx +80 -0
- package/src/GroupGQLModel/Pages/RouterSegment.jsx +85 -0
- package/src/GroupGQLModel/Pages/index.js +2 -0
- package/src/GroupGQLModel/Queries/DeleteAsyncAction.jsx +22 -0
- package/src/GroupGQLModel/Queries/Fragments.jsx +129 -0
- package/src/GroupGQLModel/Queries/InsertAsyncAction.jsx +43 -0
- package/src/GroupGQLModel/Queries/ReadAsyncAction.jsx +44 -0
- package/src/GroupGQLModel/Queries/ReadPageAsyncAction.jsx +18 -0
- package/src/GroupGQLModel/Queries/SearchAsyncAction.jsx +15 -0
- package/src/GroupGQLModel/Queries/UpdateAsyncAction.jsx +56 -0
- package/src/GroupGQLModel/Queries/index.js +6 -0
- package/src/GroupGQLModel/Scalars/GroupRoles.jsx +69 -0
- package/src/GroupGQLModel/Scalars/MasterGroup.jsx +15 -0
- package/src/GroupGQLModel/Scalars/RBACObject.jsx +233 -0
- package/src/GroupGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/GroupGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/GroupGQLModel/Scalars/index.js +1 -0
- package/src/GroupGQLModel/Vectors/GroupMemberships.jsx +115 -0
- package/src/GroupGQLModel/Vectors/GroupRoles.jsx +112 -0
- package/src/GroupGQLModel/Vectors/GroupRolesOn.jsx +113 -0
- package/src/GroupGQLModel/Vectors/GroupSubgroups.jsx +97 -0
- package/src/GroupGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/GroupGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/GroupGQLModel/Vectors/index.js +1 -0
- package/src/GroupGQLModel/index.js +7 -0
- package/src/GroupTypeGQLModel/Components/CUDButton.jsx +128 -0
- package/src/GroupTypeGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/GroupTypeGQLModel/Components/Children.jsx +31 -0
- package/src/GroupTypeGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/GroupTypeGQLModel/Components/Filter.jsx +14 -0
- package/src/GroupTypeGQLModel/Components/LargeCard.jsx +49 -0
- package/src/GroupTypeGQLModel/Components/Link.jsx +53 -0
- package/src/GroupTypeGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/GroupTypeGQLModel/Components/MediumCard.jsx +39 -0
- package/src/GroupTypeGQLModel/Components/MediumContent.jsx +97 -0
- package/src/GroupTypeGQLModel/Components/MediumEditableContent.jsx +35 -0
- package/src/GroupTypeGQLModel/Components/Table.jsx +7 -0
- package/src/GroupTypeGQLModel/Components/index.js +14 -0
- package/src/GroupTypeGQLModel/Mutations/Create.jsx +67 -0
- package/src/GroupTypeGQLModel/Mutations/Delete.jsx +80 -0
- package/src/GroupTypeGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/GroupTypeGQLModel/Mutations/Update.jsx +74 -0
- package/src/GroupTypeGQLModel/Pages/Page.jsx +3 -0
- package/src/GroupTypeGQLModel/Pages/PageBase.jsx +26 -0
- package/src/GroupTypeGQLModel/Pages/PageCreateItem.jsx +21 -0
- package/src/GroupTypeGQLModel/Pages/PageDeleteItem.jsx +13 -0
- package/src/GroupTypeGQLModel/Pages/PageNavbar.jsx +148 -0
- package/src/GroupTypeGQLModel/Pages/PageReadItem.jsx +28 -0
- package/src/GroupTypeGQLModel/Pages/PageUpdateItem.jsx +25 -0
- package/src/GroupTypeGQLModel/Pages/PageVector.jsx +83 -0
- package/src/GroupTypeGQLModel/Pages/RouterSegment.jsx +68 -0
- package/src/GroupTypeGQLModel/Pages/index.js +10 -0
- package/src/GroupTypeGQLModel/Queries/DeleteAsyncAction.jsx +27 -0
- package/src/GroupTypeGQLModel/Queries/Fragments.jsx +96 -0
- package/src/GroupTypeGQLModel/Queries/InsertAsyncAction.jsx +41 -0
- package/src/GroupTypeGQLModel/Queries/ReadAsyncAction.jsx +45 -0
- package/src/GroupTypeGQLModel/Queries/ReadPageAsyncAction.jsx +14 -0
- package/src/GroupTypeGQLModel/Queries/SearchAsyncAction.jsx +16 -0
- package/src/GroupTypeGQLModel/Queries/UpdateAsyncAction.jsx +42 -0
- package/src/GroupTypeGQLModel/Queries/index.js +6 -0
- package/src/GroupTypeGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/GroupTypeGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/GroupTypeGQLModel/Scalars/index.js +1 -0
- package/src/GroupTypeGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/GroupTypeGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/GroupTypeGQLModel/Vectors/index.js +1 -0
- package/src/GroupTypeGQLModel/index.js +6 -0
- package/src/MembershipGQLModel/Components/CUDButton.jsx +128 -0
- package/src/MembershipGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/MembershipGQLModel/Components/Children.jsx +31 -0
- package/src/MembershipGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/MembershipGQLModel/Components/Filter.jsx +14 -0
- package/src/MembershipGQLModel/Components/LargeCard.jsx +49 -0
- package/src/MembershipGQLModel/Components/Link.jsx +54 -0
- package/src/MembershipGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/MembershipGQLModel/Components/MediumCard.jsx +39 -0
- package/src/MembershipGQLModel/Components/MediumContent.jsx +97 -0
- package/src/MembershipGQLModel/Components/MediumEditableContent.jsx +35 -0
- package/src/MembershipGQLModel/Components/Table.jsx +7 -0
- package/src/MembershipGQLModel/Components/index.js +14 -0
- package/src/MembershipGQLModel/Mutations/Create.jsx +67 -0
- package/src/MembershipGQLModel/Mutations/Delete.jsx +80 -0
- package/src/MembershipGQLModel/Mutations/InteractiveMutations.jsx +31 -0
- package/src/MembershipGQLModel/Mutations/Update.jsx +74 -0
- package/src/MembershipGQLModel/Mutations/helpers.jsx +7 -0
- package/src/MembershipGQLModel/Pages/PageBase.jsx +57 -0
- package/src/MembershipGQLModel/Pages/PageCreateItem.jsx +28 -0
- package/src/MembershipGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/MembershipGQLModel/Pages/PageNavbar.jsx +110 -0
- package/src/MembershipGQLModel/Pages/PageReadItem.jsx +11 -0
- package/src/MembershipGQLModel/Pages/PageReadItemEx.jsx +42 -0
- package/src/MembershipGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/MembershipGQLModel/Pages/PageVector.jsx +80 -0
- package/src/MembershipGQLModel/Pages/RouterSegment.jsx +73 -0
- package/src/MembershipGQLModel/Pages/index.js +2 -0
- package/src/MembershipGQLModel/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/MembershipGQLModel/Queries/Fragments.jsx +113 -0
- package/src/MembershipGQLModel/Queries/InsertAsyncAction.jsx +38 -0
- package/src/MembershipGQLModel/Queries/ReadAsyncAction.jsx +44 -0
- package/src/MembershipGQLModel/Queries/ReadPageAsyncAction.jsx +13 -0
- package/src/MembershipGQLModel/Queries/SearchAsyncAction.jsx +16 -0
- package/src/MembershipGQLModel/Queries/UpdateAsyncAction.jsx +40 -0
- package/src/MembershipGQLModel/Queries/index.js +6 -0
- package/src/MembershipGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/MembershipGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/MembershipGQLModel/Scalars/index.js +1 -0
- package/src/MembershipGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/MembershipGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/MembershipGQLModel/Vectors/index.js +1 -0
- package/src/MembershipGQLModel/WhatToDo.md +44 -0
- package/src/MembershipGQLModel/index.js +6 -0
- package/src/RBACGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/RBACGQLModel/Components/Children.jsx +31 -0
- package/src/RBACGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/RBACGQLModel/Components/Filter.jsx +14 -0
- package/src/RBACGQLModel/Components/LargeCard.jsx +50 -0
- package/src/RBACGQLModel/Components/Link.jsx +54 -0
- package/src/RBACGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/RBACGQLModel/Components/MediumCard.jsx +39 -0
- package/src/RBACGQLModel/Components/MediumContent.jsx +96 -0
- package/src/RBACGQLModel/Components/MediumEditableContent.jsx +212 -0
- package/src/RBACGQLModel/Components/Table.jsx +7 -0
- package/src/RBACGQLModel/Components/index.js +13 -0
- package/src/RBACGQLModel/Mutations/Create.jsx +202 -0
- package/src/RBACGQLModel/Mutations/Delete.jsx +173 -0
- package/src/RBACGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/RBACGQLModel/Mutations/Update.jsx +147 -0
- package/src/RBACGQLModel/Mutations/helpers.jsx +7 -0
- package/src/RBACGQLModel/Pages/PageBase.jsx +56 -0
- package/src/RBACGQLModel/Pages/PageCreateItem.jsx +28 -0
- package/src/RBACGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/RBACGQLModel/Pages/PageNavbar.jsx +160 -0
- package/src/RBACGQLModel/Pages/PageReadItem.jsx +11 -0
- package/src/RBACGQLModel/Pages/PageReadItemEx.jsx +42 -0
- package/src/RBACGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/RBACGQLModel/Pages/PageVector.jsx +80 -0
- package/src/RBACGQLModel/Pages/RouterSegment.jsx +72 -0
- package/src/RBACGQLModel/Pages/index.js +2 -0
- package/src/RBACGQLModel/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/RBACGQLModel/Queries/Fragments.jsx +101 -0
- package/src/RBACGQLModel/Queries/InsertAsyncAction.jsx +40 -0
- package/src/RBACGQLModel/Queries/ReadAsyncAction.jsx +44 -0
- package/src/RBACGQLModel/Queries/ReadPageAsyncAction.jsx +13 -0
- package/src/RBACGQLModel/Queries/SearchAsyncAction.jsx +16 -0
- package/src/RBACGQLModel/Queries/UpdateAsyncAction.jsx +40 -0
- package/src/RBACGQLModel/Queries/index.js +6 -0
- package/src/RBACGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/RBACGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/RBACGQLModel/Scalars/index.js +1 -0
- package/src/RBACGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/RBACGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/RBACGQLModel/Vectors/index.js +1 -0
- package/src/RBACGQLModel/WhatToDo.md +44 -0
- package/src/RBACGQLModel/index.js +71 -0
- package/src/RoleGQLModel/Components/CUDButton.jsx +128 -0
- package/src/RoleGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/RoleGQLModel/Components/Children.jsx +31 -0
- package/src/RoleGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/RoleGQLModel/Components/Filter.jsx +14 -0
- package/src/RoleGQLModel/Components/LargeCard.jsx +49 -0
- package/src/RoleGQLModel/Components/Link.jsx +55 -0
- package/src/RoleGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/RoleGQLModel/Components/MediumCard.jsx +39 -0
- package/src/RoleGQLModel/Components/MediumContent.jsx +97 -0
- package/src/RoleGQLModel/Components/MediumEditableContent.jsx +72 -0
- package/src/RoleGQLModel/Components/RBACObject.jsx +22 -0
- package/src/RoleGQLModel/Components/Table.jsx +82 -0
- package/src/RoleGQLModel/Components/index.js +14 -0
- package/src/RoleGQLModel/Mutations/AddRoleOnGroup.jsx +117 -0
- package/src/RoleGQLModel/Mutations/Create.jsx +67 -0
- package/src/RoleGQLModel/Mutations/Delete.jsx +80 -0
- package/src/RoleGQLModel/Mutations/InteractiveMutations.jsx +31 -0
- package/src/RoleGQLModel/Mutations/Update.jsx +74 -0
- package/src/RoleGQLModel/Pages/Page.jsx +3 -0
- package/src/RoleGQLModel/Pages/PageBase.jsx +26 -0
- package/src/RoleGQLModel/Pages/PageContent.jsx +31 -0
- package/src/RoleGQLModel/Pages/PageCreateItem.jsx +21 -0
- package/src/RoleGQLModel/Pages/PageDeleteItem.jsx +13 -0
- package/src/RoleGQLModel/Pages/PageNavbar.jsx +161 -0
- package/src/RoleGQLModel/Pages/PageReadItem.jsx +28 -0
- package/src/RoleGQLModel/Pages/PageUpdateItem.jsx +25 -0
- package/src/RoleGQLModel/Pages/PageVector.jsx +83 -0
- package/src/RoleGQLModel/Pages/RouterSegment.jsx +69 -0
- package/src/RoleGQLModel/Pages/index.js +10 -0
- package/src/RoleGQLModel/Queries/DeleteAsyncAction.jsx +22 -0
- package/src/RoleGQLModel/Queries/Fragments.jsx +123 -0
- package/src/RoleGQLModel/Queries/InsertAsyncAction.jsx +45 -0
- package/src/RoleGQLModel/Queries/ReadAsyncAction.jsx +45 -0
- package/src/RoleGQLModel/Queries/ReadPageAsyncAction.jsx +13 -0
- package/src/RoleGQLModel/Queries/UpdateAsyncAction.jsx +35 -0
- package/src/RoleGQLModel/Queries/index.js +6 -0
- package/src/RoleGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/RoleGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/RoleGQLModel/Scalars/index.js +1 -0
- package/src/RoleGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/RoleGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/RoleGQLModel/Vectors/index.js +1 -0
- package/src/RoleGQLModel/index.js +6 -0
- package/src/RoleTypeGQLModel/Components/CUDButton.jsx +128 -0
- package/src/RoleTypeGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/RoleTypeGQLModel/Components/Children.jsx +31 -0
- package/src/RoleTypeGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/RoleTypeGQLModel/Components/Filter.jsx +14 -0
- package/src/RoleTypeGQLModel/Components/LargeCard.jsx +49 -0
- package/src/RoleTypeGQLModel/Components/Link.jsx +55 -0
- package/src/RoleTypeGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/RoleTypeGQLModel/Components/MediumCard.jsx +39 -0
- package/src/RoleTypeGQLModel/Components/MediumContent.jsx +97 -0
- package/src/RoleTypeGQLModel/Components/MediumEditableContent.jsx +35 -0
- package/src/RoleTypeGQLModel/Components/Table.jsx +7 -0
- package/src/RoleTypeGQLModel/Components/index.js +14 -0
- package/src/RoleTypeGQLModel/Mutations/Create.jsx +67 -0
- package/src/RoleTypeGQLModel/Mutations/Delete.jsx +80 -0
- package/src/RoleTypeGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/RoleTypeGQLModel/Mutations/Update.jsx +74 -0
- package/src/RoleTypeGQLModel/Pages/Page.jsx +3 -0
- package/src/RoleTypeGQLModel/Pages/PageBase.jsx +56 -0
- package/src/RoleTypeGQLModel/Pages/PageCreateItem.jsx +27 -0
- package/src/RoleTypeGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/RoleTypeGQLModel/Pages/PageNavbar.jsx +148 -0
- package/src/RoleTypeGQLModel/Pages/PageReadItem.jsx +11 -0
- package/src/RoleTypeGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/RoleTypeGQLModel/Pages/PageVector.jsx +79 -0
- package/src/RoleTypeGQLModel/Pages/RouterSegment.jsx +69 -0
- package/src/RoleTypeGQLModel/Pages/index.js +10 -0
- package/src/RoleTypeGQLModel/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/RoleTypeGQLModel/Queries/Fragments.jsx +103 -0
- package/src/RoleTypeGQLModel/Queries/InsertAsyncAction.jsx +40 -0
- package/src/RoleTypeGQLModel/Queries/ReadAsyncAction.jsx +44 -0
- package/src/RoleTypeGQLModel/Queries/ReadPageAsyncAction.jsx +13 -0
- package/src/RoleTypeGQLModel/Queries/SearchAsyncAction.jsx +29 -0
- package/src/RoleTypeGQLModel/Queries/UpdateAsyncAction.jsx +40 -0
- package/src/RoleTypeGQLModel/Queries/index.js +6 -0
- package/src/RoleTypeGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/RoleTypeGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/RoleTypeGQLModel/Scalars/index.js +1 -0
- package/src/RoleTypeGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/RoleTypeGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/RoleTypeGQLModel/Vectors/index.js +1 -0
- package/src/RoleTypeGQLModel/index.js +6 -0
- package/src/StateGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/StateGQLModel/Components/Children.jsx +31 -0
- package/src/StateGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/StateGQLModel/Components/Filter.jsx +14 -0
- package/src/StateGQLModel/Components/LargeCard.jsx +50 -0
- package/src/StateGQLModel/Components/Link.jsx +54 -0
- package/src/StateGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/StateGQLModel/Components/MediumCard.jsx +39 -0
- package/src/StateGQLModel/Components/MediumContent.jsx +96 -0
- package/src/StateGQLModel/Components/MediumEditableContent.jsx +36 -0
- package/src/StateGQLModel/Components/Table.jsx +7 -0
- package/src/StateGQLModel/Components/index.js +13 -0
- package/src/StateGQLModel/Mutations/Create.jsx +79 -0
- package/src/StateGQLModel/Mutations/Delete.jsx +87 -0
- package/src/StateGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/StateGQLModel/Mutations/Update.jsx +76 -0
- package/src/StateGQLModel/Mutations/helpers.jsx +7 -0
- package/src/StateGQLModel/Pages/PageBase.jsx +56 -0
- package/src/StateGQLModel/Pages/PageCreateItem.jsx +28 -0
- package/src/StateGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/StateGQLModel/Pages/PageNavbar.jsx +160 -0
- package/src/StateGQLModel/Pages/PageReadItem.jsx +11 -0
- package/src/StateGQLModel/Pages/PageReadItemEx.jsx +42 -0
- package/src/StateGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/StateGQLModel/Pages/PageVector.jsx +80 -0
- package/src/StateGQLModel/Pages/RouterSegment.jsx +72 -0
- package/src/StateGQLModel/Pages/index.js +2 -0
- package/src/StateGQLModel/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/StateGQLModel/Queries/Fragments.jsx +109 -0
- package/src/StateGQLModel/Queries/InsertAsyncAction.jsx +104 -0
- package/src/StateGQLModel/Queries/ReadAsyncAction.jsx +48 -0
- package/src/StateGQLModel/Queries/ReadPageAsyncAction.jsx +23 -0
- package/src/StateGQLModel/Queries/SearchAsyncAction.jsx +16 -0
- package/src/StateGQLModel/Queries/UpdateAsyncAction.jsx +106 -0
- package/src/StateGQLModel/Queries/index.js +6 -0
- package/src/StateGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/StateGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/StateGQLModel/Scalars/index.js +1 -0
- package/src/StateGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/StateGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/StateGQLModel/Vectors/index.js +1 -0
- package/src/StateGQLModel/index.js +71 -0
- package/src/StateMachineGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/StateMachineGQLModel/Components/Children.jsx +31 -0
- package/src/StateMachineGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/StateMachineGQLModel/Components/Filter.jsx +14 -0
- package/src/StateMachineGQLModel/Components/LargeCard.jsx +50 -0
- package/src/StateMachineGQLModel/Components/Link.jsx +54 -0
- package/src/StateMachineGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/StateMachineGQLModel/Components/MediumCard.jsx +39 -0
- package/src/StateMachineGQLModel/Components/MediumContent.jsx +96 -0
- package/src/StateMachineGQLModel/Components/MediumEditableContent.jsx +989 -0
- package/src/StateMachineGQLModel/Components/Table.jsx +7 -0
- package/src/StateMachineGQLModel/Components/index.js +13 -0
- package/src/StateMachineGQLModel/Mutations/Create.jsx +79 -0
- package/src/StateMachineGQLModel/Mutations/Delete.jsx +80 -0
- package/src/StateMachineGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/StateMachineGQLModel/Mutations/Update.jsx +74 -0
- package/src/StateMachineGQLModel/Mutations/helpers.jsx +7 -0
- package/src/StateMachineGQLModel/Pages/PageBase.jsx +56 -0
- package/src/StateMachineGQLModel/Pages/PageCreateItem.jsx +28 -0
- package/src/StateMachineGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/StateMachineGQLModel/Pages/PageNavbar.jsx +160 -0
- package/src/StateMachineGQLModel/Pages/PageReadItem.jsx +11 -0
- package/src/StateMachineGQLModel/Pages/PageReadItemEx.jsx +42 -0
- package/src/StateMachineGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/StateMachineGQLModel/Pages/PageVector.jsx +80 -0
- package/src/StateMachineGQLModel/Pages/RouterSegment.jsx +72 -0
- package/src/StateMachineGQLModel/Pages/index.js +2 -0
- package/src/StateMachineGQLModel/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/StateMachineGQLModel/Queries/Fragments.jsx +148 -0
- package/src/StateMachineGQLModel/Queries/InsertAsyncAction.jsx +44 -0
- package/src/StateMachineGQLModel/Queries/ReadAsyncAction.jsx +48 -0
- package/src/StateMachineGQLModel/Queries/ReadPageAsyncAction.jsx +23 -0
- package/src/StateMachineGQLModel/Queries/SearchAsyncAction.jsx +16 -0
- package/src/StateMachineGQLModel/Queries/UpdateAsyncAction.jsx +40 -0
- package/src/StateMachineGQLModel/Queries/index.js +6 -0
- package/src/StateMachineGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/StateMachineGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/StateMachineGQLModel/Scalars/index.js +1 -0
- package/src/StateMachineGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/StateMachineGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/StateMachineGQLModel/Vectors/index.js +1 -0
- package/src/StateMachineGQLModel/WhatToDo.md +44 -0
- package/src/StateMachineGQLModel/index.js +71 -0
- package/src/StateTransitionGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/StateTransitionGQLModel/Components/Children.jsx +31 -0
- package/src/StateTransitionGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/StateTransitionGQLModel/Components/Filter.jsx +14 -0
- package/src/StateTransitionGQLModel/Components/LargeCard.jsx +50 -0
- package/src/StateTransitionGQLModel/Components/Link.jsx +54 -0
- package/src/StateTransitionGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/StateTransitionGQLModel/Components/MediumCard.jsx +39 -0
- package/src/StateTransitionGQLModel/Components/MediumContent.jsx +96 -0
- package/src/StateTransitionGQLModel/Components/MediumEditableContent.jsx +35 -0
- package/src/StateTransitionGQLModel/Components/Table.jsx +7 -0
- package/src/StateTransitionGQLModel/Components/index.js +13 -0
- package/src/StateTransitionGQLModel/Mutations/Create.jsx +79 -0
- package/src/StateTransitionGQLModel/Mutations/Delete.jsx +80 -0
- package/src/StateTransitionGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/StateTransitionGQLModel/Mutations/Update.jsx +75 -0
- package/src/StateTransitionGQLModel/Mutations/helpers.jsx +7 -0
- package/src/StateTransitionGQLModel/Pages/PageBase.jsx +56 -0
- package/src/StateTransitionGQLModel/Pages/PageCreateItem.jsx +28 -0
- package/src/StateTransitionGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/StateTransitionGQLModel/Pages/PageNavbar.jsx +160 -0
- package/src/StateTransitionGQLModel/Pages/PageReadItem.jsx +11 -0
- package/src/StateTransitionGQLModel/Pages/PageReadItemEx.jsx +42 -0
- package/src/StateTransitionGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/StateTransitionGQLModel/Pages/PageVector.jsx +80 -0
- package/src/StateTransitionGQLModel/Pages/RouterSegment.jsx +72 -0
- package/src/StateTransitionGQLModel/Pages/index.js +2 -0
- package/src/StateTransitionGQLModel/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/StateTransitionGQLModel/Queries/Fragments.jsx +150 -0
- package/src/StateTransitionGQLModel/Queries/InsertAsyncAction.jsx +107 -0
- package/src/StateTransitionGQLModel/Queries/ReadAsyncAction.jsx +48 -0
- package/src/StateTransitionGQLModel/Queries/ReadPageAsyncAction.jsx +23 -0
- package/src/StateTransitionGQLModel/Queries/SearchAsyncAction.jsx +16 -0
- package/src/StateTransitionGQLModel/Queries/UpdateAsyncAction.jsx +109 -0
- package/src/StateTransitionGQLModel/Queries/index.js +6 -0
- package/src/StateTransitionGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/StateTransitionGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/StateTransitionGQLModel/Scalars/index.js +1 -0
- package/src/StateTransitionGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/StateTransitionGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/StateTransitionGQLModel/Vectors/index.js +1 -0
- package/src/StateTransitionGQLModel/WhatToDo.md +44 -0
- package/src/StateTransitionGQLModel/index.js +71 -0
- package/src/Template/Attributes/TemplateTrivialAttribute.jsx +21 -0
- package/src/Template/Attributes/index.js +1 -0
- package/src/Template/Components/CUDButton.jsx +128 -0
- package/src/Template/Components/CardCapsule.jsx +43 -0
- package/src/Template/Components/Children.jsx +31 -0
- package/src/Template/Components/ConfirmEdit.jsx +61 -0
- package/src/Template/Components/LargeCard.jsx +48 -0
- package/src/Template/Components/Link.jsx +41 -0
- package/src/Template/Components/LiveEdit.jsx +111 -0
- package/src/Template/Components/MediumCard.jsx +39 -0
- package/src/Template/Components/MediumContent.jsx +97 -0
- package/src/Template/Components/MediumEditableContent.jsx +36 -0
- package/src/Template/Components/Table.jsx +7 -0
- package/src/Template/Components/index.js +14 -0
- package/src/Template/Pages/Page.jsx +28 -0
- package/src/Template/Pages/PageCapsule.jsx +13 -0
- package/src/Template/Pages/PageContent.jsx +34 -0
- package/src/Template/Pages/PageEdit.jsx +17 -0
- package/src/Template/Pages/PageNavbar.jsx +110 -0
- package/src/Template/Pages/RouterSegment.jsx +52 -0
- package/src/Template/Pages/VectorPage.jsx +133 -0
- package/src/Template/Pages/index.js +6 -0
- package/src/Template/Queries/DeleteAsyncAction.jsx +22 -0
- package/src/Template/Queries/Fragments.jsx +92 -0
- package/src/Template/Queries/InsertAsyncAction.jsx +22 -0
- package/src/Template/Queries/ReadAsyncAction.jsx +45 -0
- package/src/Template/Queries/ReadPageAsyncAction.jsx +13 -0
- package/src/Template/Queries/UpdateAsyncAction.jsx +76 -0
- package/src/Template/Queries/index.js +6 -0
- package/src/Template/Scalars/ScalarAttribute.jsx +54 -0
- package/src/Template/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/Template/Scalars/index.js +1 -0
- package/src/Template/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/Template/Vectors/VectorAttribute.jsx +56 -0
- package/src/Template/Vectors/index.js +1 -0
- package/src/Template/index.js +71 -0
- package/src/UserGQLModel/Components/CUDButton.jsx +128 -0
- package/src/UserGQLModel/Components/CardCapsule.jsx +43 -0
- package/src/UserGQLModel/Components/ConfirmEdit.jsx +61 -0
- package/src/UserGQLModel/Components/Filter.jsx +15 -0
- package/src/UserGQLModel/Components/LargeCard.jsx +82 -0
- package/src/UserGQLModel/Components/Link.jsx +54 -0
- package/src/UserGQLModel/Components/LiveEdit.jsx +111 -0
- package/src/UserGQLModel/Components/MediumCard.jsx +40 -0
- package/src/UserGQLModel/Components/MediumContent.jsx +43 -0
- package/src/UserGQLModel/Components/MediumEditableContent.jsx +57 -0
- package/src/UserGQLModel/Components/Table.jsx +7 -0
- package/src/UserGQLModel/Components/index.js +13 -0
- package/src/UserGQLModel/Mutations/AddMembership.jsx +136 -0
- package/src/UserGQLModel/Mutations/Create.jsx +68 -0
- package/src/UserGQLModel/Mutations/Delete.jsx +81 -0
- package/src/UserGQLModel/Mutations/InteractiveMutations.jsx +30 -0
- package/src/UserGQLModel/Mutations/Update.jsx +68 -0
- package/src/UserGQLModel/Mutations/helpers.jsx +7 -0
- package/src/UserGQLModel/Pages/PageAddMembership.jsx +15 -0
- package/src/UserGQLModel/Pages/PageBase.jsx +56 -0
- package/src/UserGQLModel/Pages/PageCreateItem.jsx +27 -0
- package/src/UserGQLModel/Pages/PageDeleteItem.jsx +16 -0
- package/src/UserGQLModel/Pages/PageNavbar.jsx +146 -0
- package/src/UserGQLModel/Pages/PageReadItem.jsx +12 -0
- package/src/UserGQLModel/Pages/PageReadItemEx.jsx +62 -0
- package/src/UserGQLModel/Pages/PageUpdateItem.jsx +14 -0
- package/src/UserGQLModel/Pages/PageVector.jsx +78 -0
- package/src/UserGQLModel/Pages/RouterSegment.jsx +77 -0
- package/src/UserGQLModel/Pages/index.js +9 -0
- package/src/UserGQLModel/Queries/DeleteAsyncAction.jsx +22 -0
- package/src/UserGQLModel/Queries/Fragments.jsx +114 -0
- package/src/UserGQLModel/Queries/InsertAsyncAction.jsx +22 -0
- package/src/UserGQLModel/Queries/ReadAsyncAction.jsx +45 -0
- package/src/UserGQLModel/Queries/ReadPageAsyncAction.jsx +17 -0
- package/src/UserGQLModel/Queries/SearchAsyncAction.jsx +15 -0
- package/src/UserGQLModel/Queries/UpdateAsyncAction.jsx +76 -0
- package/src/UserGQLModel/Queries/index.js +6 -0
- package/src/UserGQLModel/Scalars/ScalarAttribute.jsx +54 -0
- package/src/UserGQLModel/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/UserGQLModel/Scalars/index.js +1 -0
- package/src/UserGQLModel/Vectors/Roles.jsx +23 -0
- package/src/UserGQLModel/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/UserGQLModel/Vectors/UserMemberships.jsx +56 -0
- package/src/UserGQLModel/Vectors/UserRoles.jsx +81 -0
- package/src/UserGQLModel/Vectors/VectorAttribute.jsx +56 -0
- package/src/UserGQLModel/Vectors/index.js +1 -0
- package/src/UserGQLModel/index.js +6 -0
- package/src/_Template/Components/CardCapsule.jsx +43 -0
- package/src/_Template/Components/Children.jsx +31 -0
- package/src/_Template/Components/ConfirmEdit.jsx +61 -0
- package/src/_Template/Components/Filter.jsx +14 -0
- package/src/_Template/Components/LargeCard.jsx +50 -0
- package/src/_Template/Components/Link.jsx +54 -0
- package/src/_Template/Components/LiveEdit.jsx +111 -0
- package/src/_Template/Components/MediumCard.jsx +39 -0
- package/src/_Template/Components/MediumContent.jsx +96 -0
- package/src/_Template/Components/MediumEditableContent.jsx +35 -0
- package/src/_Template/Components/Table.jsx +7 -0
- package/src/_Template/Components/index.js +13 -0
- package/src/_Template/Mutations/Create.jsx +202 -0
- package/src/_Template/Mutations/Delete.jsx +173 -0
- package/src/_Template/Mutations/InteractiveMutations.jsx +30 -0
- package/src/_Template/Mutations/Update.jsx +147 -0
- package/src/_Template/Mutations/helpers.jsx +7 -0
- package/src/_Template/Pages/PageBase.jsx +56 -0
- package/src/_Template/Pages/PageCreateItem.jsx +28 -0
- package/src/_Template/Pages/PageDeleteItem.jsx +16 -0
- package/src/_Template/Pages/PageNavbar.jsx +160 -0
- package/src/_Template/Pages/PageReadItem.jsx +11 -0
- package/src/_Template/Pages/PageReadItemEx.jsx +42 -0
- package/src/_Template/Pages/PageUpdateItem.jsx +14 -0
- package/src/_Template/Pages/PageVector.jsx +80 -0
- package/src/_Template/Pages/RouterSegment.jsx +72 -0
- package/src/_Template/Pages/index.js +2 -0
- package/src/_Template/Queries/DeleteAsyncAction.jsx +32 -0
- package/src/_Template/Queries/Fragments.jsx +101 -0
- package/src/_Template/Queries/InsertAsyncAction.jsx +40 -0
- package/src/_Template/Queries/ReadAsyncAction.jsx +44 -0
- package/src/_Template/Queries/ReadPageAsyncAction.jsx +13 -0
- package/src/_Template/Queries/SearchAsyncAction.jsx +16 -0
- package/src/_Template/Queries/UpdateAsyncAction.jsx +40 -0
- package/src/_Template/Queries/index.js +6 -0
- package/src/_Template/Scalars/ScalarAttribute.jsx +54 -0
- package/src/_Template/Scalars/TemplateScalarAttribute.jsx +88 -0
- package/src/_Template/Scalars/index.js +1 -0
- package/src/_Template/Vectors/TemplateVectorsAttribute.jsx +326 -0
- package/src/_Template/Vectors/VectorAttribute.jsx +56 -0
- package/src/_Template/Vectors/index.js +1 -0
- package/src/_Template/WhatToDo.md +44 -0
- package/src/_Template/index.js +71 -0
- package/src/index.js +8 -0
- package/src/uriroot.js +158 -0
- package/vite.config.js +47 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createQueryStrLazy } from "@hrbolek/uoisfrontend-gql-shared";
|
|
2
|
+
import { LargeFragment } from "./Fragments";
|
|
3
|
+
import { createAsyncGraphQLAction2 } from "../../../../dynamic/src/Core/createAsyncGraphQLAction2";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const InsertMutationStr = `
|
|
7
|
+
mutation groupInsert(
|
|
8
|
+
$mastergroupId: UUID! # null,
|
|
9
|
+
$name: String! # null,
|
|
10
|
+
$grouptypeId: UUID! # null,
|
|
11
|
+
$id: UUID # null,
|
|
12
|
+
$nameEn: String # null,
|
|
13
|
+
$abbreviation: String # null,
|
|
14
|
+
$email: String # null,
|
|
15
|
+
$subgroups: [GroupInsertSubGroupGQLModel!] # null,
|
|
16
|
+
$memberships: [MembershipInsertGQLModel!] # null,
|
|
17
|
+
$roles: [RoleInsertGQLModel!] # null
|
|
18
|
+
) {
|
|
19
|
+
groupInsert(
|
|
20
|
+
group: {
|
|
21
|
+
mastergroupId: $mastergroupId,
|
|
22
|
+
name: $name,
|
|
23
|
+
grouptypeId: $grouptypeId,
|
|
24
|
+
id: $id,
|
|
25
|
+
nameEn: $nameEn,
|
|
26
|
+
abbreviation: $abbreviation,
|
|
27
|
+
email: $email,
|
|
28
|
+
subgroups: $subgroups,
|
|
29
|
+
memberships: $memberships,
|
|
30
|
+
roles: $roles}
|
|
31
|
+
) {
|
|
32
|
+
... on InsertError {
|
|
33
|
+
failed
|
|
34
|
+
msg
|
|
35
|
+
input
|
|
36
|
+
}
|
|
37
|
+
...Large
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`
|
|
41
|
+
|
|
42
|
+
const InsertMutation = createQueryStrLazy(`${InsertMutationStr}`, LargeFragment)
|
|
43
|
+
export const InsertAsyncAction = createAsyncGraphQLAction2(InsertMutation)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createQueryStrLazy } from "@hrbolek/uoisfrontend-gql-shared";
|
|
2
|
+
import { LargeFragment } from "./Fragments";
|
|
3
|
+
import { createAsyncGraphQLAction2 } from "../../../../dynamic/src/Core/createAsyncGraphQLAction2";
|
|
4
|
+
|
|
5
|
+
const ReadQueryStr = `
|
|
6
|
+
query ReadQuery($id: UUID!) {
|
|
7
|
+
result: groupById(id: $id) {
|
|
8
|
+
...Large
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
`
|
|
12
|
+
|
|
13
|
+
export const ReadQuery = createQueryStrLazy(`${ReadQueryStr}`, LargeFragment)
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* An async action for executing a GraphQL query to read entities.
|
|
17
|
+
*
|
|
18
|
+
* This action is created using `createAsyncGraphQLAction` with a predefined `QueryRead` query.
|
|
19
|
+
* It can be dispatched with query variables to fetch data related to entities from the GraphQL API.
|
|
20
|
+
*
|
|
21
|
+
* @constant
|
|
22
|
+
* @type {Function}
|
|
23
|
+
*
|
|
24
|
+
* @param {Object} query_variables - The variables for the GraphQL query.
|
|
25
|
+
* @param {string|number} query_variables.id - The unique identifier for the entity to fetch.
|
|
26
|
+
*
|
|
27
|
+
* @returns {Function} A dispatchable async action that performs the GraphQL query, applies middleware, and dispatches the result.
|
|
28
|
+
*
|
|
29
|
+
* @throws {Error} If `query_variables` is not a valid JSON object.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* // Example usage:
|
|
33
|
+
* const queryVariables = { id: "12345" };
|
|
34
|
+
*
|
|
35
|
+
* dispatch(ReadAsyncAction(queryVariables))
|
|
36
|
+
* .then((result) => {
|
|
37
|
+
* console.log("Fetched data:", result);
|
|
38
|
+
* })
|
|
39
|
+
* .catch((error) => {
|
|
40
|
+
* console.error("Error fetching data:", error);
|
|
41
|
+
* });
|
|
42
|
+
*/
|
|
43
|
+
// export const ReadAsyncAction = createAsyncGraphQLAction2(ReadQuery, reduceToFirstEntity("result"))
|
|
44
|
+
export const ReadAsyncAction = createAsyncGraphQLAction2(ReadQuery)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createQueryStrLazy } from "@hrbolek/uoisfrontend-gql-shared";
|
|
2
|
+
import { LargeFragment, MediumFragment } from "./Fragments";
|
|
3
|
+
import { createAsyncGraphQLAction2 } from "../../../../dynamic/src/Core/createAsyncGraphQLAction2";
|
|
4
|
+
import { Medium } from "react-bootstrap-icons";
|
|
5
|
+
|
|
6
|
+
const ReadPageQueryStr = `
|
|
7
|
+
query ReadPageQuery($skip: Int, $limit: Int, $where: GroupInputWhereFilter) {
|
|
8
|
+
result: groupPage(skip: $skip, limit: $limit, where: $where) {
|
|
9
|
+
...Medium
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
`
|
|
13
|
+
const ReadPageQuery = createQueryStrLazy(`${ReadPageQueryStr}`,
|
|
14
|
+
// LargeFragment,
|
|
15
|
+
MediumFragment
|
|
16
|
+
|
|
17
|
+
)
|
|
18
|
+
export const ReadPageAsyncAction = createAsyncGraphQLAction2(ReadPageQuery)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createQueryStrLazy } from "@hrbolek/uoisfrontend-gql-shared";
|
|
2
|
+
import { LargeFragment } from "./Fragments";
|
|
3
|
+
import { createAsyncGraphQLAction2 } from "../../../../dynamic/src/Core/createAsyncGraphQLAction2";
|
|
4
|
+
import { addItemsFromGraphQLResult, reduceToFirstEntity } from "../../../../dynamic/src/Store";
|
|
5
|
+
|
|
6
|
+
const SearchReadPageQueryStr = `
|
|
7
|
+
query ReadPageQuery($skip: Int, $limit: Int, $pattern: String) {
|
|
8
|
+
result: groupPage(skip: $skip, limit: $limit, where: { name: {_ilike: $pattern}}) {
|
|
9
|
+
...Large
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
`
|
|
13
|
+
const SearchPageQuery = createQueryStrLazy(`${SearchReadPageQueryStr}`, LargeFragment)
|
|
14
|
+
export const SearchAsyncAction = createAsyncGraphQLAction2(
|
|
15
|
+
SearchPageQuery, reduceToFirstEntity)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { createQueryStrLazy } from "@hrbolek/uoisfrontend-gql-shared";
|
|
2
|
+
import { LargeFragment } from "./Fragments";
|
|
3
|
+
import { createAsyncGraphQLAction2 } from "../../../../dynamic/src/Core/createAsyncGraphQLAction2";
|
|
4
|
+
import { reduceToFirstEntity, updateItemsFromGraphQLResult } from "../../../../dynamic/src/Store";
|
|
5
|
+
|
|
6
|
+
const UpdateMutationStr = `
|
|
7
|
+
mutation groupUpdate(
|
|
8
|
+
$id: UUID! # null,
|
|
9
|
+
$lastchange: DateTime! # null,
|
|
10
|
+
$name: String # null,
|
|
11
|
+
$nameEn: String # null,
|
|
12
|
+
$grouptypeId: UUID # null,
|
|
13
|
+
$mastergroupId: UUID # null,
|
|
14
|
+
$valid: Boolean # null,
|
|
15
|
+
$abbreviation: String # null,
|
|
16
|
+
$email: String # null
|
|
17
|
+
) {
|
|
18
|
+
groupUpdate(
|
|
19
|
+
group: {
|
|
20
|
+
id: $id,
|
|
21
|
+
lastchange: $lastchange,
|
|
22
|
+
name: $name,
|
|
23
|
+
nameEn: $nameEn,
|
|
24
|
+
grouptypeId: $grouptypeId,
|
|
25
|
+
mastergroupId: $mastergroupId,
|
|
26
|
+
valid: $valid,
|
|
27
|
+
abbreviation: $abbreviation,
|
|
28
|
+
email: $email}
|
|
29
|
+
) {
|
|
30
|
+
... on GroupGQLModel {
|
|
31
|
+
...Large
|
|
32
|
+
}
|
|
33
|
+
... on GroupGQLModelUpdateError {
|
|
34
|
+
...Error
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
fragment Error on GroupGQLModelUpdateError {
|
|
41
|
+
__typename
|
|
42
|
+
Entity {
|
|
43
|
+
...Large
|
|
44
|
+
}
|
|
45
|
+
msg
|
|
46
|
+
failed
|
|
47
|
+
code
|
|
48
|
+
location
|
|
49
|
+
input
|
|
50
|
+
}
|
|
51
|
+
`
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
const UpdateMutation = createQueryStrLazy(`${UpdateMutationStr}`, LargeFragment)
|
|
55
|
+
export const UpdateAsyncAction = createAsyncGraphQLAction2(UpdateMutation,
|
|
56
|
+
updateItemsFromGraphQLResult, reduceToFirstEntity)
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
|
|
2
|
+
export { InsertAsyncAction } from './InsertAsyncAction'
|
|
3
|
+
export { UpdateAsyncAction } from './UpdateAsyncAction'
|
|
4
|
+
export { DeleteAsyncAction } from './DeleteAsyncAction'
|
|
5
|
+
export { ReadAsyncAction } from './ReadAsyncAction'
|
|
6
|
+
export { ReadPageAsyncAction } from './ReadPageAsyncAction'
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { BaseUI } from "../../Base"
|
|
2
|
+
import { Attribute } from "../../../../_template/src/Base/Components/Attribute"
|
|
3
|
+
import { CardCapsule } from "../Components"
|
|
4
|
+
|
|
5
|
+
export const GroupRoles = ({ item, children }) => {
|
|
6
|
+
const { rolesOn } = item || []
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<CardCapsule item={item} title="Vedoucí">
|
|
10
|
+
{children}
|
|
11
|
+
<Roles roles={rolesOn} />
|
|
12
|
+
{/* <AllRoles roles={rolesOn} /> */}
|
|
13
|
+
</CardCapsule>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const AllRoles = ({ roles }) => {
|
|
18
|
+
return (
|
|
19
|
+
<>
|
|
20
|
+
{roles.map(role => (
|
|
21
|
+
<Attribute key={role.id} label={role?.roletype?.name || "Role"}>
|
|
22
|
+
<BaseUI.Link item={role?.user} />
|
|
23
|
+
</Attribute>
|
|
24
|
+
))}
|
|
25
|
+
</>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const Roles = ({ roles }) => {
|
|
30
|
+
const rectors = roles?.filter(r => r?.roletype?.name === "rektor") || []
|
|
31
|
+
const vicerectors = roles?.filter(r => r?.roletype?.name === "prorektor") || []
|
|
32
|
+
const deans = roles?.filter(r => r?.roletype?.name === "děkan") || []
|
|
33
|
+
const viceDeans = roles?.filter(r => r?.roletype?.name === "proděkan") || []
|
|
34
|
+
const headOfDepartments = roles?.filter(r => r?.roletype?.name === "vedoucí katedry") || []
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
{headOfDepartments.map(headOfDepartment => (
|
|
38
|
+
<Attribute key={headOfDepartment.id} label="Vedoucí katedry">
|
|
39
|
+
<BaseUI.Link item={headOfDepartment?.user} />
|
|
40
|
+
</Attribute>
|
|
41
|
+
))}
|
|
42
|
+
{headOfDepartments.length > 0 && <hr />}
|
|
43
|
+
{deans.map(dean => (
|
|
44
|
+
<Attribute key={dean.id} label="Děkan">
|
|
45
|
+
<BaseUI.Link item={dean?.user} />
|
|
46
|
+
</Attribute>
|
|
47
|
+
))}
|
|
48
|
+
{viceDeans.map(viceDean => (
|
|
49
|
+
<Attribute key={viceDean.id} label="Proděkan">
|
|
50
|
+
<BaseUI.Link item={viceDean?.user} />
|
|
51
|
+
</Attribute>
|
|
52
|
+
))}
|
|
53
|
+
{(deans.length > 0 || viceDeans.length > 0) && <hr />}
|
|
54
|
+
|
|
55
|
+
{rectors.map(rector => (
|
|
56
|
+
<Attribute key={rector.id} label="Rektor">
|
|
57
|
+
<BaseUI.Link item={rector?.user} />
|
|
58
|
+
</Attribute>
|
|
59
|
+
))}
|
|
60
|
+
{vicerectors.map(vicerector => (
|
|
61
|
+
<Attribute key={vicerector.id} label="Prorektor">
|
|
62
|
+
<BaseUI.Link item={vicerector?.user} />
|
|
63
|
+
</Attribute>
|
|
64
|
+
))}
|
|
65
|
+
{/* {JSON.stringify(roles.map(r => r?.roletype?.name))} */}
|
|
66
|
+
</>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseUI } from "../../Base"
|
|
2
|
+
import { Attribute } from "../../../../_template/src/Base/Components/Attribute"
|
|
3
|
+
import { Link } from "../../../../_template/src/Base/Components/Link"
|
|
4
|
+
|
|
5
|
+
export const MasterGroup = ({ item }) => {
|
|
6
|
+
const { mastergroup } = item || {}
|
|
7
|
+
// const { currentUserRoles=[] } = rbacobject || {}
|
|
8
|
+
return (
|
|
9
|
+
<BaseUI.CardCapsule item={{}} title="Moje role vůči této entitě">
|
|
10
|
+
<Attribute label={"Nadřízený"}>
|
|
11
|
+
<Link item={mastergroup} />
|
|
12
|
+
</Attribute>
|
|
13
|
+
</BaseUI.CardCapsule>
|
|
14
|
+
)
|
|
15
|
+
}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { ShieldLock } from "react-bootstrap-icons"
|
|
2
|
+
|
|
3
|
+
import { BaseUI } from "../../Base"
|
|
4
|
+
import { Attribute } from "../../../../_template/src/Base/Components/Attribute"
|
|
5
|
+
import { Link } from "../../../../_template/src/Base/Components/Link"
|
|
6
|
+
import { useMemo } from "react"
|
|
7
|
+
import { SimpleCardCapsuleRightCorner } from "../../Base/Components"
|
|
8
|
+
import { Dialog } from "../../Base/FormControls/Dialog"
|
|
9
|
+
import { useState } from "react"
|
|
10
|
+
|
|
11
|
+
import { formatDateTime } from "../../Base/Components/Attribute"
|
|
12
|
+
import { EntityLookup } from "../../Base/FormControls/EntityLookup"
|
|
13
|
+
import { Input } from "../../Base/FormControls/Input"
|
|
14
|
+
import { SearchAsyncAction as SearchUserAsyncAction } from "../../UserGQLModel/Queries/SearchAsyncAction"
|
|
15
|
+
import { useEffect } from "react"
|
|
16
|
+
import { useAsyncThunkAction } from "../../../../dynamic/src/Hooks"
|
|
17
|
+
import { ReadAsyncAction } from "../../GroupGQLModel"
|
|
18
|
+
import { AsyncStateIndicator } from "../../Base/Helpers/AsyncStateIndicator"
|
|
19
|
+
import { InsertAsyncAction } from "../../RoleGQLModel/Queries"
|
|
20
|
+
import { SearchAsyncAction as SearchRoleTypeAsyncAction } from "../../RoleTypeGQLModel/Queries/SearchAsyncAction"
|
|
21
|
+
|
|
22
|
+
export const RBACObject = ({ item }) => {
|
|
23
|
+
const { rbacobject } = item || {}
|
|
24
|
+
const { currentUserRoles=[] } = rbacobject || {}
|
|
25
|
+
const filtered = useMemo(() => currentUserRoles.filter(cr => cr?.valid), [currentUserRoles])
|
|
26
|
+
return (
|
|
27
|
+
<BaseUI.CardCapsule item={{}} title="Moje role vůči této entitě">
|
|
28
|
+
<SimpleCardCapsuleRightCorner>
|
|
29
|
+
<Edit item={item}/>
|
|
30
|
+
</SimpleCardCapsuleRightCorner>
|
|
31
|
+
{filtered.map(role => (
|
|
32
|
+
<Attribute key={role?.id}>
|
|
33
|
+
<Link item={role?.roletype} />@
|
|
34
|
+
<Link item={role?.group} />
|
|
35
|
+
</Attribute>
|
|
36
|
+
))}
|
|
37
|
+
|
|
38
|
+
{/* <hr/>
|
|
39
|
+
<pre>
|
|
40
|
+
{JSON.stringify(currentUserRoles, null, 2)}
|
|
41
|
+
</pre> */}
|
|
42
|
+
</BaseUI.CardCapsule>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const Edit = ({ item }) => {
|
|
47
|
+
const [visible, setVisible] = useState(false)
|
|
48
|
+
const handleShow = () => setVisible(true)
|
|
49
|
+
const BTN = (
|
|
50
|
+
<button
|
|
51
|
+
className="btn btn-sm btn-outline-primary border-0"
|
|
52
|
+
onClick={handleShow}
|
|
53
|
+
><ShieldLock /></button>
|
|
54
|
+
)
|
|
55
|
+
if (!visible) return BTN
|
|
56
|
+
const handleHide = () => setVisible(false)
|
|
57
|
+
return (<>
|
|
58
|
+
{BTN}
|
|
59
|
+
<Dialog
|
|
60
|
+
title="Oprávnění"
|
|
61
|
+
onCancel={handleHide}
|
|
62
|
+
onOk={handleHide}
|
|
63
|
+
>
|
|
64
|
+
{/* {JSON.stringify(item)} */}
|
|
65
|
+
<RBACEdit item={item?.rbacobject}/>
|
|
66
|
+
</Dialog>
|
|
67
|
+
</>)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const RBACEdit = ({ item, onChange }) => {
|
|
71
|
+
const { id="" } = item || {}
|
|
72
|
+
const { entity, loading, error, run } = useAsyncThunkAction(ReadAsyncAction, {id}, {deferred: true})
|
|
73
|
+
const { data, loading: saving, error: updateError, run: save } = useAsyncThunkAction(InsertAsyncAction, {id}, {deferred: true})
|
|
74
|
+
|
|
75
|
+
const [roles, setRoles] = useState((entity || {})?.roles||[])
|
|
76
|
+
|
|
77
|
+
// useEffect(()=>{
|
|
78
|
+
// const newRoles = (entity || {})?.roles||[]
|
|
79
|
+
// if (newRoles === roles)
|
|
80
|
+
// return
|
|
81
|
+
// setRoles(newRoles)
|
|
82
|
+
// }, [entity, roles])
|
|
83
|
+
|
|
84
|
+
useEffect(()=>{
|
|
85
|
+
if (!id) return
|
|
86
|
+
console.log("RBACEdit", item?.id, item)
|
|
87
|
+
|
|
88
|
+
const runner = async () => {
|
|
89
|
+
const result = await run({id})
|
|
90
|
+
console.log("RBACEdit", item?.id, result)
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
runner()
|
|
94
|
+
}, [id])
|
|
95
|
+
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
console.log("RBACEdit.useEffect2", item?.id, entity)
|
|
98
|
+
const newRoles = (entity || {})?.roles||[]
|
|
99
|
+
setRoles(newRoles)
|
|
100
|
+
},[entity])
|
|
101
|
+
|
|
102
|
+
const [role, setRole] = useState({
|
|
103
|
+
id: crypto.randomUUID(),
|
|
104
|
+
groupId: entity?.id ?? id,
|
|
105
|
+
// startdate: formatDateTime(new Date()),
|
|
106
|
+
// enddate: formatDateTime(new Date() + 14)
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
const handleChangeOrBlur = (e) => {
|
|
110
|
+
const id = e?.target?.id
|
|
111
|
+
const value = e?.target?.value
|
|
112
|
+
if (!id) return;
|
|
113
|
+
|
|
114
|
+
setRole(prev => ({
|
|
115
|
+
...prev, [id]: value
|
|
116
|
+
}))
|
|
117
|
+
|
|
118
|
+
}
|
|
119
|
+
const handleConfirm = async() => {
|
|
120
|
+
console.log("RBACEdit.handleConfirm", item?.id, role)
|
|
121
|
+
await save(role)
|
|
122
|
+
await run({id})
|
|
123
|
+
setRole(
|
|
124
|
+
prev => ({
|
|
125
|
+
...prev,
|
|
126
|
+
id: crypto.randomUUID(),
|
|
127
|
+
userId: null,
|
|
128
|
+
user: null,
|
|
129
|
+
})
|
|
130
|
+
)
|
|
131
|
+
// setRoles(prev => ([...prev, role]))
|
|
132
|
+
}
|
|
133
|
+
return (<>
|
|
134
|
+
<AsyncStateIndicator
|
|
135
|
+
error={error}
|
|
136
|
+
loading={loading}
|
|
137
|
+
text={"Nahrávám"}
|
|
138
|
+
/>
|
|
139
|
+
<AsyncStateIndicator
|
|
140
|
+
error={updateError}
|
|
141
|
+
loading={saving}
|
|
142
|
+
text={"Ukládám"}
|
|
143
|
+
/>
|
|
144
|
+
<table className="table table-stripped">
|
|
145
|
+
<thead>
|
|
146
|
+
<tr>
|
|
147
|
+
<th>Typ role</th>
|
|
148
|
+
<th>Osoba</th>
|
|
149
|
+
<th>Počátek</th>
|
|
150
|
+
<th>Konec</th>
|
|
151
|
+
<th>Platná</th>
|
|
152
|
+
<th></th>
|
|
153
|
+
</tr>
|
|
154
|
+
</thead>
|
|
155
|
+
<tbody>
|
|
156
|
+
{roles.map(role => <tr key={role?.id}>
|
|
157
|
+
<td>
|
|
158
|
+
<Link item={role?.roletype || {}}/>
|
|
159
|
+
</td>
|
|
160
|
+
<td>
|
|
161
|
+
<Link item={role?.user || {}}/>
|
|
162
|
+
</td>
|
|
163
|
+
<td>
|
|
164
|
+
{role?.startdate?formatDateTime(role?.startdate):"-"}
|
|
165
|
+
</td>
|
|
166
|
+
<td>
|
|
167
|
+
{role?.enddate?formatDateTime(role?.enddate):"-"}
|
|
168
|
+
</td>
|
|
169
|
+
<td>
|
|
170
|
+
{role?.valid?"Ano":"Ne"}
|
|
171
|
+
</td>
|
|
172
|
+
<td>
|
|
173
|
+
|
|
174
|
+
</td>
|
|
175
|
+
</tr>
|
|
176
|
+
)}
|
|
177
|
+
</tbody>
|
|
178
|
+
<tfoot>
|
|
179
|
+
<tr>
|
|
180
|
+
<td>
|
|
181
|
+
<EntityLookup
|
|
182
|
+
id="roletypeId"
|
|
183
|
+
className="form-control"
|
|
184
|
+
asyncAction={SearchRoleTypeAsyncAction}
|
|
185
|
+
onChange={handleChangeOrBlur}
|
|
186
|
+
onBlur={handleChangeOrBlur}
|
|
187
|
+
value={role?.roletype}
|
|
188
|
+
/>
|
|
189
|
+
</td>
|
|
190
|
+
<td>
|
|
191
|
+
<EntityLookup
|
|
192
|
+
id="userId"
|
|
193
|
+
className="form-control"
|
|
194
|
+
asyncAction={SearchUserAsyncAction}
|
|
195
|
+
onChange={handleChangeOrBlur}
|
|
196
|
+
onBlur={handleChangeOrBlur}
|
|
197
|
+
value={role?.user}
|
|
198
|
+
/>
|
|
199
|
+
</td>
|
|
200
|
+
<td>
|
|
201
|
+
<Input
|
|
202
|
+
id="startdate"
|
|
203
|
+
type="datetime-local"
|
|
204
|
+
className="form-control"
|
|
205
|
+
onChange={handleChangeOrBlur}
|
|
206
|
+
onBlur={handleChangeOrBlur}
|
|
207
|
+
value={role?.startdate}
|
|
208
|
+
/>
|
|
209
|
+
</td>
|
|
210
|
+
<td>
|
|
211
|
+
<Input
|
|
212
|
+
id="enddate"
|
|
213
|
+
type="datetime-local"
|
|
214
|
+
className="form-control"
|
|
215
|
+
onChange={handleChangeOrBlur}
|
|
216
|
+
onBlur={handleChangeOrBlur}
|
|
217
|
+
value={role?.enddate}
|
|
218
|
+
/>
|
|
219
|
+
</td>
|
|
220
|
+
<td colSpan={2}>
|
|
221
|
+
<button
|
|
222
|
+
className="btn btn-outline-primary form-control"
|
|
223
|
+
onClick={handleConfirm}
|
|
224
|
+
disabled={
|
|
225
|
+
!(role?.userId && role?.startdate && role?.roletypeId)
|
|
226
|
+
}
|
|
227
|
+
>Ok</button>
|
|
228
|
+
</td>
|
|
229
|
+
</tr>
|
|
230
|
+
</tfoot>
|
|
231
|
+
</table>
|
|
232
|
+
</>)
|
|
233
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useSelector } from "react-redux";
|
|
2
|
+
|
|
3
|
+
// import { selectItemById } from "../Store/ItemSlice"; // uprav cestu
|
|
4
|
+
|
|
5
|
+
import { CardCapsule } from "../Components/CardCapsule"
|
|
6
|
+
import { MediumCard } from "../Components/MediumCard"
|
|
7
|
+
import { Col } from "../../../../_template/src/Base/Components/Col"
|
|
8
|
+
import { Row } from "../../../../_template/src/Base/Components/Row"
|
|
9
|
+
import { selectItemById } from "../../../../dynamic/src/Store";
|
|
10
|
+
import { useMemo } from "react";
|
|
11
|
+
|
|
12
|
+
export const ScalarAttributeCapsule = ({ attribute_name, item, children }) => {
|
|
13
|
+
return (
|
|
14
|
+
<Row>
|
|
15
|
+
<Col className="col-2"><b>{attribute_name}</b></Col>
|
|
16
|
+
<Col className="col-10">
|
|
17
|
+
{children}
|
|
18
|
+
</Col>
|
|
19
|
+
</Row>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ScalarAttributeBase = ({ attribute_name, item }) => {
|
|
24
|
+
return (
|
|
25
|
+
<ScalarAttributeCapsule attribute_name={attribute_name} item={item}>
|
|
26
|
+
<MediumCard item={item} />
|
|
27
|
+
</ScalarAttributeCapsule>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const ScalarAttributeBind = ({ attribute_name, item }) => {
|
|
32
|
+
const id = item?.[attribute_name]?.id
|
|
33
|
+
const storedItem = useSelector((rootState) => {
|
|
34
|
+
const result = id != null ? selectItemById(rootState, id) : null
|
|
35
|
+
return result
|
|
36
|
+
})
|
|
37
|
+
return (
|
|
38
|
+
<ScalarAttributeBase attribute_name={attribute_name} item={storedItem} />
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const MediumCardScalars = ({ item }) => {
|
|
43
|
+
const sureitem = item || {}
|
|
44
|
+
const noArrays = useMemo(() => Object.fromEntries(
|
|
45
|
+
Object.entries(sureitem).filter(([_, v]) => v && typeof v === "object" && !Array.isArray(v) && v.id != null)
|
|
46
|
+
), [item]);
|
|
47
|
+
return (
|
|
48
|
+
<CardCapsule item={sureitem}>
|
|
49
|
+
{Object.keys(noArrays).map(
|
|
50
|
+
(attribute_name) => <ScalarAttributeBind key={attribute_name} item={item} attribute_name={attribute_name} />
|
|
51
|
+
)}
|
|
52
|
+
</CardCapsule>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { createAsyncGraphQLAction, useAsyncAction } from "@hrbolek/uoisfrontend-gql-shared"
|
|
2
|
+
import { ErrorHandler, LoadingSpinner } from "@hrbolek/uoisfrontend-shared"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A component for displaying the `scalar` attribute of an template entity.
|
|
6
|
+
*
|
|
7
|
+
* This component checks if the `scalar` attribute exists on the `template` object. If `scalar` is undefined,
|
|
8
|
+
* the component returns `null` and renders nothing. Otherwise, it displays a placeholder message
|
|
9
|
+
* and a JSON representation of the `scalar` attribute.
|
|
10
|
+
*
|
|
11
|
+
* @component
|
|
12
|
+
* @param {Object} props - The props for the TemplateScalarAttribute component.
|
|
13
|
+
* @param {Object} props.template - The object representing the template entity.
|
|
14
|
+
* @param {*} [props.template.scalar] - The scalar attribute of the template entity to be displayed, if defined.
|
|
15
|
+
*
|
|
16
|
+
* @returns {JSX.Element|null} A JSX element displaying the `scalar` attribute or `null` if the attribute is undefined.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* // Example usage:
|
|
20
|
+
* const templateEntity = { scalar: { id: 1, name: "Sample Scalar" } };
|
|
21
|
+
*
|
|
22
|
+
* <TemplateScalarAttribute template={templateEntity} />
|
|
23
|
+
*/
|
|
24
|
+
export const TemplateScalarAttribute = ({template}) => {
|
|
25
|
+
const {scalar} = template
|
|
26
|
+
if (typeof scalar === 'undefined') return null
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
{/* <ScalarMediumCard scalar={scalar} /> */}
|
|
30
|
+
{/* <ScalarLink scalar={scalar} /> */}
|
|
31
|
+
Probably {'<ScalarMediumCard scalar={scalar} />'} <br />
|
|
32
|
+
<pre>{JSON.stringify(scalar, null, 4)}</pre>
|
|
33
|
+
</>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const TemplateScalarAttributeQuery = `
|
|
38
|
+
query TemplateQueryRead($id: UUID!) {
|
|
39
|
+
result: templateById(id: $id) {
|
|
40
|
+
__typename
|
|
41
|
+
id
|
|
42
|
+
scalar {
|
|
43
|
+
__typename
|
|
44
|
+
id
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
`
|
|
49
|
+
|
|
50
|
+
const TemplateScalarAttributeAsyncAction = createAsyncGraphQLAction(
|
|
51
|
+
TemplateScalarAttributeQuery
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* A lazy-loading component for displaying filtered `scalar` from a `template` entity.
|
|
56
|
+
*
|
|
57
|
+
* This component uses the `TemplateScalarAttributeAsyncAction` to asynchronously fetch
|
|
58
|
+
* the `template.scalar` data. It shows a loading spinner while fetching, handles errors,
|
|
59
|
+
* and filters the resulting list using a custom `filter` function (defaults to `Boolean` to remove falsy values).
|
|
60
|
+
*
|
|
61
|
+
* Each vector item is rendered as a `<div>` with its `id` as both the `key` and the `id` attribute,
|
|
62
|
+
* and displays a formatted JSON preview using `<pre>`.
|
|
63
|
+
*
|
|
64
|
+
* @component
|
|
65
|
+
* @param {Object} props - The properties object.
|
|
66
|
+
* @param {Object} props.template - The template entity or identifying query variables used to fetch it.
|
|
67
|
+
* @param {Function} [props.filter=Boolean] - A filtering function applied to the `scalar` array before rendering.
|
|
68
|
+
*
|
|
69
|
+
* @returns {JSX.Element} A rendered list of filtered scalar or a loading/error placeholder.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* <TemplateScalarAttributeLazy template={{ id: "abc123" }} />
|
|
73
|
+
*
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* <TemplateScalarAttributeLazy
|
|
77
|
+
* template={{ id: "abc123" }}
|
|
78
|
+
* filter={(v) => v.status === "active"}
|
|
79
|
+
* />
|
|
80
|
+
*/
|
|
81
|
+
export const TemplateScalarAttributeLazy = ({template}) => {
|
|
82
|
+
const {loading, error, entity, fetch} = useAsyncAction(TemplateScalarAttributeAsyncAction, template)
|
|
83
|
+
|
|
84
|
+
if (loading) return <LoadingSpinner />
|
|
85
|
+
if (error) return <ErrorHandler errors={error} />
|
|
86
|
+
|
|
87
|
+
return <TemplateScalarAttribute template={entity} />
|
|
88
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TemplateScalarAttribute'
|