@ynput/ayon-frontend-shared 0.3.0 → 0.3.2
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/_virtual/index.cjs4.js +1 -1
- package/dist/_virtual/index.cjs5.js +1 -1
- package/dist/_virtual/index.es4.js +2 -5
- package/dist/_virtual/index.es4.js.map +1 -1
- package/dist/_virtual/index.es5.js +5 -2
- package/dist/_virtual/index.es5.js.map +1 -1
- package/dist/node_modules/remove-accents/index.cjs.js +1 -1
- package/dist/node_modules/remove-accents/index.es.js +1 -1
- package/dist/node_modules/web-namespaces/index.cjs.js +1 -1
- package/dist/node_modules/web-namespaces/index.cjs.js.map +1 -1
- package/dist/node_modules/web-namespaces/index.es.js +3 -8
- package/dist/node_modules/web-namespaces/index.es.js.map +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.cjs.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/CSSTransition.es.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/Transition.cjs.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/Transition.es.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.cjs.js +1 -1
- package/dist/shared/node_modules/react-transition-group/esm/utils/PropTypes.es.js +1 -1
- package/dist/shared/src/api/generated/graphql.cjs.js +12 -8
- package/dist/shared/src/api/generated/graphql.cjs.js.map +1 -1
- package/dist/shared/src/api/generated/graphql.es.js +11 -7
- package/dist/shared/src/api/generated/graphql.es.js.map +1 -1
- package/dist/shared/src/api/generated/graphqlLinks.cjs.js.map +1 -1
- package/dist/shared/src/api/generated/graphqlLinks.es.js.map +1 -1
- package/dist/shared/src/api/queries/overview/getOverview.cjs.js +1 -1
- package/dist/shared/src/api/queries/overview/getOverview.cjs.js.map +1 -1
- package/dist/shared/src/api/queries/overview/getOverview.es.js +95 -95
- package/dist/shared/src/api/queries/overview/getOverview.es.js.map +1 -1
- package/dist/shared/src/components/ProjectTableSettings/ColumnsSettings.cjs.js +2 -2
- package/dist/shared/src/components/ProjectTableSettings/ColumnsSettings.cjs.js.map +1 -1
- package/dist/shared/src/components/ProjectTableSettings/ColumnsSettings.es.js +66 -61
- package/dist/shared/src/components/ProjectTableSettings/ColumnsSettings.es.js.map +1 -1
- package/dist/shared/src/components/RemotePage/RemotePageWrapper.cjs.js +1 -1
- package/dist/shared/src/components/RemotePage/RemotePageWrapper.cjs.js.map +1 -1
- package/dist/shared/src/components/RemotePage/RemotePageWrapper.es.js +14 -11
- package/dist/shared/src/components/RemotePage/RemotePageWrapper.es.js.map +1 -1
- package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.cjs.js +1 -1
- package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.cjs.js.map +1 -1
- package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.es.js +42 -41
- package/dist/shared/src/components/SearchFilter/useBuildFilterOptions.es.js.map +1 -1
- package/dist/shared/src/containers/DetailsPanel/DetailsPanel.cjs.js +1 -1
- package/dist/shared/src/containers/DetailsPanel/DetailsPanel.cjs.js.map +1 -1
- package/dist/shared/src/containers/DetailsPanel/DetailsPanel.es.js +23 -23
- package/dist/shared/src/containers/DetailsPanel/DetailsPanel.es.js.map +1 -1
- package/dist/shared/src/containers/Feed/hooks/useTransformActivities.cjs.js +1 -1
- package/dist/shared/src/containers/Feed/hooks/useTransformActivities.cjs.js.map +1 -1
- package/dist/shared/src/containers/Feed/hooks/useTransformActivities.es.js +6 -6
- package/dist/shared/src/containers/Feed/hooks/useTransformActivities.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.cjs.js +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.es.js +65 -64
- package/dist/shared/src/containers/ProjectTreeTable/ProjectTreeTable.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.cjs.js +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.es.js +16 -16
- package/dist/shared/src/containers/ProjectTreeTable/buildTreeTableColumns.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.cjs.js +3 -3
- package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.es.js +142 -146
- package/dist/shared/src/containers/ProjectTreeTable/context/ClipboardContext.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.cjs.js +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js +24 -24
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useBuildGroupByTableData.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.cjs.js +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.es.js +141 -132
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useFetchOverviewData.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.cjs.js +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.es.js +35 -28
- package/dist/shared/src/containers/ProjectTreeTable/hooks/useQueryFilters.es.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/widgets/TextWidget.cjs.js +2 -2
- package/dist/shared/src/containers/ProjectTreeTable/widgets/TextWidget.cjs.js.map +1 -1
- package/dist/shared/src/containers/ProjectTreeTable/widgets/TextWidget.es.js +10 -10
- package/dist/shared/src/containers/Views/hooks/pages/useOverviewViewSettings.cjs.js.map +1 -1
- package/dist/shared/src/containers/Views/hooks/pages/useOverviewViewSettings.es.js.map +1 -1
- package/dist/shared/src/context/AddonContext.cjs.js.map +1 -1
- package/dist/shared/src/context/AddonContext.es.js.map +1 -1
- package/dist/shared/src/context/ProjectFoldersContext.cjs.js +1 -1
- package/dist/shared/src/context/ProjectFoldersContext.cjs.js.map +1 -1
- package/dist/shared/src/context/ProjectFoldersContext.es.js +62 -49
- package/dist/shared/src/context/ProjectFoldersContext.es.js.map +1 -1
- package/dist/shared/src/hooks/useLoadModules.cjs.js +1 -1
- package/dist/shared/src/hooks/useLoadModules.cjs.js.map +1 -1
- package/dist/shared/src/hooks/useLoadModules.es.js +86 -80
- package/dist/shared/src/hooks/useLoadModules.es.js.map +1 -1
- package/dist/types/api/generated/graphql.d.ts +2 -1
- package/dist/types/api/generated/graphqlLinks.d.ts +1 -0
- package/dist/types/api/queries/overview/getOverview.d.ts +1 -0
- package/dist/types/components/RemotePage/RemotePageWrapper.d.ts +1 -0
- package/dist/types/components/SearchFilter/useBuildFilterOptions.d.ts +1 -0
- package/dist/types/containers/ProjectTreeTable/hooks/useFetchOverviewData.d.ts +2 -1
- package/dist/types/containers/ProjectTreeTable/hooks/useQueryFilters.d.ts +4 -1
- package/dist/types/context/AddonContext.d.ts +1 -0
- package/dist/types/context/ProjectFoldersContext.d.ts +1 -0
- package/package.json +2 -1
- package/dist/node_modules/@ungap/structured-clone/esm/deserialize.cjs.js +0 -2
- package/dist/node_modules/@ungap/structured-clone/esm/deserialize.cjs.js.map +0 -1
- package/dist/node_modules/@ungap/structured-clone/esm/deserialize.es.js +0 -63
- package/dist/node_modules/@ungap/structured-clone/esm/deserialize.es.js.map +0 -1
- package/dist/node_modules/@ungap/structured-clone/esm/index.cjs.js +0 -2
- package/dist/node_modules/@ungap/structured-clone/esm/index.cjs.js.map +0 -1
- package/dist/node_modules/@ungap/structured-clone/esm/index.es.js +0 -12
- package/dist/node_modules/@ungap/structured-clone/esm/index.es.js.map +0 -1
- package/dist/node_modules/@ungap/structured-clone/esm/serialize.cjs.js +0 -2
- package/dist/node_modules/@ungap/structured-clone/esm/serialize.cjs.js.map +0 -1
- package/dist/node_modules/@ungap/structured-clone/esm/serialize.es.js +0 -107
- package/dist/node_modules/@ungap/structured-clone/esm/serialize.es.js.map +0 -1
- package/dist/node_modules/@ungap/structured-clone/esm/types.cjs.js +0 -2
- package/dist/node_modules/@ungap/structured-clone/esm/types.cjs.js.map +0 -1
- package/dist/node_modules/@ungap/structured-clone/esm/types.es.js +0 -14
- package/dist/node_modules/@ungap/structured-clone/esm/types.es.js.map +0 -1
- package/dist/node_modules/devlop/lib/default.cjs.js +0 -2
- package/dist/node_modules/devlop/lib/default.cjs.js.map +0 -1
- package/dist/node_modules/devlop/lib/default.es.js +0 -6
- package/dist/node_modules/devlop/lib/default.es.js.map +0 -1
- package/dist/node_modules/entities/dist/esm/decode-codepoint.cjs.js +0 -2
- package/dist/node_modules/entities/dist/esm/decode-codepoint.cjs.js.map +0 -1
- package/dist/node_modules/entities/dist/esm/decode-codepoint.es.js +0 -39
- package/dist/node_modules/entities/dist/esm/decode-codepoint.es.js.map +0 -1
- package/dist/node_modules/entities/dist/esm/decode.cjs.js +0 -2
- package/dist/node_modules/entities/dist/esm/decode.cjs.js.map +0 -1
- package/dist/node_modules/entities/dist/esm/decode.es.js +0 -246
- package/dist/node_modules/entities/dist/esm/decode.es.js.map +0 -1
- package/dist/node_modules/entities/dist/esm/generated/decode-data-html.cjs.js +0 -2
- package/dist/node_modules/entities/dist/esm/generated/decode-data-html.cjs.js.map +0 -1
- package/dist/node_modules/entities/dist/esm/generated/decode-data-html.es.js +0 -8
- package/dist/node_modules/entities/dist/esm/generated/decode-data-html.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/lib/index.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/lib/index.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/lib/index.es.js +0 -218
- package/dist/node_modules/hast-util-raw/lib/index.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/hast-util-from-parse5/lib/index.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/hast-util-from-parse5/lib/index.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/hast-util-from-parse5/lib/index.es.js +0 -146
- package/dist/node_modules/hast-util-raw/node_modules/hast-util-from-parse5/lib/index.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/hast-util-parse-selector/lib/index.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/hast-util-parse-selector/lib/index.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/hast-util-parse-selector/lib/index.es.js +0 -21
- package/dist/node_modules/hast-util-raw/node_modules/hast-util-parse-selector/lib/index.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/create-h.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/create-h.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/create-h.es.js +0 -113
- package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/create-h.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/index.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/index.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/index.es.js +0 -9
- package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/index.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/svg-case-sensitive-tag-names.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/svg-case-sensitive-tag-names.es.js +0 -45
- package/dist/node_modules/hast-util-raw/node_modules/hastscript/lib/svg-case-sensitive-tag-names.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/html-void-elements/index.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/html-void-elements/index.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/html-void-elements/index.es.js +0 -26
- package/dist/node_modules/hast-util-raw/node_modules/html-void-elements/index.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.es.js +0 -99
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/doctype.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.es.js +0 -8
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/error-codes.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.es.js +0 -211
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/foreign-content.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.es.js +0 -251
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/html.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.es.js +0 -15
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/token.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.es.js +0 -74
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/common/unicode.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.es.js +0 -85
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/formatting-element-list.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.es.js +0 -2272
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/index.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.es.js +0 -241
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/parser/open-element-stack.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.es.js +0 -3
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/serializer/index.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.es.js +0 -1941
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/index.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.es.js +0 -89
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tokenizer/preprocessor.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.es.js +0 -163
- package/dist/node_modules/hast-util-raw/node_modules/parse5/dist/tree-adapters/default.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/index.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/index.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/index.es.js +0 -13
- package/dist/node_modules/hast-util-raw/node_modules/property-information/index.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/aria.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/aria.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/aria.es.js +0 -62
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/aria.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/find.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/find.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/find.es.js +0 -34
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/find.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/html.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/html.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/html.es.js +0 -369
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/html.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/normalize.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/normalize.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/normalize.es.js +0 -7
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/normalize.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/svg.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/svg.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/svg.es.js +0 -567
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/svg.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-insensitive-transform.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-insensitive-transform.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-insensitive-transform.es.js +0 -8
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-insensitive-transform.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-sensitive-transform.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-sensitive-transform.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-sensitive-transform.es.js +0 -7
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/case-sensitive-transform.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/create.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/create.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/create.es.js +0 -20
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/create.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/defined-info.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/defined-info.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/defined-info.es.js +0 -37
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/defined-info.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/info.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/info.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/info.es.js +0 -29
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/info.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/merge.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/merge.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/merge.es.js +0 -11
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/merge.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/schema.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/schema.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/schema.es.js +0 -22
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/schema.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/types.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/types.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/types.es.js +0 -15
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/util/types.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xlink.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xlink.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xlink.es.js +0 -20
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xlink.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xml.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xml.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xml.es.js +0 -12
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xml.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xmlns.cjs.js +0 -2
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xmlns.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xmlns.es.js +0 -12
- package/dist/node_modules/hast-util-raw/node_modules/property-information/lib/xmlns.es.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/vfile-location/lib/index.cjs.js +0 -3
- package/dist/node_modules/hast-util-raw/node_modules/vfile-location/lib/index.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-raw/node_modules/vfile-location/lib/index.es.js +0 -43
- package/dist/node_modules/hast-util-raw/node_modules/vfile-location/lib/index.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/lib/index.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/lib/index.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/lib/index.es.js +0 -119
- package/dist/node_modules/hast-util-to-parse5/lib/index.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/index.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/index.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/index.es.js +0 -13
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/index.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/aria.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/aria.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/aria.es.js +0 -62
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/aria.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/find.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/find.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/find.es.js +0 -34
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/find.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/html.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/html.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/html.es.js +0 -369
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/html.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/normalize.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/normalize.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/normalize.es.js +0 -7
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/normalize.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/svg.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/svg.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/svg.es.js +0 -567
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/svg.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-insensitive-transform.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-insensitive-transform.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-insensitive-transform.es.js +0 -8
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-insensitive-transform.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-sensitive-transform.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-sensitive-transform.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-sensitive-transform.es.js +0 -7
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/case-sensitive-transform.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/create.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/create.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/create.es.js +0 -20
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/create.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/defined-info.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/defined-info.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/defined-info.es.js +0 -37
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/defined-info.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/info.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/info.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/info.es.js +0 -29
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/info.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/merge.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/merge.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/merge.es.js +0 -11
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/merge.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/schema.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/schema.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/schema.es.js +0 -22
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/schema.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/types.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/types.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/types.es.js +0 -15
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/util/types.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xlink.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xlink.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xlink.es.js +0 -20
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xlink.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xml.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xml.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xml.es.js +0 -12
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xml.es.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xmlns.cjs.js +0 -2
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xmlns.cjs.js.map +0 -1
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xmlns.es.js +0 -12
- package/dist/node_modules/hast-util-to-parse5/node_modules/property-information/lib/xmlns.es.js.map +0 -1
- package/dist/node_modules/rehype-raw/lib/index.cjs.js +0 -2
- package/dist/node_modules/rehype-raw/lib/index.cjs.js.map +0 -1
- package/dist/node_modules/rehype-raw/lib/index.es.js +0 -13
- package/dist/node_modules/rehype-raw/lib/index.es.js.map +0 -1
- package/dist/node_modules/unist-util-is/lib/index.cjs.js +0 -2
- package/dist/node_modules/unist-util-is/lib/index.cjs.js.map +0 -1
- package/dist/node_modules/unist-util-is/lib/index.es.js +0 -92
- package/dist/node_modules/unist-util-is/lib/index.es.js.map +0 -1
- package/dist/node_modules/unist-util-position/lib/index.cjs.js +0 -2
- package/dist/node_modules/unist-util-position/lib/index.cjs.js.map +0 -1
- package/dist/node_modules/unist-util-position/lib/index.es.js +0 -18
- package/dist/node_modules/unist-util-position/lib/index.es.js.map +0 -1
- package/dist/node_modules/unist-util-visit/lib/index.cjs.js +0 -2
- package/dist/node_modules/unist-util-visit/lib/index.cjs.js.map +0 -1
- package/dist/node_modules/unist-util-visit/lib/index.es.js +0 -17
- package/dist/node_modules/unist-util-visit/lib/index.es.js.map +0 -1
- package/dist/node_modules/unist-util-visit-parents/lib/color.cjs.js +0 -2
- package/dist/node_modules/unist-util-visit-parents/lib/color.cjs.js.map +0 -1
- package/dist/node_modules/unist-util-visit-parents/lib/color.es.js +0 -7
- package/dist/node_modules/unist-util-visit-parents/lib/color.es.js.map +0 -1
- package/dist/node_modules/unist-util-visit-parents/lib/index.cjs.js +0 -2
- package/dist/node_modules/unist-util-visit-parents/lib/index.cjs.js.map +0 -1
- package/dist/node_modules/unist-util-visit-parents/lib/index.es.js +0 -57
- package/dist/node_modules/unist-util-visit-parents/lib/index.es.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("../../base/client.cjs.js");const G=require("../../generated/graphql.cjs.js");require("../../generated/graphqlLinks.cjs.js");require("../../generated/access.cjs.js");require("../../generated/actions.cjs.js");require("../../generated/activityFeed.cjs.js");require("../../generated/addons.cjs.js");require("../../generated/anatomy.cjs.js");require("../../generated/attributes.cjs.js");require("../../generated/authentication.cjs.js");require("../../generated/bundles.cjs.js");require("../../generated/configuration.cjs.js");require("../../generated/desktop.cjs.js");require("../../generated/entityLists.cjs.js");require("../../generated/events.cjs.js");require("../../generated/files.cjs.js");const F=require("../../generated/folders.cjs.js");require("../../generated/inbox.cjs.js");require("../../generated/links.cjs.js");require("../../generated/market.cjs.js");require("../../generated/onboarding.cjs.js");require("../../generated/operations.cjs.js");require("../../generated/products.cjs.js");require("../../generated/projectDashboard.cjs.js");require("../../generated/projects.cjs.js");require("../../generated/reviewables.cjs.js");require("../../generated/services.cjs.js");require("../../generated/system.cjs.js");require("../../generated/tasks.cjs.js");require("../../generated/teams.cjs.js");require("../../generated/thumbnails.cjs.js");require("../../generated/uRIs.cjs.js");require("../../generated/users.cjs.js");require("../../generated/versions.cjs.js");require("../../generated/workfiles.cjs.js");require("../../generated/ynputCloud.cjs.js");require("../../generated/grouping.cjs.js");require("../../generated/views.cjs.js");require("lodash");require("react-toastify");require("uuid");const A=require("../../../util/pubsub.cjs.js"),_=u=>{try{return JSON.parse(u)}catch{return{}}},w=u=>{if(!u.project)return[];const s=[];for(const{node:e}of u.project.tasks.edges)s.push({...e,folderId:e.folderId||"root",attrib:_(e.allAttrib),entityId:e.id,entityType:"task",links:[]});return s},b=(u=[],s,e)=>{const t=u?.map(o=>({type:"overviewTask",id:o.id}))||[],a=e?(Array.isArray(e)?e:[e]).map(o=>({type:"overviewTask",id:o})):[];return[...t,...a,{type:"overviewTask",id:s},{type:"overviewTask",id:"LIST"}]},P=G.api.enhanceEndpoints({endpoints:{GetTasksByParent:{transformResponse:w,providesTags:(u,s,{parentIds:e,projectName:t})=>b(u,t,e)},GetTasksList:{transformResponse:u=>({tasks:w(u),pageInfo:u.project.tasks.pageInfo}),providesTags:(u,s,{projectName:e})=>b(u?.tasks||[],e)}}}),L=F.api.enhanceEndpoints({endpoints:{searchFolders:{}}}),E=100,N=P.injectEndpoints({endpoints:u=>({getOverviewTasksByFolders:u.query({async queryFn({projectName:s,parentIds:e,filter:t,folderFilter:a,search:o},{dispatch:
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("../../base/client.cjs.js");const G=require("../../generated/graphql.cjs.js");require("../../generated/graphqlLinks.cjs.js");require("../../generated/access.cjs.js");require("../../generated/actions.cjs.js");require("../../generated/activityFeed.cjs.js");require("../../generated/addons.cjs.js");require("../../generated/anatomy.cjs.js");require("../../generated/attributes.cjs.js");require("../../generated/authentication.cjs.js");require("../../generated/bundles.cjs.js");require("../../generated/configuration.cjs.js");require("../../generated/desktop.cjs.js");require("../../generated/entityLists.cjs.js");require("../../generated/events.cjs.js");require("../../generated/files.cjs.js");const F=require("../../generated/folders.cjs.js");require("../../generated/inbox.cjs.js");require("../../generated/links.cjs.js");require("../../generated/market.cjs.js");require("../../generated/onboarding.cjs.js");require("../../generated/operations.cjs.js");require("../../generated/products.cjs.js");require("../../generated/projectDashboard.cjs.js");require("../../generated/projects.cjs.js");require("../../generated/reviewables.cjs.js");require("../../generated/services.cjs.js");require("../../generated/system.cjs.js");require("../../generated/tasks.cjs.js");require("../../generated/teams.cjs.js");require("../../generated/thumbnails.cjs.js");require("../../generated/uRIs.cjs.js");require("../../generated/users.cjs.js");require("../../generated/versions.cjs.js");require("../../generated/workfiles.cjs.js");require("../../generated/ynputCloud.cjs.js");require("../../generated/grouping.cjs.js");require("../../generated/views.cjs.js");require("lodash");require("react-toastify");require("uuid");const A=require("../../../util/pubsub.cjs.js"),_=u=>{try{return JSON.parse(u)}catch{return{}}},w=u=>{if(!u.project)return[];const s=[];for(const{node:e}of u.project.tasks.edges)s.push({...e,folderId:e.folderId||"root",attrib:_(e.allAttrib),entityId:e.id,entityType:"task",links:[]});return s},b=(u=[],s,e)=>{const t=u?.map(o=>({type:"overviewTask",id:o.id}))||[],a=e?(Array.isArray(e)?e:[e]).map(o=>({type:"overviewTask",id:o})):[];return[...t,...a,{type:"overviewTask",id:s},{type:"overviewTask",id:"LIST"}]},P=G.api.enhanceEndpoints({endpoints:{GetTasksByParent:{transformResponse:w,providesTags:(u,s,{parentIds:e,projectName:t})=>b(u,t,e)},GetTasksList:{transformResponse:u=>({tasks:w(u),pageInfo:u.project.tasks.pageInfo}),providesTags:(u,s,{projectName:e})=>b(u?.tasks||[],e)}}}),L=F.api.enhanceEndpoints({endpoints:{searchFolders:{}}}),E=100,N=P.injectEndpoints({endpoints:u=>({getOverviewTasksByFolders:u.query({async queryFn({projectName:s,parentIds:e,filter:t,folderFilter:a,search:o},{dispatch:g,forced:y}){try{const h=[];for(let i=0;i<e.length;i+=20){const k=e.slice(i,i+20),r=(await Promise.all(k.map(async n=>g(P.endpoints.GetTasksByParent.initiate({projectName:s,parentIds:[n],filter:t,folderFilter:a,search:o},{forceRefetch:y}))))).filter(n=>!!n.data).flatMap(n=>n.data);h.push(...r)}return{data:h}}catch(I){return console.error(I),{error:{status:"FETCH_ERROR",error:I.message}}}},serializeQueryArgs:({queryArgs:{parentIds:s,...e}})=>({...e}),forceRefetch({currentArg:s,previousArg:e}){return JSON.stringify(s)!==JSON.stringify(e)},providesTags:(s,e,{parentIds:t,projectName:a})=>b(s,a,t),async onCacheEntryAdded({projectName:s,parentIds:e,filter:t,search:a},{cacheDataLoaded:o,cacheEntryRemoved:g,updateCachedData:y,dispatch:I}){let h;const i=new Set,k=100,d=500;let r=!1;const n=()=>{r||(r=!0,setTimeout(T,d))},T=async()=>{if(r=!1,!i.size)return;const f=Array.from(i).slice(0,k);f.forEach(l=>i.delete(l));try{const p=(await I(P.endpoints.GetTasksList.initiate({projectName:s,taskIds:f},{forceRefetch:!0})).unwrap()).tasks||[],q=new Map(p.map(c=>[c.id,c]));y(c=>{for(const m of p){const v=c.findIndex(R=>R.id===m.id);v>-1?c[v]=m:c.push(m)}for(const m of f)if(!q.has(m)){const v=c.findIndex(R=>R.id===m);v>-1&&c.splice(v,1)}})}catch(l){console.error("Realtime overview batch update failed",l)}finally{i.size&&n()}};try{await o;const f=async(l,p)=>{const q=p?.summary?.entityId,c=p?.summary?.parentId;!q||!c||e.includes(c)&&(i.add(q),n())};h=A.subscribe("entity.task",f)}catch{}await g,h&&A.unsubscribe(h)}}),getSearchFolders:u.query({async queryFn({projectName:s,folderSearchRequest:e},{dispatch:t}){try{return{data:(await t(L.endpoints.searchFolders.initiate({projectName:s,folderSearchRequest:e}))).data?.folderIds||[]}}catch(a){return console.error(a),{error:{status:"FETCH_ERROR",error:a.message}}}}}),getTasksListInfinite:u.infiniteQuery({infiniteQueryOptions:{initialPageParam:{cursor:"",desc:!1},getNextPageParam:(s,e,t,a)=>{const o=s.pageInfo;if(!(!(t.desc?o.hasPreviousPage:o.hasNextPage)||!o.endCursor))return{cursor:o.endCursor,desc:t.desc}}},queryFn:async({queryArg:s,pageParam:e},t)=>{try{const{projectName:a,filter:o,folderFilter:g,search:y,folderIds:I,sortBy:h,desc:i}=s,{cursor:k}=e,d={projectName:a,filter:o,folderFilter:g,search:y,folderIds:I};h?(d.sortBy=h,i?(d.before=k||void 0,d.last=E):(d.after=k||void 0,d.first=E)):(d.after=k||void 0,d.first=E);const r=await t.dispatch(P.endpoints.GetTasksList.initiate(d,{forceRefetch:!0}));if(r.error)throw r.error;const n={tasks:[],pageInfo:{hasNextPage:!1,endCursor:null,startCursor:null,hasPreviousPage:!1}};return{data:r.data||n}}catch(a){return console.error("Error in getTasksListInfinite queryFn:",a),{error:{status:"FETCH_ERROR",error:a.message}}}},providesTags:(s,e,{projectName:t})=>b(s?.pages.flatMap(a=>a.tasks)||[],t),async onCacheEntryAdded(s,{cacheDataLoaded:e,cacheEntryRemoved:t,updateCachedData:a,dispatch:o}){let g;const y=new Set,I=100,h=500;let i=!1;const k=()=>{i||(i=!0,setTimeout(d,h))},d=async()=>{if(i=!1,!y.size)return;const r=Array.from(y).slice(0,I);r.forEach(n=>y.delete(n));try{const T=(await o(P.endpoints.GetTasksList.initiate({projectName:s.projectName,taskIds:r,folderIds:s.folderIds},{forceRefetch:!0})).unwrap()).tasks||[],f=new Map(T.map(l=>[l.id,l]));a(l=>{for(const p of T){let q=!1;for(const c of l.pages){const m=c.tasks.findIndex(v=>v.id===p.id);if(m!==-1){c.tasks[m]=p,q=!0;break}}q||(l.pages.length?l.pages[0].tasks.unshift(p):l.pages.push({tasks:[p],pageInfo:{startCursor:null,endCursor:null,hasNextPage:!1,hasPreviousPage:!1}}))}for(const p of r)if(!f.has(p))for(const q of l.pages){const c=q.tasks.findIndex(m=>m.id===p);if(c!==-1){q.tasks.splice(c,1);break}}})}catch(n){console.error("Realtime infinite tasks batch update failed",n)}finally{y.size&&k()}};try{await e;const r=async(n,T)=>{const f=T?.summary?.entityId;f&&(y.add(f),k())};g=A.subscribe("entity.task",r)}catch{}await t,g&&A.unsubscribe(g)}}),getGroupedTasksList:u.query({queryFn:async({projectName:s,groups:e,search:t,folderFilter:a,folderIds:o,desc:g,sortBy:y,groupCount:I},h)=>{try{let i=[];for(const r of e){const n=I||r.count||500,T={projectName:s,filter:r.filter,folderFilter:a,search:t,folderIds:o,sortBy:y,group:r.value};g?T.last=n:T.first=n;const f=h.dispatch(P.endpoints.GetTasksList.initiate(T,{forceRefetch:!0}));i.push(f)}const k=await Promise.all(i),d=[];for(const r of k){if(r.error)throw r.error;const n=r.originalArgs?.group,T=r.data?.pageInfo?.hasNextPage||r.data?.pageInfo?.hasPreviousPage||!1,f=r.data?.tasks.map((l,p,q)=>({...l,groups:[{value:n,hasNextPage:p===q.length-1&&T?n:void 0}]}))||[];d.push(...f)}return{data:{tasks:d}}}catch(i){return console.error("Error in getGroupedTasksList queryFn:",i),{error:{status:"FETCH_ERROR",error:i.message}}}},providesTags:(s,e,{projectName:t})=>b(s?.tasks,t)})})}),{useGetOverviewTasksByFoldersQuery:S,useGetSearchFoldersQuery:C,useGetTasksListQuery:x,useGetTasksListInfiniteInfiniteQuery:Q,useLazyGetTasksByParentQuery:B,useGetGroupedTasksListQuery:O}=N;exports.TASKS_INFINITE_QUERY_COUNT=E;exports.default=N;exports.parseAllAttribs=_;exports.useGetGroupedTasksListQuery=O;exports.useGetOverviewTasksByFoldersQuery=S;exports.useGetSearchFoldersQuery=C;exports.useGetTasksListInfiniteInfiniteQuery=Q;exports.useGetTasksListQuery=x;exports.useLazyGetTasksByParentQuery=B;
|
|
2
2
|
//# sourceMappingURL=getOverview.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getOverview.cjs.js","sources":["../../../../../../src/api/queries/overview/getOverview.ts"],"sourcesContent":["import {\n gqlApi,\n GetTasksByParentQuery,\n GetTasksListQuery,\n foldersApi,\n SearchFoldersApiArg,\n GetTasksListQueryVariables,\n} from '@shared/api/generated'\nimport { PubSub } from '@shared/util'\nimport { EditorTaskNode } from '@shared/containers/ProjectTreeTable'\nimport {\n DefinitionsFromApi,\n FetchBaseQueryError,\n OverrideResultType,\n TagTypesFromApi,\n} from '@reduxjs/toolkit/query'\n\n// parse attribs JSON string to object\nexport const parseAllAttribs = (allAttrib: string) => {\n try {\n return JSON.parse(allAttrib)\n } catch (e) {\n return {}\n }\n}\n\nconst transformFilteredEntitiesByParent = (response: GetTasksByParentQuery): EditorTaskNode[] => {\n if (!response.project) {\n return []\n }\n\n const tasks: EditorTaskNode[] = []\n for (const { node: taskNode } of response.project.tasks.edges) {\n tasks.push({\n ...taskNode,\n folderId: taskNode.folderId || 'root',\n attrib: parseAllAttribs(taskNode.allAttrib),\n entityId: taskNode.id,\n entityType: 'task',\n links: [],\n })\n }\n\n return tasks\n}\n\nconst getOverviewTaskTags = (\n result: EditorTaskNode[] | undefined = [],\n projectName: string,\n parentIds?: string | string[],\n) => {\n const taskTags = result?.map((task) => ({ type: 'overviewTask', id: task.id })) || []\n\n const parentTags = parentIds\n ? (Array.isArray(parentIds) ? parentIds : [parentIds]).map((id) => ({\n type: 'overviewTask',\n id,\n }))\n : []\n\n return [\n ...taskTags,\n ...parentTags,\n { type: 'overviewTask', id: projectName },\n { type: 'overviewTask', id: 'LIST' },\n ]\n}\n\nexport type GetTasksListResult = {\n pageInfo: GetTasksListQuery['project']['tasks']['pageInfo']\n tasks: EditorTaskNode[]\n}\n\nexport type GetTasksListArgs = {\n projectName: string\n filter?: string\n folderFilter?: string\n search?: string\n folderIds?: string[]\n desc?: boolean\n sortBy?: string\n}\n\nexport type GetGroupedTasksListResult = {\n tasks: EditorTaskNode[]\n}\n\nexport type GetGroupedTasksListArgs = {\n projectName: string\n groups: { filter: string; count: number; value: string }[]\n search?: string\n folderFilter?: string\n folderIds?: string[]\n desc?: boolean\n sortBy?: string\n}\n\n// Define the page param type for infinite query\ntype TasksListPageParam = {\n cursor: string\n desc?: boolean\n}\n\ntype Definitions = DefinitionsFromApi<typeof gqlApi>\ntype TagTypes = TagTypesFromApi<typeof gqlApi>\ntype UpdatedDefinitions = Omit<Definitions, 'GetFilteredEntities'> & {\n GetTasksByParent: OverrideResultType<Definitions['GetTasksByParent'], EditorTaskNode[]>\n GetTasksList: OverrideResultType<Definitions['GetTasksList'], GetTasksListResult>\n}\n\n// GRAPHQL API\nconst enhancedApi = gqlApi.enhanceEndpoints<TagTypes, UpdatedDefinitions>({\n endpoints: {\n // This gets tasks for all parent folders provided\n // But in this case it will only ever receive one parent folder from the getOverviewTasksByFolders query\n // It is only used by getOverviewTasksByFolders in this file\n GetTasksByParent: {\n transformResponse: transformFilteredEntitiesByParent,\n providesTags: (result, _e, { parentIds, projectName }) =>\n getOverviewTaskTags(result, projectName, parentIds),\n },\n GetTasksList: {\n transformResponse: (result: GetTasksListQuery) => ({\n tasks: transformFilteredEntitiesByParent(result),\n pageInfo: result.project.tasks.pageInfo,\n }),\n providesTags: (result, _e, { projectName }) =>\n getOverviewTaskTags(result?.tasks || [], projectName),\n },\n },\n})\n\n// REST FOLDERS API\nconst foldersApiEnhanced = foldersApi.enhanceEndpoints({\n endpoints: {\n searchFolders: {},\n },\n})\n\nexport const TASKS_INFINITE_QUERY_COUNT = 100 // Number of items to fetch per page\n\nconst injectedApi = enhancedApi.injectEndpoints({\n endpoints: (build) => ({\n // Each project has one cache for all the tasks of the expanded folders\n // Changing the expanded folders will trigger a refetch but not a new cache\n // Each expanded folder has it's own query that is looped over here\n // When new folders are expanded, the new tasks are fetched and we use the cache for the rest\n // This also solves the pagination issue of getting all tasks in one query, splitting it up in multiple queries to avoid pagination limits\n getOverviewTasksByFolders: build.query<\n EditorTaskNode[],\n {\n projectName: string\n parentIds: string[]\n filter?: string\n folderFilter?: string\n search?: string\n }\n >({\n async queryFn(\n { projectName, parentIds, filter, folderFilter, search },\n { dispatch, forced },\n ) {\n try {\n // Process parent IDs in sequential batches\n const BATCH_SIZE = 20 // Process x parentIds at a time\n const allTasks: EditorTaskNode[] = []\n\n // Process batches one after another\n for (let i = 0; i < parentIds.length; i += BATCH_SIZE) {\n const batchParentIds = parentIds.slice(i, i + BATCH_SIZE)\n\n // Process this batch in parallel\n const batchResults = await Promise.all(\n batchParentIds.map(async (parentId) =>\n dispatch(\n enhancedApi.endpoints.GetTasksByParent.initiate(\n {\n projectName,\n parentIds: [parentId],\n filter,\n folderFilter,\n search,\n },\n { forceRefetch: forced },\n ),\n ),\n ),\n )\n\n // Add the results from this batch to our accumulated results\n const batchTasks = batchResults\n .filter((r) => !!r.data)\n .flatMap((result) => result.data as EditorTaskNode[])\n\n allTasks.push(...batchTasks)\n }\n\n return { data: allTasks }\n } catch (e: any) {\n // handle errors appropriately\n console.error(e)\n const error = { status: 'FETCH_ERROR', error: e.message } as FetchBaseQueryError\n return { error }\n }\n },\n // keep one cache per project\n serializeQueryArgs: ({ queryArgs: { parentIds, ...rest } }) => ({\n ...rest,\n }),\n // Refetch when the page arg changes\n forceRefetch({ currentArg, previousArg }) {\n return JSON.stringify(currentArg) !== JSON.stringify(previousArg)\n },\n providesTags: (result, _e, { parentIds, projectName }) =>\n getOverviewTaskTags(result, projectName, parentIds),\n async onCacheEntryAdded(\n { projectName, parentIds, filter, search },\n { cacheDataLoaded, cacheEntryRemoved, updateCachedData, dispatch },\n ) {\n let token: any\n const pendingTaskIds = new Set<string>()\n const MAX_BATCH = 100\n const INTERVAL = 500\n let scheduled = false\n\n const schedule = () => {\n if (scheduled) return\n scheduled = true\n setTimeout(flush, INTERVAL)\n }\n\n const flush = async () => {\n scheduled = false\n if (!pendingTaskIds.size) return\n const batchIds = Array.from(pendingTaskIds).slice(0, MAX_BATCH)\n batchIds.forEach((id) => pendingTaskIds.delete(id))\n try {\n const res = await dispatch(\n enhancedApi.endpoints.GetTasksList.initiate(\n {\n projectName,\n taskIds: batchIds,\n } as any,\n { forceRefetch: true },\n ),\n ).unwrap()\n const returned = res.tasks || []\n const returnedMap = new Map(returned.map((t: EditorTaskNode) => [t.id, t]))\n\n updateCachedData((draft: EditorTaskNode[]) => {\n // update or add\n for (const task of returned) {\n const idx = draft.findIndex((t) => t.id === task.id)\n if (idx > -1) draft[idx] = task\n else draft.push(task)\n }\n // remove missing\n for (const id of batchIds) {\n if (!returnedMap.has(id)) {\n const idx = draft.findIndex((t) => t.id === id)\n if (idx > -1) draft.splice(idx, 1)\n }\n }\n })\n } catch (err) {\n console.error('Realtime overview batch update failed', err)\n } finally {\n if (pendingTaskIds.size) schedule()\n }\n }\n try {\n await cacheDataLoaded\n\n const handlePubSub = async (_topic: string, message: any) => {\n const taskId = message?.summary?.entityId\n const parentId = message?.summary?.parentId\n if (!taskId || !parentId) return\n // Only react if the parent folder is part of the current expanded set\n if (!parentIds.includes(parentId)) return\n pendingTaskIds.add(taskId)\n schedule()\n }\n\n // Subscribe to task entity updates\n // NOTE: backend emits topics like 'entity.task.assignees_changed'.\n // Assuming PubSub supports prefix matching when subscribing without the suffix.\n token = PubSub.subscribe('entity.task', handlePubSub)\n } catch (e) {\n // cache entry removed before loaded - ignore\n }\n\n await cacheEntryRemoved\n if (token) PubSub.unsubscribe(token)\n },\n }),\n // searchFolders is a post so it's a bit annoying to consume\n // we wrap it in a queryFn to make it easier to consume as a query hook\n getSearchFolders: build.query<string[], SearchFoldersApiArg>({\n async queryFn({ projectName, folderSearchRequest }, { dispatch }) {\n try {\n const result = await dispatch(\n foldersApiEnhanced.endpoints.searchFolders.initiate({\n projectName,\n folderSearchRequest,\n }),\n )\n\n const data = result.data?.folderIds || []\n\n return { data }\n } catch (e: any) {\n console.error(e)\n const error = { status: 'FETCH_ERROR', error: e.message } as FetchBaseQueryError\n return { error }\n }\n },\n }),\n // Add new infinite query endpoint for tasks list\n getTasksListInfinite: build.infiniteQuery<\n GetTasksListResult,\n GetTasksListArgs,\n TasksListPageParam\n >({\n infiniteQueryOptions: {\n initialPageParam: { cursor: '', desc: false },\n // Calculate the next page param based on current page response and params\n getNextPageParam: (lastPage, _allPages, lastPageParam, _allPageParams) => {\n // Use the endCursor from the query as the next page param\n const pageInfo = lastPage.pageInfo\n const desc = lastPageParam.desc\n const hasNextPage = desc ? pageInfo.hasPreviousPage : pageInfo.hasNextPage\n\n if (!hasNextPage || !pageInfo.endCursor) return undefined\n\n return {\n cursor: pageInfo.endCursor,\n desc: lastPageParam.desc,\n }\n },\n },\n queryFn: async ({ queryArg, pageParam }, api) => {\n try {\n const { projectName, filter, folderFilter, search, folderIds, sortBy, desc } = queryArg\n const { cursor } = pageParam\n\n // Build the query parameters for GetTasksList\n const queryParams: any = {\n projectName,\n filter,\n folderFilter,\n search,\n folderIds,\n }\n\n // Add cursor-based pagination\n if (sortBy) {\n queryParams.sortBy = sortBy\n if (desc) {\n queryParams.before = cursor || undefined\n queryParams.last = TASKS_INFINITE_QUERY_COUNT\n } else {\n queryParams.after = cursor || undefined\n queryParams.first = TASKS_INFINITE_QUERY_COUNT\n }\n } else {\n queryParams.after = cursor || undefined\n queryParams.first = TASKS_INFINITE_QUERY_COUNT\n }\n\n // Call the existing GetTasksList endpoint\n const result = await api.dispatch(\n enhancedApi.endpoints.GetTasksList.initiate(queryParams, { forceRefetch: true }),\n )\n\n if (result.error) throw result.error\n const fallback = {\n tasks: [],\n pageInfo: {\n hasNextPage: false,\n endCursor: null,\n startCursor: null,\n hasPreviousPage: false,\n },\n }\n\n // Return the tasks directly as required by the infinite query format\n return {\n data: result.data || fallback,\n }\n } catch (e: any) {\n console.error('Error in getTasksListInfinite queryFn:', e)\n return { error: { status: 'FETCH_ERROR', error: e.message } as FetchBaseQueryError }\n }\n },\n providesTags: (result, _e, { projectName }) =>\n getOverviewTaskTags(result?.pages.flatMap((p) => p.tasks) || [], projectName),\n async onCacheEntryAdded(\n arg,\n { cacheDataLoaded, cacheEntryRemoved, updateCachedData, dispatch },\n ) {\n let token: any\n const pendingTaskIds = new Set<string>()\n const MAX_BATCH = 100\n const INTERVAL = 500\n let scheduled = false\n\n const schedule = () => {\n if (scheduled) return\n scheduled = true\n setTimeout(flush, INTERVAL)\n }\n\n const flush = async () => {\n scheduled = false\n if (!pendingTaskIds.size) return\n const batchIds = Array.from(pendingTaskIds).slice(0, MAX_BATCH)\n batchIds.forEach((id) => pendingTaskIds.delete(id))\n try {\n const res = await dispatch(\n enhancedApi.endpoints.GetTasksList.initiate(\n {\n projectName: arg.projectName,\n taskIds: batchIds,\n folderIds: arg.folderIds,\n } as any,\n { forceRefetch: true },\n ),\n ).unwrap()\n\n const returned = res.tasks || []\n const returnedMap = new Map(returned.map((t: EditorTaskNode) => [t.id, t]))\n\n updateCachedData((draft: { pages: GetTasksListResult[]; pageParams: any[] }) => {\n // update/insert\n for (const task of returned) {\n let located = false\n for (const page of draft.pages) {\n const idx = page.tasks.findIndex((t) => t.id === task.id)\n if (idx !== -1) {\n page.tasks[idx] = task\n located = true\n break\n }\n }\n if (!located) {\n if (draft.pages.length) draft.pages[0].tasks.unshift(task)\n else\n draft.pages.push({\n tasks: [task],\n pageInfo: {\n startCursor: null,\n endCursor: null,\n hasNextPage: false,\n hasPreviousPage: false,\n },\n })\n }\n }\n // remove any requested but missing tasks\n for (const id of batchIds) {\n if (returnedMap.has(id)) continue\n for (const page of draft.pages) {\n const idx = page.tasks.findIndex((t) => t.id === id)\n if (idx !== -1) {\n page.tasks.splice(idx, 1)\n break\n }\n }\n }\n })\n } catch (err) {\n console.error('Realtime infinite tasks batch update failed', err)\n } finally {\n if (pendingTaskIds.size) schedule()\n }\n }\n try {\n await cacheDataLoaded\n\n const handlePubSub = async (_topic: string, message: any) => {\n const taskId = message?.summary?.entityId\n if (!taskId) return\n pendingTaskIds.add(taskId)\n schedule()\n }\n\n token = PubSub.subscribe('entity.task', handlePubSub)\n } catch (_) {\n // ignore\n }\n await cacheEntryRemoved\n if (token) PubSub.unsubscribe(token)\n },\n }),\n getGroupedTasksList: build.query<GetGroupedTasksListResult, GetGroupedTasksListArgs>({\n queryFn: async (\n { projectName, groups, search, folderFilter, folderIds, desc, sortBy },\n api,\n ) => {\n try {\n let promises = []\n for (const group of groups) {\n const count = group.count || 500\n\n const queryParams: GetTasksListQueryVariables = {\n projectName,\n filter: group.filter,\n folderFilter, // Passed but not yet supported by backend\n search,\n folderIds,\n sortBy: sortBy,\n // @ts-expect-error - we know group does not exist on query variables but we need it for later\n group: group.value,\n }\n if (desc) {\n queryParams.last = count\n } else {\n queryParams.first = count\n }\n\n const promise = api.dispatch(\n enhancedApi.endpoints.GetTasksList.initiate(queryParams, { forceRefetch: true }),\n )\n promises.push(promise)\n }\n\n const result = await Promise.all(promises)\n const tasks: EditorTaskNode[] = []\n for (const res of result) {\n if (res.error) throw res.error\n // get group value\n // @ts-expect-error - we know group does exist on res.originalArgs from line 319\n const groupValue = res.originalArgs?.group as string\n\n const hasNextPage =\n res.data?.pageInfo?.hasNextPage || res.data?.pageInfo?.hasPreviousPage || false\n const groupTasks =\n res.data?.tasks.map((task, i, a) => ({\n ...task,\n groups: [\n {\n value: groupValue,\n hasNextPage: i === a.length - 1 && hasNextPage ? groupValue : undefined, // Only add hasNextPage to the last task in the group\n },\n ],\n })) || []\n\n tasks.push(...groupTasks)\n }\n\n // Return the tasks directly as required by the query format\n return {\n data: {\n tasks,\n },\n }\n } catch (error: any) {\n console.error('Error in getGroupedTasksList queryFn:', error)\n return { error: { status: 'FETCH_ERROR', error: error.message } as FetchBaseQueryError }\n }\n },\n providesTags: (result, _e, { projectName }) =>\n getOverviewTaskTags(result?.tasks, projectName),\n }),\n }),\n})\n\nexport const {\n useGetOverviewTasksByFoldersQuery,\n useGetSearchFoldersQuery,\n useGetTasksListQuery,\n useGetTasksListInfiniteInfiniteQuery,\n useLazyGetTasksByParentQuery,\n useGetGroupedTasksListQuery,\n} = injectedApi\nexport default injectedApi\n"],"names":["parseAllAttribs","allAttrib","transformFilteredEntitiesByParent","response","tasks","taskNode","getOverviewTaskTags","result","projectName","parentIds","taskTags","task","parentTags","id","enhancedApi","gqlApi","_e","foldersApiEnhanced","foldersApi","TASKS_INFINITE_QUERY_COUNT","injectedApi","build","filter","folderFilter","search","dispatch","forced","allTasks","i","batchParentIds","batchTasks","parentId","r","e","rest","currentArg","previousArg","cacheDataLoaded","cacheEntryRemoved","updateCachedData","token","pendingTaskIds","MAX_BATCH","INTERVAL","scheduled","schedule","flush","batchIds","returned","returnedMap","t","draft","idx","err","handlePubSub","_topic","message","taskId","PubSub","folderSearchRequest","lastPage","_allPages","lastPageParam","_allPageParams","pageInfo","queryArg","pageParam","api","folderIds","sortBy","desc","cursor","queryParams","fallback","p","arg","located","page","groups","promises","group","count","promise","res","groupValue","hasNextPage","groupTasks","a","error","useGetOverviewTasksByFoldersQuery","useGetSearchFoldersQuery","useGetTasksListQuery","useGetTasksListInfiniteInfiniteQuery","useLazyGetTasksByParentQuery","useGetGroupedTasksListQuery"],"mappings":"q0DAkBaA,EAAmBC,GAAsB,CACpD,GAAI,CACF,OAAO,KAAK,MAAMA,CAAS,CAC7B,MAAY,CACV,MAAO,CAAA,CACT,CACF,EAEMC,EAAqCC,GAAsD,CAC/F,GAAI,CAACA,EAAS,QACZ,MAAO,CAAA,EAGT,MAAMC,EAA0B,CAAA,EAChC,SAAW,CAAE,KAAMC,CAAA,IAAcF,EAAS,QAAQ,MAAM,MACtDC,EAAM,KAAK,CACT,GAAGC,EACH,SAAUA,EAAS,UAAY,OAC/B,OAAQL,EAAgBK,EAAS,SAAS,EAC1C,SAAUA,EAAS,GACnB,WAAY,OACZ,MAAO,CAAA,CAAC,CACT,EAGH,OAAOD,CACT,EAEME,EAAsB,CAC1BC,EAAuC,GACvCC,EACAC,IACG,CACH,MAAMC,EAAWH,GAAQ,IAAKI,IAAU,CAAE,KAAM,eAAgB,GAAIA,EAAK,EAAA,EAAK,GAAK,CAAA,EAE7EC,EAAaH,GACd,MAAM,QAAQA,CAAS,EAAIA,EAAY,CAACA,CAAS,GAAG,IAAKI,IAAQ,CAChE,KAAM,eACN,GAAAA,CAAA,EACA,EACF,CAAA,EAEJ,MAAO,CACL,GAAGH,EACH,GAAGE,EACH,CAAE,KAAM,eAAgB,GAAIJ,CAAA,EAC5B,CAAE,KAAM,eAAgB,GAAI,MAAA,CAAO,CAEvC,EA6CMM,EAAcC,EAAAA,IAAO,iBAA+C,CACxE,UAAW,CAIT,iBAAkB,CAChB,kBAAmBb,EACnB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W+E,KAAO5E,EAAQ,CACxB,GAAI4E,EAAI,MAAO,MAAMA,EAAI,MAGzB,MAAMC,EAAaD,EAAI,cAAc,MAE/BE,EACJF,EAAI,MAAM,UAAU,aAAeA,EAAI,MAAM,UAAU,iBAAmB,GACtEG,EACJH,EAAI,MAAM,MAAM,IAAI,CAACxE,EAAMiB,EAAG2D,KAAO,CACnC,GAAG5E,EACH,OAAQ,CACN,CACE,MAAOyE,EACP,YAAaxD,IAAM2D,EAAE,OAAS,GAAKF,EAAcD,EAAa,MAAA,CAChE,CACF,EACA,GAAK,CAAA,EAEThF,EAAM,KAAK,GAAGkF,CAAU,CAC1B,CAGA,MAAO,CACL,KAAM,CACJ,MAAAlF,CAAA,CACF,CAEJ,OAASoF,EAAY,CACnB,eAAQ,MAAM,wCAAyCA,CAAK,EACrD,CAAE,MAAO,CAAE,OAAQ,cAAe,MAAOA,EAAM,QAAQ,CAChE,CACF,EACA,aAAc,CAACjF,EAAQS,EAAI,CAAE,YAAAR,KAC3BF,EAAoBC,GAAQ,MAAOC,CAAW,CAAA,CACjD,CAAA,EAEL,CAAC,EAEY,CACX,kCAAAiF,EACA,yBAAAC,EACA,qBAAAC,EACA,qCAAAC,EACA,6BAAAC,EACA,4BAAAC,CACF,EAAI1E"}
|
|
1
|
+
{"version":3,"file":"getOverview.cjs.js","sources":["../../../../../../src/api/queries/overview/getOverview.ts"],"sourcesContent":["import {\n gqlApi,\n GetTasksByParentQuery,\n GetTasksListQuery,\n foldersApi,\n SearchFoldersApiArg,\n GetTasksListQueryVariables,\n} from '@shared/api/generated'\nimport { PubSub } from '@shared/util'\nimport { EditorTaskNode } from '@shared/containers/ProjectTreeTable'\nimport {\n DefinitionsFromApi,\n FetchBaseQueryError,\n OverrideResultType,\n TagTypesFromApi,\n} from '@reduxjs/toolkit/query'\n\n// parse attribs JSON string to object\nexport const parseAllAttribs = (allAttrib: string) => {\n try {\n return JSON.parse(allAttrib)\n } catch (e) {\n return {}\n }\n}\n\nconst transformFilteredEntitiesByParent = (response: GetTasksByParentQuery): EditorTaskNode[] => {\n if (!response.project) {\n return []\n }\n\n const tasks: EditorTaskNode[] = []\n for (const { node: taskNode } of response.project.tasks.edges) {\n tasks.push({\n ...taskNode,\n folderId: taskNode.folderId || 'root',\n attrib: parseAllAttribs(taskNode.allAttrib),\n entityId: taskNode.id,\n entityType: 'task',\n links: [],\n })\n }\n\n return tasks\n}\n\nconst getOverviewTaskTags = (\n result: EditorTaskNode[] | undefined = [],\n projectName: string,\n parentIds?: string | string[],\n) => {\n const taskTags = result?.map((task) => ({ type: 'overviewTask', id: task.id })) || []\n\n const parentTags = parentIds\n ? (Array.isArray(parentIds) ? parentIds : [parentIds]).map((id) => ({\n type: 'overviewTask',\n id,\n }))\n : []\n\n return [\n ...taskTags,\n ...parentTags,\n { type: 'overviewTask', id: projectName },\n { type: 'overviewTask', id: 'LIST' },\n ]\n}\n\nexport type GetTasksListResult = {\n pageInfo: GetTasksListQuery['project']['tasks']['pageInfo']\n tasks: EditorTaskNode[]\n}\n\nexport type GetTasksListArgs = {\n projectName: string\n filter?: string\n folderFilter?: string\n search?: string\n folderIds?: string[]\n desc?: boolean\n sortBy?: string\n}\n\nexport type GetGroupedTasksListResult = {\n tasks: EditorTaskNode[]\n}\n\nexport type GetGroupedTasksListArgs = {\n projectName: string\n groups: { filter: string; count: number; value: string }[]\n search?: string\n folderFilter?: string\n folderIds?: string[]\n desc?: boolean\n sortBy?: string\n groupCount?: number // optional override for all groups\n}\n\n// Define the page param type for infinite query\ntype TasksListPageParam = {\n cursor: string\n desc?: boolean\n}\n\ntype Definitions = DefinitionsFromApi<typeof gqlApi>\ntype TagTypes = TagTypesFromApi<typeof gqlApi>\ntype UpdatedDefinitions = Omit<Definitions, 'GetFilteredEntities'> & {\n GetTasksByParent: OverrideResultType<Definitions['GetTasksByParent'], EditorTaskNode[]>\n GetTasksList: OverrideResultType<Definitions['GetTasksList'], GetTasksListResult>\n}\n\n// GRAPHQL API\nconst enhancedApi = gqlApi.enhanceEndpoints<TagTypes, UpdatedDefinitions>({\n endpoints: {\n // This gets tasks for all parent folders provided\n // But in this case it will only ever receive one parent folder from the getOverviewTasksByFolders query\n // It is only used by getOverviewTasksByFolders in this file\n GetTasksByParent: {\n transformResponse: transformFilteredEntitiesByParent,\n providesTags: (result, _e, { parentIds, projectName }) =>\n getOverviewTaskTags(result, projectName, parentIds),\n },\n GetTasksList: {\n transformResponse: (result: GetTasksListQuery) => ({\n tasks: transformFilteredEntitiesByParent(result),\n pageInfo: result.project.tasks.pageInfo,\n }),\n providesTags: (result, _e, { projectName }) =>\n getOverviewTaskTags(result?.tasks || [], projectName),\n },\n },\n})\n\n// REST FOLDERS API\nconst foldersApiEnhanced = foldersApi.enhanceEndpoints({\n endpoints: {\n searchFolders: {},\n },\n})\n\nexport const TASKS_INFINITE_QUERY_COUNT = 100 // Number of items to fetch per page\n\nconst injectedApi = enhancedApi.injectEndpoints({\n endpoints: (build) => ({\n // Each project has one cache for all the tasks of the expanded folders\n // Changing the expanded folders will trigger a refetch but not a new cache\n // Each expanded folder has it's own query that is looped over here\n // When new folders are expanded, the new tasks are fetched and we use the cache for the rest\n // This also solves the pagination issue of getting all tasks in one query, splitting it up in multiple queries to avoid pagination limits\n getOverviewTasksByFolders: build.query<\n EditorTaskNode[],\n {\n projectName: string\n parentIds: string[]\n filter?: string\n folderFilter?: string\n search?: string\n }\n >({\n async queryFn(\n { projectName, parentIds, filter, folderFilter, search },\n { dispatch, forced },\n ) {\n try {\n // Process parent IDs in sequential batches\n const BATCH_SIZE = 20 // Process x parentIds at a time\n const allTasks: EditorTaskNode[] = []\n\n // Process batches one after another\n for (let i = 0; i < parentIds.length; i += BATCH_SIZE) {\n const batchParentIds = parentIds.slice(i, i + BATCH_SIZE)\n\n // Process this batch in parallel\n const batchResults = await Promise.all(\n batchParentIds.map(async (parentId) =>\n dispatch(\n enhancedApi.endpoints.GetTasksByParent.initiate(\n {\n projectName,\n parentIds: [parentId],\n filter,\n folderFilter,\n search,\n },\n { forceRefetch: forced },\n ),\n ),\n ),\n )\n\n // Add the results from this batch to our accumulated results\n const batchTasks = batchResults\n .filter((r) => !!r.data)\n .flatMap((result) => result.data as EditorTaskNode[])\n\n allTasks.push(...batchTasks)\n }\n\n return { data: allTasks }\n } catch (e: any) {\n // handle errors appropriately\n console.error(e)\n const error = { status: 'FETCH_ERROR', error: e.message } as FetchBaseQueryError\n return { error }\n }\n },\n // keep one cache per project\n serializeQueryArgs: ({ queryArgs: { parentIds, ...rest } }) => ({\n ...rest,\n }),\n // Refetch when the page arg changes\n forceRefetch({ currentArg, previousArg }) {\n return JSON.stringify(currentArg) !== JSON.stringify(previousArg)\n },\n providesTags: (result, _e, { parentIds, projectName }) =>\n getOverviewTaskTags(result, projectName, parentIds),\n async onCacheEntryAdded(\n { projectName, parentIds, filter, search },\n { cacheDataLoaded, cacheEntryRemoved, updateCachedData, dispatch },\n ) {\n let token: any\n const pendingTaskIds = new Set<string>()\n const MAX_BATCH = 100\n const INTERVAL = 500\n let scheduled = false\n\n const schedule = () => {\n if (scheduled) return\n scheduled = true\n setTimeout(flush, INTERVAL)\n }\n\n const flush = async () => {\n scheduled = false\n if (!pendingTaskIds.size) return\n const batchIds = Array.from(pendingTaskIds).slice(0, MAX_BATCH)\n batchIds.forEach((id) => pendingTaskIds.delete(id))\n try {\n const res = await dispatch(\n enhancedApi.endpoints.GetTasksList.initiate(\n {\n projectName,\n taskIds: batchIds,\n } as any,\n { forceRefetch: true },\n ),\n ).unwrap()\n const returned = res.tasks || []\n const returnedMap = new Map(returned.map((t: EditorTaskNode) => [t.id, t]))\n\n updateCachedData((draft: EditorTaskNode[]) => {\n // update or add\n for (const task of returned) {\n const idx = draft.findIndex((t) => t.id === task.id)\n if (idx > -1) draft[idx] = task\n else draft.push(task)\n }\n // remove missing\n for (const id of batchIds) {\n if (!returnedMap.has(id)) {\n const idx = draft.findIndex((t) => t.id === id)\n if (idx > -1) draft.splice(idx, 1)\n }\n }\n })\n } catch (err) {\n console.error('Realtime overview batch update failed', err)\n } finally {\n if (pendingTaskIds.size) schedule()\n }\n }\n try {\n await cacheDataLoaded\n\n const handlePubSub = async (_topic: string, message: any) => {\n const taskId = message?.summary?.entityId\n const parentId = message?.summary?.parentId\n if (!taskId || !parentId) return\n // Only react if the parent folder is part of the current expanded set\n if (!parentIds.includes(parentId)) return\n pendingTaskIds.add(taskId)\n schedule()\n }\n\n // Subscribe to task entity updates\n // NOTE: backend emits topics like 'entity.task.assignees_changed'.\n // Assuming PubSub supports prefix matching when subscribing without the suffix.\n token = PubSub.subscribe('entity.task', handlePubSub)\n } catch (e) {\n // cache entry removed before loaded - ignore\n }\n\n await cacheEntryRemoved\n if (token) PubSub.unsubscribe(token)\n },\n }),\n // searchFolders is a post so it's a bit annoying to consume\n // we wrap it in a queryFn to make it easier to consume as a query hook\n getSearchFolders: build.query<string[], SearchFoldersApiArg>({\n async queryFn({ projectName, folderSearchRequest }, { dispatch }) {\n try {\n const result = await dispatch(\n foldersApiEnhanced.endpoints.searchFolders.initiate({\n projectName,\n folderSearchRequest,\n }),\n )\n\n const data = result.data?.folderIds || []\n\n return { data }\n } catch (e: any) {\n console.error(e)\n const error = { status: 'FETCH_ERROR', error: e.message } as FetchBaseQueryError\n return { error }\n }\n },\n }),\n // Add new infinite query endpoint for tasks list\n getTasksListInfinite: build.infiniteQuery<\n GetTasksListResult,\n GetTasksListArgs,\n TasksListPageParam\n >({\n infiniteQueryOptions: {\n initialPageParam: { cursor: '', desc: false },\n // Calculate the next page param based on current page response and params\n getNextPageParam: (lastPage, _allPages, lastPageParam, _allPageParams) => {\n // Use the endCursor from the query as the next page param\n const pageInfo = lastPage.pageInfo\n const desc = lastPageParam.desc\n const hasNextPage = desc ? pageInfo.hasPreviousPage : pageInfo.hasNextPage\n\n if (!hasNextPage || !pageInfo.endCursor) return undefined\n\n return {\n cursor: pageInfo.endCursor,\n desc: lastPageParam.desc,\n }\n },\n },\n queryFn: async ({ queryArg, pageParam }, api) => {\n try {\n const { projectName, filter, folderFilter, search, folderIds, sortBy, desc } = queryArg\n const { cursor } = pageParam\n\n // Build the query parameters for GetTasksList\n const queryParams: any = {\n projectName,\n filter,\n folderFilter,\n search,\n folderIds,\n }\n\n // Add cursor-based pagination\n if (sortBy) {\n queryParams.sortBy = sortBy\n if (desc) {\n queryParams.before = cursor || undefined\n queryParams.last = TASKS_INFINITE_QUERY_COUNT\n } else {\n queryParams.after = cursor || undefined\n queryParams.first = TASKS_INFINITE_QUERY_COUNT\n }\n } else {\n queryParams.after = cursor || undefined\n queryParams.first = TASKS_INFINITE_QUERY_COUNT\n }\n\n // Call the existing GetTasksList endpoint\n const result = await api.dispatch(\n enhancedApi.endpoints.GetTasksList.initiate(queryParams, { forceRefetch: true }),\n )\n\n if (result.error) throw result.error\n const fallback = {\n tasks: [],\n pageInfo: {\n hasNextPage: false,\n endCursor: null,\n startCursor: null,\n hasPreviousPage: false,\n },\n }\n\n // Return the tasks directly as required by the infinite query format\n return {\n data: result.data || fallback,\n }\n } catch (e: any) {\n console.error('Error in getTasksListInfinite queryFn:', e)\n return { error: { status: 'FETCH_ERROR', error: e.message } as FetchBaseQueryError }\n }\n },\n providesTags: (result, _e, { projectName }) =>\n getOverviewTaskTags(result?.pages.flatMap((p) => p.tasks) || [], projectName),\n async onCacheEntryAdded(\n arg,\n { cacheDataLoaded, cacheEntryRemoved, updateCachedData, dispatch },\n ) {\n let token: any\n const pendingTaskIds = new Set<string>()\n const MAX_BATCH = 100\n const INTERVAL = 500\n let scheduled = false\n\n const schedule = () => {\n if (scheduled) return\n scheduled = true\n setTimeout(flush, INTERVAL)\n }\n\n const flush = async () => {\n scheduled = false\n if (!pendingTaskIds.size) return\n const batchIds = Array.from(pendingTaskIds).slice(0, MAX_BATCH)\n batchIds.forEach((id) => pendingTaskIds.delete(id))\n try {\n const res = await dispatch(\n enhancedApi.endpoints.GetTasksList.initiate(\n {\n projectName: arg.projectName,\n taskIds: batchIds,\n folderIds: arg.folderIds,\n } as any,\n { forceRefetch: true },\n ),\n ).unwrap()\n\n const returned = res.tasks || []\n const returnedMap = new Map(returned.map((t: EditorTaskNode) => [t.id, t]))\n\n updateCachedData((draft: { pages: GetTasksListResult[]; pageParams: any[] }) => {\n // update/insert\n for (const task of returned) {\n let located = false\n for (const page of draft.pages) {\n const idx = page.tasks.findIndex((t) => t.id === task.id)\n if (idx !== -1) {\n page.tasks[idx] = task\n located = true\n break\n }\n }\n if (!located) {\n if (draft.pages.length) draft.pages[0].tasks.unshift(task)\n else\n draft.pages.push({\n tasks: [task],\n pageInfo: {\n startCursor: null,\n endCursor: null,\n hasNextPage: false,\n hasPreviousPage: false,\n },\n })\n }\n }\n // remove any requested but missing tasks\n for (const id of batchIds) {\n if (returnedMap.has(id)) continue\n for (const page of draft.pages) {\n const idx = page.tasks.findIndex((t) => t.id === id)\n if (idx !== -1) {\n page.tasks.splice(idx, 1)\n break\n }\n }\n }\n })\n } catch (err) {\n console.error('Realtime infinite tasks batch update failed', err)\n } finally {\n if (pendingTaskIds.size) schedule()\n }\n }\n try {\n await cacheDataLoaded\n\n const handlePubSub = async (_topic: string, message: any) => {\n const taskId = message?.summary?.entityId\n if (!taskId) return\n pendingTaskIds.add(taskId)\n schedule()\n }\n\n token = PubSub.subscribe('entity.task', handlePubSub)\n } catch (_) {\n // ignore\n }\n await cacheEntryRemoved\n if (token) PubSub.unsubscribe(token)\n },\n }),\n getGroupedTasksList: build.query<GetGroupedTasksListResult, GetGroupedTasksListArgs>({\n queryFn: async (\n { projectName, groups, search, folderFilter, folderIds, desc, sortBy, groupCount },\n api,\n ) => {\n try {\n let promises = []\n for (const group of groups) {\n // Determine count for this group - use argument override, else group count, else default\n const count = groupCount || group.count || 500\n\n const queryParams: GetTasksListQueryVariables = {\n projectName,\n filter: group.filter,\n folderFilter, // Passed but not yet supported by backend\n search,\n folderIds,\n sortBy: sortBy,\n // @ts-expect-error - we know group does not exist on query variables but we need it for later\n group: group.value,\n }\n if (desc) {\n queryParams.last = count\n } else {\n queryParams.first = count\n }\n\n const promise = api.dispatch(\n enhancedApi.endpoints.GetTasksList.initiate(queryParams, { forceRefetch: true }),\n )\n promises.push(promise)\n }\n\n const result = await Promise.all(promises)\n const tasks: EditorTaskNode[] = []\n for (const res of result) {\n if (res.error) throw res.error\n // get group value\n // @ts-expect-error - we know group does exist on res.originalArgs from line 319\n const groupValue = res.originalArgs?.group as string\n\n const hasNextPage =\n res.data?.pageInfo?.hasNextPage || res.data?.pageInfo?.hasPreviousPage || false\n const groupTasks =\n res.data?.tasks.map((task, i, a) => ({\n ...task,\n groups: [\n {\n value: groupValue,\n hasNextPage: i === a.length - 1 && hasNextPage ? groupValue : undefined, // Only add hasNextPage to the last task in the group\n },\n ],\n })) || []\n\n tasks.push(...groupTasks)\n }\n\n // Return the tasks directly as required by the query format\n return {\n data: {\n tasks,\n },\n }\n } catch (error: any) {\n console.error('Error in getGroupedTasksList queryFn:', error)\n return { error: { status: 'FETCH_ERROR', error: error.message } as FetchBaseQueryError }\n }\n },\n providesTags: (result, _e, { projectName }) =>\n getOverviewTaskTags(result?.tasks, projectName),\n }),\n }),\n})\n\nexport const {\n useGetOverviewTasksByFoldersQuery,\n useGetSearchFoldersQuery,\n useGetTasksListQuery,\n useGetTasksListInfiniteInfiniteQuery,\n useLazyGetTasksByParentQuery,\n useGetGroupedTasksListQuery,\n} = injectedApi\nexport default injectedApi\n"],"names":["parseAllAttribs","allAttrib","transformFilteredEntitiesByParent","response","tasks","taskNode","getOverviewTaskTags","result","projectName","parentIds","taskTags","task","parentTags","id","enhancedApi","gqlApi","_e","foldersApiEnhanced","foldersApi","TASKS_INFINITE_QUERY_COUNT","injectedApi","build","filter","folderFilter","search","dispatch","forced","allTasks","batchParentIds","batchTasks","parentId","r","e","rest","currentArg","previousArg","cacheDataLoaded","cacheEntryRemoved","updateCachedData","token","pendingTaskIds","MAX_BATCH","INTERVAL","scheduled","schedule","flush","batchIds","returned","returnedMap","t","draft","idx","err","handlePubSub","_topic","message","taskId","PubSub","folderSearchRequest","lastPage","_allPages","lastPageParam","_allPageParams","pageInfo","queryArg","pageParam","api","folderIds","sortBy","desc","cursor","queryParams","fallback","p","arg","located","page","groups","groupCount","promises","group","count","promise","res","groupValue","hasNextPage","groupTasks","i","a","error","useGetOverviewTasksByFoldersQuery","useGetSearchFoldersQuery","useGetTasksListQuery","useGetTasksListInfiniteInfiniteQuery","useLazyGetTasksByParentQuery","useGetGroupedTasksListQuery"],"mappings":"q0DAkBaA,EAAmBC,GAAsB,CACpD,GAAI,CACF,OAAO,KAAK,MAAMA,CAAS,CAC7B,MAAY,CACV,MAAO,CAAA,CACT,CACF,EAEMC,EAAqCC,GAAsD,CAC/F,GAAI,CAACA,EAAS,QACZ,MAAO,CAAA,EAGT,MAAMC,EAA0B,CAAA,EAChC,SAAW,CAAE,KAAMC,CAAA,IAAcF,EAAS,QAAQ,MAAM,MACtDC,EAAM,KAAK,CACT,GAAGC,EACH,SAAUA,EAAS,UAAY,OAC/B,OAAQL,EAAgBK,EAAS,SAAS,EAC1C,SAAUA,EAAS,GACnB,WAAY,OACZ,MAAO,CAAA,CAAC,CACT,EAGH,OAAOD,CACT,EAEME,EAAsB,CAC1BC,EAAuC,GACvCC,EACAC,IACG,CACH,MAAMC,EAAWH,GAAQ,IAAKI,IAAU,CAAE,KAAM,eAAgB,GAAIA,EAAK,EAAA,EAAK,GAAK,CAAA,EAE7EC,EAAaH,GACd,MAAM,QAAQA,CAAS,EAAIA,EAAY,CAACA,CAAS,GAAG,IAAKI,IAAQ,CAChE,KAAM,eACN,GAAAA,CAAA,EACA,EACF,CAAA,EAEJ,MAAO,CACL,GAAGH,EACH,GAAGE,EACH,CAAE,KAAM,eAAgB,GAAIJ,CAAA,EAC5B,CAAE,KAAM,eAAgB,GAAI,MAAA,CAAO,CAEvC,EA8CMM,EAAcC,EAAAA,IAAO,iBAA+C,CACxE,UAAW,CAIT,iBAAkB,CAChB,kBAAmBb,EACnB,aAAc,CAACK,EAAQS,EAAI,CA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Q,CACxB,GAAI4E,EAAI,MAAO,MAAMA,EAAI,MAGzB,MAAMC,EAAaD,EAAI,cAAc,MAE/BE,EACJF,EAAI,MAAM,UAAU,aAAeA,EAAI,MAAM,UAAU,iBAAmB,GACtEG,EACJH,EAAI,MAAM,MAAM,IAAI,CAACxE,EAAM4E,EAAGC,KAAO,CACnC,GAAG7E,EACH,OAAQ,CACN,CACE,MAAOyE,EACP,YAAaG,IAAMC,EAAE,OAAS,GAAKH,EAAcD,EAAa,MAAA,CAChE,CACF,EACA,GAAK,CAAA,EAEThF,EAAM,KAAK,GAAGkF,CAAU,CAC1B,CAGA,MAAO,CACL,KAAM,CACJ,MAAAlF,CAAA,CACF,CAEJ,OAASqF,EAAY,CACnB,eAAQ,MAAM,wCAAyCA,CAAK,EACrD,CAAE,MAAO,CAAE,OAAQ,cAAe,MAAOA,EAAM,QAAQ,CAChE,CACF,EACA,aAAc,CAAClF,EAAQS,EAAI,CAAE,YAAAR,KAC3BF,EAAoBC,GAAQ,MAAOC,CAAW,CAAA,CACjD,CAAA,EAEL,CAAC,EAEY,CACX,kCAAAkF,EACA,yBAAAC,EACA,qBAAAC,EACA,qCAAAC,EACA,6BAAAC,EACA,4BAAAC,CACF,EAAI3E"}
|
|
@@ -100,13 +100,13 @@ const x = (c) => {
|
|
|
100
100
|
// When new folders are expanded, the new tasks are fetched and we use the cache for the rest
|
|
101
101
|
// This also solves the pagination issue of getting all tasks in one query, splitting it up in multiple queries to avoid pagination limits
|
|
102
102
|
getOverviewTasksByFolders: c.query({
|
|
103
|
-
async queryFn({ projectName: t, parentIds: e, filter: r, folderFilter: a, search: n }, { dispatch:
|
|
103
|
+
async queryFn({ projectName: t, parentIds: e, filter: r, folderFilter: a, search: n }, { dispatch: h, forced: m }) {
|
|
104
104
|
try {
|
|
105
|
-
const
|
|
106
|
-
for (let
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
async (i) =>
|
|
105
|
+
const y = [];
|
|
106
|
+
for (let o = 0; o < e.length; o += 20) {
|
|
107
|
+
const g = e.slice(o, o + 20), s = (await Promise.all(
|
|
108
|
+
g.map(
|
|
109
|
+
async (i) => h(
|
|
110
110
|
R.endpoints.GetTasksByParent.initiate(
|
|
111
111
|
{
|
|
112
112
|
projectName: t,
|
|
@@ -120,11 +120,11 @@ const x = (c) => {
|
|
|
120
120
|
)
|
|
121
121
|
)
|
|
122
122
|
)).filter((i) => !!i.data).flatMap((i) => i.data);
|
|
123
|
-
|
|
123
|
+
y.push(...s);
|
|
124
124
|
}
|
|
125
|
-
return { data:
|
|
126
|
-
} catch (
|
|
127
|
-
return console.error(
|
|
125
|
+
return { data: y };
|
|
126
|
+
} catch (I) {
|
|
127
|
+
return console.error(I), { error: { status: "FETCH_ERROR", error: I.message } };
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
130
|
// keep one cache per project
|
|
@@ -136,53 +136,53 @@ const x = (c) => {
|
|
|
136
136
|
return JSON.stringify(t) !== JSON.stringify(e);
|
|
137
137
|
},
|
|
138
138
|
providesTags: (t, e, { parentIds: r, projectName: a }) => A(t, a, r),
|
|
139
|
-
async onCacheEntryAdded({ projectName: t, parentIds: e, filter: r, search: a }, { cacheDataLoaded: n, cacheEntryRemoved:
|
|
140
|
-
let
|
|
141
|
-
const
|
|
142
|
-
let
|
|
139
|
+
async onCacheEntryAdded({ projectName: t, parentIds: e, filter: r, search: a }, { cacheDataLoaded: n, cacheEntryRemoved: h, updateCachedData: m, dispatch: I }) {
|
|
140
|
+
let y;
|
|
141
|
+
const o = /* @__PURE__ */ new Set(), g = 100, p = 500;
|
|
142
|
+
let s = !1;
|
|
143
143
|
const i = () => {
|
|
144
|
-
|
|
145
|
-
},
|
|
146
|
-
if (
|
|
147
|
-
const
|
|
148
|
-
|
|
144
|
+
s || (s = !0, setTimeout(k, p));
|
|
145
|
+
}, k = async () => {
|
|
146
|
+
if (s = !1, !o.size) return;
|
|
147
|
+
const f = Array.from(o).slice(0, g);
|
|
148
|
+
f.forEach((u) => o.delete(u));
|
|
149
149
|
try {
|
|
150
|
-
const l = (await
|
|
150
|
+
const l = (await I(
|
|
151
151
|
R.endpoints.GetTasksList.initiate(
|
|
152
152
|
{
|
|
153
153
|
projectName: t,
|
|
154
|
-
taskIds:
|
|
154
|
+
taskIds: f
|
|
155
155
|
},
|
|
156
156
|
{ forceRefetch: !0 }
|
|
157
157
|
)
|
|
158
|
-
).unwrap()).tasks || [],
|
|
159
|
-
m((
|
|
160
|
-
for (const
|
|
161
|
-
const v =
|
|
162
|
-
v > -1 ?
|
|
158
|
+
).unwrap()).tasks || [], T = new Map(l.map((d) => [d.id, d]));
|
|
159
|
+
m((d) => {
|
|
160
|
+
for (const P of l) {
|
|
161
|
+
const v = d.findIndex((w) => w.id === P.id);
|
|
162
|
+
v > -1 ? d[v] = P : d.push(P);
|
|
163
163
|
}
|
|
164
|
-
for (const
|
|
165
|
-
if (!
|
|
166
|
-
const v =
|
|
167
|
-
v > -1 &&
|
|
164
|
+
for (const P of f)
|
|
165
|
+
if (!T.has(P)) {
|
|
166
|
+
const v = d.findIndex((w) => w.id === P);
|
|
167
|
+
v > -1 && d.splice(v, 1);
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
|
-
} catch (
|
|
171
|
-
console.error("Realtime overview batch update failed",
|
|
170
|
+
} catch (u) {
|
|
171
|
+
console.error("Realtime overview batch update failed", u);
|
|
172
172
|
} finally {
|
|
173
|
-
|
|
173
|
+
o.size && i();
|
|
174
174
|
}
|
|
175
175
|
};
|
|
176
176
|
try {
|
|
177
177
|
await n;
|
|
178
|
-
const
|
|
179
|
-
const
|
|
180
|
-
!
|
|
178
|
+
const f = async (u, l) => {
|
|
179
|
+
const T = l?.summary?.entityId, d = l?.summary?.parentId;
|
|
180
|
+
!T || !d || e.includes(d) && (o.add(T), i());
|
|
181
181
|
};
|
|
182
|
-
|
|
182
|
+
y = b.subscribe("entity.task", f);
|
|
183
183
|
} catch {
|
|
184
184
|
}
|
|
185
|
-
await
|
|
185
|
+
await h, y && b.unsubscribe(y);
|
|
186
186
|
}
|
|
187
187
|
}),
|
|
188
188
|
// searchFolders is a post so it's a bit annoying to consume
|
|
@@ -217,18 +217,18 @@ const x = (c) => {
|
|
|
217
217
|
},
|
|
218
218
|
queryFn: async ({ queryArg: t, pageParam: e }, r) => {
|
|
219
219
|
try {
|
|
220
|
-
const { projectName: a, filter: n, folderFilter:
|
|
220
|
+
const { projectName: a, filter: n, folderFilter: h, search: m, folderIds: I, sortBy: y, desc: o } = t, { cursor: g } = e, p = {
|
|
221
221
|
projectName: a,
|
|
222
222
|
filter: n,
|
|
223
|
-
folderFilter:
|
|
223
|
+
folderFilter: h,
|
|
224
224
|
search: m,
|
|
225
|
-
folderIds:
|
|
225
|
+
folderIds: I
|
|
226
226
|
};
|
|
227
|
-
|
|
228
|
-
const
|
|
229
|
-
R.endpoints.GetTasksList.initiate(
|
|
227
|
+
y ? (p.sortBy = y, o ? (p.before = g || void 0, p.last = E) : (p.after = g || void 0, p.first = E)) : (p.after = g || void 0, p.first = E);
|
|
228
|
+
const s = await r.dispatch(
|
|
229
|
+
R.endpoints.GetTasksList.initiate(p, { forceRefetch: !0 })
|
|
230
230
|
);
|
|
231
|
-
if (
|
|
231
|
+
if (s.error) throw s.error;
|
|
232
232
|
const i = {
|
|
233
233
|
tasks: [],
|
|
234
234
|
pageInfo: {
|
|
@@ -239,7 +239,7 @@ const x = (c) => {
|
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
241
|
return {
|
|
242
|
-
data:
|
|
242
|
+
data: s.data || i
|
|
243
243
|
};
|
|
244
244
|
} catch (a) {
|
|
245
245
|
return console.error("Error in getTasksListInfinite queryFn:", a), { error: { status: "FETCH_ERROR", error: a.message } };
|
|
@@ -247,37 +247,37 @@ const x = (c) => {
|
|
|
247
247
|
},
|
|
248
248
|
providesTags: (t, e, { projectName: r }) => A(t?.pages.flatMap((a) => a.tasks) || [], r),
|
|
249
249
|
async onCacheEntryAdded(t, { cacheDataLoaded: e, cacheEntryRemoved: r, updateCachedData: a, dispatch: n }) {
|
|
250
|
-
let
|
|
251
|
-
const m = /* @__PURE__ */ new Set(),
|
|
252
|
-
let
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
},
|
|
256
|
-
if (
|
|
257
|
-
const
|
|
258
|
-
|
|
250
|
+
let h;
|
|
251
|
+
const m = /* @__PURE__ */ new Set(), I = 100, y = 500;
|
|
252
|
+
let o = !1;
|
|
253
|
+
const g = () => {
|
|
254
|
+
o || (o = !0, setTimeout(p, y));
|
|
255
|
+
}, p = async () => {
|
|
256
|
+
if (o = !1, !m.size) return;
|
|
257
|
+
const s = Array.from(m).slice(0, I);
|
|
258
|
+
s.forEach((i) => m.delete(i));
|
|
259
259
|
try {
|
|
260
|
-
const
|
|
260
|
+
const k = (await n(
|
|
261
261
|
R.endpoints.GetTasksList.initiate(
|
|
262
262
|
{
|
|
263
263
|
projectName: t.projectName,
|
|
264
|
-
taskIds:
|
|
264
|
+
taskIds: s,
|
|
265
265
|
folderIds: t.folderIds
|
|
266
266
|
},
|
|
267
267
|
{ forceRefetch: !0 }
|
|
268
268
|
)
|
|
269
|
-
).unwrap()).tasks || [],
|
|
270
|
-
a((
|
|
271
|
-
for (const l of
|
|
272
|
-
let
|
|
273
|
-
for (const
|
|
274
|
-
const
|
|
275
|
-
if (
|
|
276
|
-
|
|
269
|
+
).unwrap()).tasks || [], f = new Map(k.map((u) => [u.id, u]));
|
|
270
|
+
a((u) => {
|
|
271
|
+
for (const l of k) {
|
|
272
|
+
let T = !1;
|
|
273
|
+
for (const d of u.pages) {
|
|
274
|
+
const P = d.tasks.findIndex((v) => v.id === l.id);
|
|
275
|
+
if (P !== -1) {
|
|
276
|
+
d.tasks[P] = l, T = !0;
|
|
277
277
|
break;
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
|
-
|
|
280
|
+
T || (u.pages.length ? u.pages[0].tasks.unshift(l) : u.pages.push({
|
|
281
281
|
tasks: [l],
|
|
282
282
|
pageInfo: {
|
|
283
283
|
startCursor: null,
|
|
@@ -287,12 +287,12 @@ const x = (c) => {
|
|
|
287
287
|
}
|
|
288
288
|
}));
|
|
289
289
|
}
|
|
290
|
-
for (const l of
|
|
291
|
-
if (!
|
|
292
|
-
for (const
|
|
293
|
-
const
|
|
294
|
-
if (
|
|
295
|
-
|
|
290
|
+
for (const l of s)
|
|
291
|
+
if (!f.has(l))
|
|
292
|
+
for (const T of u.pages) {
|
|
293
|
+
const d = T.tasks.findIndex((P) => P.id === l);
|
|
294
|
+
if (d !== -1) {
|
|
295
|
+
T.tasks.splice(d, 1);
|
|
296
296
|
break;
|
|
297
297
|
}
|
|
298
298
|
}
|
|
@@ -300,27 +300,27 @@ const x = (c) => {
|
|
|
300
300
|
} catch (i) {
|
|
301
301
|
console.error("Realtime infinite tasks batch update failed", i);
|
|
302
302
|
} finally {
|
|
303
|
-
m.size &&
|
|
303
|
+
m.size && g();
|
|
304
304
|
}
|
|
305
305
|
};
|
|
306
306
|
try {
|
|
307
307
|
await e;
|
|
308
|
-
const
|
|
309
|
-
const
|
|
310
|
-
|
|
308
|
+
const s = async (i, k) => {
|
|
309
|
+
const f = k?.summary?.entityId;
|
|
310
|
+
f && (m.add(f), g());
|
|
311
311
|
};
|
|
312
|
-
|
|
312
|
+
h = b.subscribe("entity.task", s);
|
|
313
313
|
} catch {
|
|
314
314
|
}
|
|
315
|
-
await r,
|
|
315
|
+
await r, h && b.unsubscribe(h);
|
|
316
316
|
}
|
|
317
317
|
}),
|
|
318
318
|
getGroupedTasksList: c.query({
|
|
319
|
-
queryFn: async ({ projectName: t, groups: e, search: r, folderFilter: a, folderIds: n, desc:
|
|
319
|
+
queryFn: async ({ projectName: t, groups: e, search: r, folderFilter: a, folderIds: n, desc: h, sortBy: m, groupCount: I }, y) => {
|
|
320
320
|
try {
|
|
321
|
-
let
|
|
321
|
+
let o = [];
|
|
322
322
|
for (const s of e) {
|
|
323
|
-
const
|
|
323
|
+
const i = I || s.count || 500, k = {
|
|
324
324
|
projectName: t,
|
|
325
325
|
filter: s.filter,
|
|
326
326
|
folderFilter: a,
|
|
@@ -331,34 +331,34 @@ const x = (c) => {
|
|
|
331
331
|
// @ts-expect-error - we know group does not exist on query variables but we need it for later
|
|
332
332
|
group: s.value
|
|
333
333
|
};
|
|
334
|
-
|
|
335
|
-
const
|
|
336
|
-
R.endpoints.GetTasksList.initiate(
|
|
334
|
+
h ? k.last = i : k.first = i;
|
|
335
|
+
const f = y.dispatch(
|
|
336
|
+
R.endpoints.GetTasksList.initiate(k, { forceRefetch: !0 })
|
|
337
337
|
);
|
|
338
|
-
|
|
338
|
+
o.push(f);
|
|
339
339
|
}
|
|
340
|
-
const
|
|
341
|
-
for (const s of
|
|
340
|
+
const g = await Promise.all(o), p = [];
|
|
341
|
+
for (const s of g) {
|
|
342
342
|
if (s.error) throw s.error;
|
|
343
|
-
const
|
|
344
|
-
...
|
|
343
|
+
const i = s.originalArgs?.group, k = s.data?.pageInfo?.hasNextPage || s.data?.pageInfo?.hasPreviousPage || !1, f = s.data?.tasks.map((u, l, T) => ({
|
|
344
|
+
...u,
|
|
345
345
|
groups: [
|
|
346
346
|
{
|
|
347
|
-
value:
|
|
348
|
-
hasNextPage:
|
|
347
|
+
value: i,
|
|
348
|
+
hasNextPage: l === T.length - 1 && k ? i : void 0
|
|
349
349
|
// Only add hasNextPage to the last task in the group
|
|
350
350
|
}
|
|
351
351
|
]
|
|
352
352
|
})) || [];
|
|
353
|
-
|
|
353
|
+
p.push(...f);
|
|
354
354
|
}
|
|
355
355
|
return {
|
|
356
356
|
data: {
|
|
357
|
-
tasks:
|
|
357
|
+
tasks: p
|
|
358
358
|
}
|
|
359
359
|
};
|
|
360
|
-
} catch (
|
|
361
|
-
return console.error("Error in getGroupedTasksList queryFn:",
|
|
360
|
+
} catch (o) {
|
|
361
|
+
return console.error("Error in getGroupedTasksList queryFn:", o), { error: { status: "FETCH_ERROR", error: o.message } };
|
|
362
362
|
}
|
|
363
363
|
},
|
|
364
364
|
providesTags: (t, e, { projectName: r }) => A(t?.tasks, r)
|