@voplus/morpho-workspace 9.0.15 → 9.0.17
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/es/modules/board/components/NewColumnDocumentForm/index.js +5 -4
- package/es/modules/board/components/NewColumnDocumentForm/index.js.map +1 -1
- package/es/modules/my-document/SectionTemplate/GridUI/index.js +33 -33
- package/es/modules/my-document/SectionTemplate/GridUI/index.js.map +1 -1
- package/es/modules/notification/components/NewNotificationForm/index.d.ts +1 -1
- package/es/modules/notification/components/NewNotificationForm/index.js +3 -3
- package/es/modules/notification/components/NewNotificationForm/index.js.map +1 -1
- package/es/modules/notification/components/NotificationItem/index.js.map +1 -0
- package/es/modules/notification/components/NotificationList/index.d.ts +24 -10
- package/es/modules/notification/components/NotificationList/index.js +60 -84
- package/es/modules/notification/components/NotificationList/index.js.map +1 -1
- package/es/modules/notification/components/NotificationListHeader/index.d.ts +15 -6
- package/es/modules/notification/components/NotificationListHeader/index.js +14 -68
- package/es/modules/notification/components/NotificationListHeader/index.js.map +1 -1
- package/es/modules/notification/components/NotificationPropertiesView/index.js +5 -5
- package/es/modules/notification/components/NotificationPropertiesView/index.js.map +1 -1
- package/es/modules/notification/components/NotificationRecipients/index.js +8 -8
- package/es/modules/notification/components/NotificationRecipients/index.js.map +1 -1
- package/es/modules/notification/components/{AllNewNotificationTableItem → NotificationTableItem}/index.d.ts +2 -2
- package/es/modules/notification/components/{AllNewNotificationTableItem → NotificationTableItem}/index.js +2 -2
- package/es/modules/notification/components/NotificationTableItem/index.js.map +1 -0
- package/es/modules/notification/components/{AllNewNotificationList → NotificationTableList}/index.d.ts +7 -6
- package/es/modules/notification/components/{AllNewNotificationTableList → NotificationTableList}/index.js +7 -8
- package/es/modules/notification/components/NotificationTableList/index.js.map +1 -0
- package/es/modules/notification/pages/NotificationListPage/index.d.ts +2 -2
- package/es/modules/notification/pages/NotificationListPage/index.js +2 -2
- package/es/modules/notification/pages/NotificationListPage/index.js.map +1 -1
- package/es/modules/notification-workspace/components/DocumentNotificationCard/NotificationMobileCard.js.map +1 -0
- package/es/modules/notification-workspace/components/DocumentNotificationCard/index.js.map +1 -0
- package/es/modules/notification-workspace/components/DocumentNotificationCard/obsolete.js.map +1 -0
- package/es/modules/notification-workspace/components/NotificationList/index.d.ts +14 -0
- package/es/modules/notification-workspace/components/NotificationList/index.js +102 -0
- package/es/modules/notification-workspace/components/NotificationList/index.js.map +1 -0
- package/es/modules/notification-workspace/components/NotificationList/state.js.map +1 -0
- package/es/modules/notification-workspace/components/NotificationListHeader/index.d.ts +7 -0
- package/es/modules/notification-workspace/components/NotificationListHeader/index.js +76 -0
- package/es/modules/notification-workspace/components/NotificationListHeader/index.js.map +1 -0
- package/es/modules/notification-workspace/components/NotificationTag/index.js.map +1 -0
- package/es/modules/notification-workspace/pages/NotificationListPage/NotificationMobileListPage.js.map +1 -0
- package/es/modules/notification-workspace/pages/NotificationListPage/index.js.map +1 -0
- package/es/modules/work/work-type/components/WorkTypeIconList/index.js +3 -4
- package/es/modules/work/work-type/components/WorkTypeIconList/index.js.map +1 -1
- package/es/modules/workspace/components/CreatedOrDisabledWorkspacesList/index.js +2 -3
- package/es/modules/workspace/components/CreatedOrDisabledWorkspacesList/index.js.map +1 -1
- package/es/modules/workspace/components/SharedWorkspacesList/index.js +2 -3
- package/es/modules/workspace/components/SharedWorkspacesList/index.js.map +1 -1
- package/es/obsolete/space/components/Notifications/index.js +1 -1
- package/es/obsolete/space/components/Notifications/index.js.map +1 -1
- package/package.json +1 -1
- package/es/modules/my-document/SectionTemplate/GridUI/useElementWidth.d.ts +0 -6
- package/es/modules/my-document/SectionTemplate/GridUI/useElementWidth.js +0 -29
- package/es/modules/my-document/SectionTemplate/GridUI/useElementWidth.js.map +0 -1
- package/es/modules/notification/components/AllNewNotificationItem/index.js.map +0 -1
- package/es/modules/notification/components/AllNewNotificationList/index.js +0 -78
- package/es/modules/notification/components/AllNewNotificationList/index.js.map +0 -1
- package/es/modules/notification/components/AllNewNotificationListHeader/index.d.ts +0 -16
- package/es/modules/notification/components/AllNewNotificationListHeader/index.js +0 -23
- package/es/modules/notification/components/AllNewNotificationListHeader/index.js.map +0 -1
- package/es/modules/notification/components/AllNewNotificationTableItem/index.js.map +0 -1
- package/es/modules/notification/components/AllNewNotificationTableList/index.d.ts +0 -29
- package/es/modules/notification/components/AllNewNotificationTableList/index.js.map +0 -1
- package/es/modules/notification/components/DocumentNotificationCard/NotificationMobileCard.js.map +0 -1
- package/es/modules/notification/components/DocumentNotificationCard/index.js.map +0 -1
- package/es/modules/notification/components/DocumentNotificationCard/obsolete.js.map +0 -1
- package/es/modules/notification/components/NotificationList/state.js.map +0 -1
- package/es/modules/notification/components/NotificationTag/index.js.map +0 -1
- package/es/modules/notification/pages/NotificationListPage2/NotificationMobileListPage.js.map +0 -1
- package/es/modules/notification/pages/NotificationListPage2/index.js.map +0 -1
- /package/es/modules/notification/components/{AllNewNotificationItem → NotificationItem}/index.css +0 -0
- /package/es/modules/notification/components/{AllNewNotificationItem → NotificationItem}/index.d.ts +0 -0
- /package/es/modules/notification/components/{AllNewNotificationItem → NotificationItem}/index.js +0 -0
- /package/es/modules/notification/components/{AllNewNotificationTableItem → NotificationTableItem}/index.css +0 -0
- /package/es/modules/notification/components/{AllNewNotificationTableList → NotificationTableList}/index.css +0 -0
- /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/NotificationMobileCard.d.ts +0 -0
- /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/NotificationMobileCard.js +0 -0
- /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/index.css +0 -0
- /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/index.d.ts +0 -0
- /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/index.js +0 -0
- /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/obsolete.d.ts +0 -0
- /package/es/modules/{notification → notification-workspace}/components/DocumentNotificationCard/obsolete.js +0 -0
- /package/es/modules/{notification → notification-workspace}/components/NotificationList/index.css +0 -0
- /package/es/modules/{notification → notification-workspace}/components/NotificationList/state.d.ts +0 -0
- /package/es/modules/{notification → notification-workspace}/components/NotificationList/state.js +0 -0
- /package/es/modules/{notification → notification-workspace}/components/NotificationTag/index.d.ts +0 -0
- /package/es/modules/{notification → notification-workspace}/components/NotificationTag/index.js +0 -0
- /package/es/modules/{notification → notification-workspace}/components/NotificationTag/index.less +0 -0
- /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/NotificationMobileListPage.d.ts +0 -0
- /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/NotificationMobileListPage.js +0 -0
- /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/index.d.ts +0 -0
- /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/index.js +0 -0
- /package/es/modules/{notification/pages/NotificationListPage2 → notification-workspace/pages/NotificationListPage}/index.less +0 -0
|
@@ -6,17 +6,18 @@ import { useDocumentStore, useMetaStore } from "@voplus/morpho-document-core";
|
|
|
6
6
|
import { State } from "@voplus/morpho-document/es/components/NewDocumentForm/state";
|
|
7
7
|
import AddFormView from "@voplus/morpho-ui/es/controls/AddFormView";
|
|
8
8
|
const NewColumnDocumentForm = (props) => {
|
|
9
|
-
const {
|
|
9
|
+
const { columnName } = props;
|
|
10
10
|
const { user } = useApplicationContext();
|
|
11
11
|
const store = useDocumentStore();
|
|
12
12
|
const meta = useMetaStore();
|
|
13
13
|
const [state] = useState(new State(store, user));
|
|
14
14
|
const [createData, setCreateData] = useState();
|
|
15
15
|
state.parentId = props.parentId;
|
|
16
|
-
|
|
16
|
+
state.type = props.type;
|
|
17
|
+
return observe(() => (React.createElement(AddFormView, { title: `Add ${state.type} in ${columnName}`, onCancel: onCancel, onSubmit: () => state.onSubmit(createData).then(() => onCancel()) }, /^(Deal|Quotation|Form|Case|CLDA)$/.test(state.type) ? (React.createElement("div", null, state.type &&
|
|
17
18
|
meta.getNewForm({
|
|
18
19
|
id: "",
|
|
19
|
-
type: type,
|
|
20
|
+
type: state.type,
|
|
20
21
|
}, {
|
|
21
22
|
type: "mini",
|
|
22
23
|
onCancel: onCancel,
|
|
@@ -25,7 +26,7 @@ const NewColumnDocumentForm = (props) => {
|
|
|
25
26
|
React.createElement(Form.Item, null,
|
|
26
27
|
React.createElement(Spin, { spinning: !!state.loading },
|
|
27
28
|
React.createElement("div", { className: "form-item-layout" },
|
|
28
|
-
React.createElement(Input, { autoFocus: true, placeholder: `Add a ${type === "Document" ? "Folder" : type} for state Document`, onChange: (e) => setCreateData({ Name: e.target.value }) })))))))));
|
|
29
|
+
React.createElement(Input, { autoFocus: true, placeholder: `Add a ${state.type === "Document" ? "Folder" : state.type} for state Document`, onChange: (e) => setCreateData({ Name: e.target.value }) })))))))));
|
|
29
30
|
function onCancel() {
|
|
30
31
|
var _a;
|
|
31
32
|
setCreateData(undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/board/components/NewColumnDocumentForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,6DAA6D,CAAC;AACpF,OAAO,WAAW,MAAM,2CAA2C,CAAC;AAEpE,MAAM,qBAAqB,GAAG,CAAC,KAK9B,EAAE,EAAE;IACJ,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceR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AG,EAAE,CAAC,QAAQ,EAAE,CAAC,IAEhE,mCAAmC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CACvD,iCACE,KAAK,CAAC,IAAI;QACV,IAAI,CAAC,UAAU,CACd;YACC,EAAE,EAAE,EAAE;YACN,IAAI,EAAE,KAAK,CAAC,IAAI;SAChB,EACD;YACC,IAAI,EAAE,MAAM;YACZ,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC;SACvC,CACD,CACG,CACN,CAAC,CAAC,CAAC,CACH,oBAAC,IAAI,IAAC,MAAM,EAAC,UAAU;QACtB,oBAAC,IAAI,CAAC,IAAI;YACT,oBAAC,IAAI,IAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO;gBAC9B,6BAAK,SAAS,EAAC,kBAAkB;oBAChC,oBAAC,KAAK,IACL,SAAS,QACT,WAAW,EAAE,SACZ,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,IAC9C,qBAAqB,EACrB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,GACvD,CACG,CACA,CACI,CACN,CACP,CACY,CACd,CAAC,CAAC;IAEH,SAAS,QAAQ;;QAChB,aAAa,CAAC,SAAS,CAAC,CAAC;QACzB,MAAA,KAAK,CAAC,QAAQ,qDAAI,CAAC;IACpB,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import { observe } from "@voplus/morpho-ui";
|
|
3
3
|
import { Skeleton, Pagination } from "antd";
|
|
4
|
-
import { useElementWidth } from "./useElementWidth";
|
|
5
4
|
import { useApplicationContext } from "@voplus/morpho-data";
|
|
6
5
|
import { FontAwesomeIcon as FAIcon, faFolderOpenSolid } from "@voplus/morpho-ui/es/faIcons";
|
|
7
6
|
import { Restore, Open, Versions, Download, } from "@voplus/morpho-document/es/controls/DocumentToolbar/buttons";
|
|
8
7
|
import { useMetaStore, useDocumentStore } from "@voplus/morpho-document-core";
|
|
8
|
+
import ResponsiveGridContainer from "@voplus/morpho-ui/es/controls/ResponsiveGrid/ResponsiveGridContainer";
|
|
9
9
|
import DocumentDataIconBar from "@voplus/morpho-document/es/controls/DocumentDataIconBar";
|
|
10
10
|
import DocumentToolbar from "@voplus/morpho-document/es/controls/DocumentToolbar";
|
|
11
|
+
import GridColumn from "@voplus/morpho-ui/es/controls/ResponsiveGrid/GridColumn";
|
|
11
12
|
import MentionList from "@voplus/morpho-org/es/controls/MentionList";
|
|
12
13
|
import TagView from "@voplus/morpho-org/es/modules/tag/TagView";
|
|
13
14
|
const GridView = (props) => {
|
|
@@ -15,37 +16,36 @@ const GridView = (props) => {
|
|
|
15
16
|
const { user } = useApplicationContext();
|
|
16
17
|
const meta = useMetaStore();
|
|
17
18
|
const store = useDocumentStore();
|
|
18
|
-
const [currentPage, setCurrentPage] =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
React.createElement("
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
React.createElement(
|
|
47
|
-
|
|
48
|
-
React.createElement("p", { className: "text-slate-600" }, "Try adjusting your filters or create a new document."))))));
|
|
19
|
+
const [currentPage, setCurrentPage] = useState(1);
|
|
20
|
+
return observe(() => (React.createElement(ResponsiveGridContainer, { breakpoints: { xl: 4, lg: 4, md: 3, sm: 2, xs: 2 } }, ({ cols }) => {
|
|
21
|
+
return (React.createElement(Skeleton, { loading: list.loading, active: true, paragraph: { rows: 3 } }, list.data.length > 0 ? (React.createElement(React.Fragment, null,
|
|
22
|
+
React.createElement(GridColumn, { cols: cols }, list.data.map((doc) => (React.createElement("div", { key: doc.id, onClick: () => { var _a; return (_a = props.onItemClick) === null || _a === void 0 ? void 0 : _a.call(props, doc.id); }, className: "group relative bg-white border rounded-lg p-4 hover:shadow-md transition-all cursor-pointer border-slate-200" },
|
|
23
|
+
React.createElement("div", { className: "absolute top-2 right-2" },
|
|
24
|
+
React.createElement(DocumentToolbar, { id: doc.id },
|
|
25
|
+
React.createElement(Open, { url: meta.getRoute(doc) }),
|
|
26
|
+
doc.status === "Archived" && React.createElement(Restore, null),
|
|
27
|
+
React.createElement(Versions, null),
|
|
28
|
+
doc.type === "File" && React.createElement(Download, null))),
|
|
29
|
+
React.createElement("div", { className: "flex items-start gap-3" },
|
|
30
|
+
React.createElement("div", { className: "flex-shrink-0 text-slate-500 text-xl" }, meta.getIcon(doc)),
|
|
31
|
+
React.createElement("div", { className: "flex-1 min-w-0" },
|
|
32
|
+
React.createElement("h3", { className: "font-semibold text-slate-900 truncate group-hover:text-blue-600 transition-colors" }, doc.name),
|
|
33
|
+
React.createElement("div", { className: "mt-2 flex flex-wrap items-center! gap-2 text-xs text-slate-500" },
|
|
34
|
+
React.createElement(MentionList, { contacts: doc.createdBy ? [doc.createdBy] : [], placeholder: "no Data", canEdit: false }),
|
|
35
|
+
React.createElement("div", null,
|
|
36
|
+
React.createElement(DocumentDataIconBar, { id: doc.id }))),
|
|
37
|
+
React.createElement(TagView, { id: doc.id, tags: doc.tags, items: store.items, editable: user.can("edit", doc.p, { asset: "Tags" }) && !doc.readonly }))))))),
|
|
38
|
+
React.createElement("div", { className: "flex justify-end mt-4" },
|
|
39
|
+
React.createElement(Pagination, { current: currentPage, total: total, pageSize: 10, onChange: (newPage, newPageSize) => {
|
|
40
|
+
var _a;
|
|
41
|
+
setCurrentPage(newPage);
|
|
42
|
+
(_a = props.onPageChange) === null || _a === void 0 ? void 0 : _a.call(props, newPage, newPageSize);
|
|
43
|
+
} })))) : (React.createElement("div", { className: "text-center py-12" },
|
|
44
|
+
React.createElement("div", { className: "mb-4" },
|
|
45
|
+
React.createElement(FAIcon, { icon: faFolderOpenSolid, className: "text-slate-300 text-6xl" })),
|
|
46
|
+
React.createElement("h3", { className: "text-lg font-semibold text-slate-900 mb-2" }, "No documents found"),
|
|
47
|
+
React.createElement("p", { className: "text-slate-600" }, "Try adjusting your filters or create a new document.")))));
|
|
48
|
+
})));
|
|
49
49
|
};
|
|
50
50
|
export default GridView;
|
|
51
51
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/my-document/SectionTemplate/GridUI/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/my-document/SectionTemplate/GridUI/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAC5F,OAAO,EACN,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,QAAQ,GACR,MAAM,6DAA6D,CAAC;AAErE,OAAO,EAAa,YAAY,EAAE,gBAAgB,EAAE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Q,GACpE,CACG,CACD,CACD,CACN,CAAC,CACU;YAEb,6BAAK,SAAS,EAAC,uBAAuB;gBACrC,oBAAC,UAAU,IACV,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,EAAE,EACZ,QAAQ,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,EAAE;;wBAClC,cAAc,CAAC,OAAO,CAAC,CAAC;wBACxB,MAAA,KAAK,CAAC,YAAY,sDAAG,OAAO,EAAE,WAAW,CAAC,CAAC;oBAC5C,CAAC,GACA,CACG,CACJ,CACH,CAAC,CAAC,CAAC,CACH,6BAAK,SAAS,EAAC,mBAAmB;YACjC,6BAAK,SAAS,EAAC,MAAM;gBACpB,oBAAC,MAAM,IAAC,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAC,yBAAyB,GAAG,CAClE;YACN,4BAAI,SAAS,EAAC,2CAA2C,yBAAwB;YACjF,2BAAG,SAAS,EAAC,gBAAgB,2DAEzB,CACC,CACN,CACS,CACX,CAAC;IACH,CAAC,CACwB,CAC1B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { NewNotificationFormProps } from "./NotificationForm";
|
|
2
1
|
import React from "react";
|
|
2
|
+
import { NewNotificationFormProps } from "./NotificationForm";
|
|
3
3
|
declare const NewNotificationFormDialog: {
|
|
4
4
|
(props: NewNotificationFormProps): React.JSX.Element;
|
|
5
5
|
defaultProps: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Content from "./NotificationForm";
|
|
2
|
-
import { observe } from "@voplus/morpho-ui";
|
|
3
|
-
import { Modal } from "antd";
|
|
4
1
|
import React from "react";
|
|
2
|
+
import { Modal } from "antd";
|
|
3
|
+
import { observe } from "@voplus/morpho-ui";
|
|
4
|
+
import Content from "./NotificationForm";
|
|
5
5
|
const NewNotificationFormDialog = (props) => {
|
|
6
6
|
return observe(() => (React.createElement(Modal, { title: "New Notification Form Dialog", open: true, closable: false, footer: null, onCancel: props.onCancel },
|
|
7
7
|
React.createElement(Content, { ...props }))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NewNotificationForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NewNotificationForm/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,OAAqC,MAAM,oBAAoB,CAAC;AAEvE,MAAM,yBAAyB,GAAG,CAAC,KAA+B,EAAE,EAAE;IACrE,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,KAAK,IACL,KAAK,EAAC,8BAA8B,EACpC,IAAI,QACJ,QAAQ,EAAE,KAAK,EACf,MAAM,EAAE,IAAI,EACZ,QAAQ,EAAE,KAAK,CAAC,QAAQ;QAExB,oBAAC,OAAO,OAAK,KAAK,GAAI,CACf,CACR,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,yBAAyB,CAAC,YAAY,GAAG;IACxC,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,IAAI;CAChB,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationItem/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,I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EAAC,0BAA0B,EACpC,QAAQ,EAAE,KAAK,EACf,IAAI,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,GAC3D,CACa;YAChB,oBAAC,aAAa,IAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAC,MAAM;gBACnC,oBAAC,YAAY,IAAC,KAAK,EAAE,YAAY,CAAC,UAAU,EAAE,MAAM,EAAC,aAAa,GAAG,CACtD;YAChB,oBAAC,aAAa,IAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,OAAO,IAAI,QAAQ,EAAE,KAAK,EAAC,UAAU,IACnE,OAAO,CAAC,CAAC,CAAC,CACV,oBAAC,OAAO,IAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE;gBAC/B,oBAAC,IAAI,IAAC,GAAG,EAAE,MAAM,CAAC,uBAAuB,CAAC,MAAM,CAAC,EAAE,CAAC,GAAI;gBACvD,YAAY,CAAC,KAAK,IAAI,oBAAC,gBAAgB,IAAC,EAAE,EAAE,EAAE,EAAE,UAAU,EAAE,IAAI,GAAI,CAC5D,CACV,CAAC,CAAC,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CACxB,oBAAC,GAAG,IAAC,SAAS,EAAC,qBAAqB,EAAC,KAAK,EAAC,SAAS,YAE9C,CACN,CAAC,CAAC,CAAC,IAAI,CACO,CACJ,CACC,CACf,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
import "./index.css";
|
|
2
|
+
import { FilterOption } from "@voplus/morpho-data";
|
|
4
3
|
export type NotificationListProps = {
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
/** 需要 corporate 或者 customer id */
|
|
5
|
+
parentId: string;
|
|
6
|
+
/** 如传入 unit 是 Organization, 并且 mainContacts 有内容, Recipients 会自动显示 mainContacts 的内容 */
|
|
7
|
+
unitForRecipients?: {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
};
|
|
11
|
+
defaultTemplate?: {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
body: string;
|
|
15
|
+
};
|
|
16
|
+
/** 是否允在 listView 内部打开 aside */
|
|
17
|
+
asideable?: boolean;
|
|
18
|
+
filterOptions?: FilterOption[];
|
|
19
|
+
/** Call back when received total number of All New Notification. */
|
|
20
|
+
onTotal?: (total: number) => void;
|
|
21
|
+
};
|
|
22
|
+
declare const NotificationList: {
|
|
23
|
+
(props: NotificationListProps): React.JSX.Element;
|
|
24
|
+
defaultProps: {
|
|
25
|
+
asideable: boolean;
|
|
26
|
+
};
|
|
12
27
|
};
|
|
13
|
-
declare const NotificationList: (props: NotificationListProps) => React.JSX.Element;
|
|
14
28
|
export default NotificationList;
|
|
@@ -1,102 +1,78 @@
|
|
|
1
|
-
import React, { useEffect, useState
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
|
+
import { useAutoUpdateListData, useNotificationListEffect, } from "../../../../data/notification";
|
|
3
|
+
import { useUnitStore } from "@voplus/morpho-org";
|
|
4
4
|
import { observe, useRenderOnChange } from "@voplus/morpho-ui";
|
|
5
|
-
import { message, Alert } from "antd";
|
|
6
5
|
import { useApplicationContext } from "@voplus/morpho-data";
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import Viewer from "@voplus/morpho-text/es/controls/ProseMirror/Viewer";
|
|
13
|
-
import NodePropertiesView from "@voplus/morpho-document-core/es/components/NodePropertiesView";
|
|
14
|
-
import { NotificationListContext, NotificationListState } from "./state";
|
|
15
|
-
import { useUnit } from "@voplus/morpho-org/es/data";
|
|
16
|
-
import S from "string";
|
|
17
|
-
import "./index.css";
|
|
6
|
+
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data/ListDataContext";
|
|
7
|
+
import { useViewLayoutContext } from "@voplus/morpho-ui/es/components/layout/DefaultViewLayout/ViewLayoutContext";
|
|
8
|
+
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView";
|
|
9
|
+
import NotificationForm from "../NewNotificationForm/NotificationForm";
|
|
10
|
+
import NotificationItem from "../NotificationItem";
|
|
18
11
|
const NotificationList = (props) => {
|
|
19
|
-
const
|
|
12
|
+
const { parentId, asideable, filterOptions } = props;
|
|
20
13
|
const { user } = useApplicationContext();
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
const unitStore = useUnitStore();
|
|
15
|
+
const layoutContext = useViewLayoutContext();
|
|
16
|
+
const [recipients, setRecipients] = useState();
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
var _a;
|
|
19
|
+
if ((_a = props.unitForRecipients) === null || _a === void 0 ? void 0 : _a.id) {
|
|
20
|
+
unitStore.load(props.unitForRecipients.id, { includes: "main-contacts" }).then((res) => {
|
|
21
|
+
var _a;
|
|
22
|
+
if ((_a = res === null || res === void 0 ? void 0 : res.mainContacts) === null || _a === void 0 ? void 0 : _a.length) {
|
|
23
|
+
setRecipients(res.mainContacts);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
setRecipients([props.unitForRecipients]);
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}, []);
|
|
31
|
+
const list = useCreateListDataState({
|
|
32
|
+
filterDefaults: {
|
|
33
|
+
includes: "recipients",
|
|
34
|
+
filters: filters(),
|
|
35
|
+
},
|
|
36
|
+
}, [parentId, filterOptions]);
|
|
37
|
+
useAutoUpdateListData(list, (d) => d.target.id === parentId);
|
|
28
38
|
useRenderOnChange(() => list.filters.options);
|
|
29
|
-
|
|
30
|
-
|
|
39
|
+
useNotificationListEffect(list, (result, total) => {
|
|
40
|
+
var _a;
|
|
31
41
|
list.union(result);
|
|
42
|
+
(_a = props.onTotal) === null || _a === void 0 ? void 0 : _a.call(props, total !== null && total !== void 0 ? total : 0);
|
|
32
43
|
}, {
|
|
33
44
|
Total: true,
|
|
34
45
|
...list.filters.options,
|
|
35
46
|
});
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
if (props.active) {
|
|
38
|
-
runInAction(() => {
|
|
39
|
-
store
|
|
40
|
-
.load(props.active, { onError: (e) => message.error(e) })
|
|
41
|
-
.then((res) => {
|
|
42
|
-
if (!(list.data.filter((i) => i.id === res.id).length > 0))
|
|
43
|
-
list.insert(res, 0);
|
|
44
|
-
if (res.status === "Unread")
|
|
45
|
-
editStatus(res.id, "Read");
|
|
46
|
-
asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement(NodePropertiesView, { node: res.node }), { span: 12 });
|
|
47
|
-
})
|
|
48
|
-
.catch((e) => { });
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}, [props.active]);
|
|
52
47
|
return observe(() => {
|
|
53
|
-
var _a;
|
|
54
48
|
return (React.createElement(ListDataContext.Provider, { value: list },
|
|
55
|
-
React.createElement(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// const visible = path.some(
|
|
66
|
-
// (item: any) => item.className === "notification-card-content"
|
|
67
|
-
// );
|
|
68
|
-
/** fix: notification card里的任何对话框(比如:pdf/file viewer quick view) 任何button 都按不了,一按就close */
|
|
69
|
-
if ((_a = item === null || item === void 0 ? void 0 : item.node) === null || _a === void 0 ? void 0 : _a.id) {
|
|
70
|
-
(_b = props.onClickItem) === null || _b === void 0 ? void 0 : _b.call(props, ev, item);
|
|
71
|
-
}
|
|
72
|
-
}, onChangeStatus: (status) => editStatus(item.id, status) })) }))))));
|
|
49
|
+
React.createElement(ListView, { className: "all-new-list-view", headerProps: {
|
|
50
|
+
headerToolProps: {
|
|
51
|
+
visible: true,
|
|
52
|
+
/* 暂时直接检查 是不是外部用户, 是就不显示 */
|
|
53
|
+
addAble: !user.info.guest,
|
|
54
|
+
sortable: false,
|
|
55
|
+
onAdd: onAdd,
|
|
56
|
+
searchOptions: { placeholder: "Search in notifications" },
|
|
57
|
+
},
|
|
58
|
+
}, asideable: asideable, renderItem: ({ item }) => (React.createElement(NotificationItem, { key: item.id, id: item.id })) })));
|
|
73
59
|
});
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return [
|
|
78
|
-
{
|
|
79
|
-
c: "Status",
|
|
80
|
-
o: "=",
|
|
81
|
-
l: "And",
|
|
82
|
-
v1: S(props.status).capitalize().toString(),
|
|
83
|
-
},
|
|
84
|
-
];
|
|
85
|
-
}
|
|
86
|
-
function editStatus(id, status) {
|
|
87
|
-
runInAction(async () => {
|
|
88
|
-
var _a;
|
|
89
|
-
const item = store.items.get(id);
|
|
90
|
-
const old = item.status;
|
|
91
|
-
await store.edit(id, { data: { status: status }, error: "message" });
|
|
92
|
-
context.updateNotificationTotal(old, item.status);
|
|
93
|
-
if (props.status === "unread" && item.status === "Read")
|
|
94
|
-
return;
|
|
95
|
-
list.remove(item.id, { delay: 300 });
|
|
96
|
-
if (((_a = list.data) === null || _a === void 0 ? void 0 : _a.length) <= 1)
|
|
97
|
-
list.triggerNextPage();
|
|
60
|
+
function onAdd(asideContext) {
|
|
61
|
+
asideContext === null || asideContext === void 0 ? void 0 : asideContext.openAside(React.createElement(NotificationForm, { showView: true, targetId: props.parentId, recipients: recipients, defaultTemplate: props.defaultTemplate }), {
|
|
62
|
+
span: (layoutContext === null || layoutContext === void 0 ? void 0 : layoutContext.asideColSpan) ? layoutContext.asideColSpan : 12,
|
|
98
63
|
});
|
|
99
64
|
}
|
|
65
|
+
function filters() {
|
|
66
|
+
let filter = [];
|
|
67
|
+
if (parentId)
|
|
68
|
+
filter.push({ c: "Target", o: "=", l: "And", v1: parentId });
|
|
69
|
+
if (filterOptions)
|
|
70
|
+
filter = filterOptions;
|
|
71
|
+
return filter;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
NotificationList.defaultProps = {
|
|
75
|
+
asideable: true,
|
|
100
76
|
};
|
|
101
77
|
export default NotificationList;
|
|
102
78
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAEN,qBAAqB,EACrB,yBAAyB,GACzB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAgB,qBAAqB,EAAgB,MAAM,qBAAqB,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,4EAA4E,CAAC;AAClH,OAAO,QAAQ,MAAM,0DAA0D,CAAC;AAChF,OAAO,gBAAgB,MAAM,yCAAyC,CAAC;AACvE,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AAenD,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAE,EAAE;IACzD,MAA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,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE;SACnE,CACD,CAAC;IACH,CAAC;IAED,SAAS,OAAO;QACf,IAAI,MAAM,GAAmB,EAAE,CAAC;QAChC,IAAI,QAAQ;YAAE,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAE3E,IAAI,aAAa;YAAE,MAAM,GAAG,aAAa,CAAC;QAE1C,OAAO,MAAM,CAAC;IACf,CAAC;AACF,CAAC,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG;IAC/B,SAAS,EAAE,IAAI;CACf,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export type NotificationListHeaderProps = {
|
|
3
|
+
/** title */
|
|
4
|
+
title?: ReactNode;
|
|
5
|
+
/** description */
|
|
6
|
+
description?: ReactNode;
|
|
7
|
+
onAdd?: () => void;
|
|
8
|
+
};
|
|
9
|
+
declare const NotificationListHeader: {
|
|
10
|
+
(props: NotificationListHeaderProps): React.JSX.Element;
|
|
11
|
+
defaultProps: {
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
7
16
|
export default NotificationListHeader;
|
|
@@ -1,76 +1,22 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { observe } from "@voplus/morpho-ui";
|
|
3
|
-
import { Button, Divider } from "antd";
|
|
4
|
-
import { runInAction } from "mobx";
|
|
5
|
-
import { useLayout } from "@voplus/morpho-data";
|
|
6
|
-
import { FlagFilter } from "@voplus/morpho-document/es/controls/filters";
|
|
7
|
-
import { useNotificationListInWorkSpaceEffect } from "../../../../data/notification-workspace";
|
|
8
3
|
import { useApplicationContext } from "@voplus/morpho-data";
|
|
9
4
|
import { FontAwesomeIcon as FAIcon, faBellSolid } from "@voplus/morpho-ui/es/faIcons";
|
|
10
|
-
import { useNotificationListContext } from "../NotificationList/state";
|
|
11
|
-
import ListHeaderTool from "@voplus/morpho-ui/es/components/layout/ListView/headers/ListHeaderTool";
|
|
12
5
|
import PageHeadDashboard from "@voplus/morpho-ui/es/components/layout/headers/PageHeadDashboard";
|
|
13
|
-
import classnames from "classnames";
|
|
14
6
|
const NotificationListHeader = (props) => {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const statusMenu = [
|
|
29
|
-
{
|
|
30
|
-
key: "all",
|
|
31
|
-
label: "All",
|
|
32
|
-
total: undefined,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
key: "unread",
|
|
36
|
-
label: "Unread",
|
|
37
|
-
total: nContext.notificationTotals.unread,
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
key: "read",
|
|
41
|
-
label: "Read",
|
|
42
|
-
total: nContext.notificationTotals.read,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
key: "later",
|
|
46
|
-
label: "Later",
|
|
47
|
-
total: nContext.notificationTotals.later,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
key: "dismissed",
|
|
51
|
-
label: "Dismissed",
|
|
52
|
-
total: undefined,
|
|
53
|
-
},
|
|
54
|
-
];
|
|
55
|
-
const ListHeader = () => (React.createElement(ListHeaderTool, { addAble: false, filterViewProps: context.host.isTest
|
|
56
|
-
? {
|
|
57
|
-
columns: [React.createElement(FlagFilter, { key: "Flag" })],
|
|
58
|
-
}
|
|
59
|
-
: undefined, sortable: context.host.isTest ? true : false, searchHeader: context.host.isTest ? true : false, searchOptions: { placeholder: "Search in notifications" }, preExtra: () => (React.createElement("div", { className: "notifications-status" },
|
|
60
|
-
statusMenu.map((item) => (React.createElement(Button, { key: item.key, className: classnames(item, {
|
|
61
|
-
active: statusActive === item.key,
|
|
62
|
-
}), onClick: () => onClickStatus(item.key) },
|
|
63
|
-
item.label,
|
|
64
|
-
" ",
|
|
65
|
-
(item === null || item === void 0 ? void 0 : item.total) ? ` (${item.total})` : ""))),
|
|
66
|
-
context.host.isTest && !mobile && React.createElement(Divider, { type: "vertical" }))) }));
|
|
67
|
-
return (React.createElement("div", { className: classnames("notifications-header", { mobile: mobile }) }, !mobile ? (React.createElement(PageHeadDashboard, { headerType: "page", avatarIcon: React.createElement(FAIcon, { icon: faBellSolid }), title: "Your Notifications Center", description: "Stay updated: your latest alerts and notifications", moreExpansions: React.createElement(ListHeader, null) })) : (React.createElement(ListHeader, null))));
|
|
68
|
-
});
|
|
69
|
-
function onClickStatus(item) {
|
|
70
|
-
var _a;
|
|
71
|
-
setStatusActive(item);
|
|
72
|
-
(_a = props.onClickStatus) === null || _a === void 0 ? void 0 : _a.call(props, item);
|
|
73
|
-
}
|
|
7
|
+
const { user } = useApplicationContext();
|
|
8
|
+
return observe(() => (React.createElement(PageHeadDashboard, { className: "all-new-notifications-header", headerType: "page", avatarIcon: React.createElement(FAIcon, { icon: faBellSolid }), title: props.title, description: props.description, listHeaderProps: {
|
|
9
|
+
visible: true,
|
|
10
|
+
/* 暂时直接检查 是不是外部用户, 是就不显示 */
|
|
11
|
+
addAble: !user.info.guest,
|
|
12
|
+
sortable: false,
|
|
13
|
+
onAdd: props.onAdd,
|
|
14
|
+
searchOptions: { placeholder: "Search in notifications" },
|
|
15
|
+
} })));
|
|
16
|
+
};
|
|
17
|
+
NotificationListHeader.defaultProps = {
|
|
18
|
+
title: "Notification Creation",
|
|
19
|
+
description: "Set up your notification list effortlessly.",
|
|
74
20
|
};
|
|
75
21
|
export default NotificationListHeader;
|
|
76
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationListHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationListHeader/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,eAAe,IAAI,MAAM,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,iBAAiB,MAAM,kEAAkE,CAAC;AAUjG,MAAM,sBAAsB,GAAG,CAAC,KAAkC,EAAE,EAAE;IACrE,MAAM,EAAE,IAAI,EAAE,GAAG,qBAAqB,EAAE,CAAC;IAEzC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CACpB,oBAAC,iBAAiB,IACjB,SAAS,EAAC,8BAA8B,EACxC,UAAU,EAAC,MAAM,EACjB,UAAU,EAAE,oBAAC,MAAM,IAAC,IAAI,EAAE,WAAW,GAAI,EACzC,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,KAAK,CAAC,WAAW,EAC9B,eAAe,EAAE;YAChB,OAAO,EAAE,IAAI;YACb,2BAA2B;YAC3B,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK;YACzB,QAAQ,EAAE,KAAK;YACf,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,aAAa,EAAE,EAAE,WAAW,EAAE,yBAAyB,EAAE;SACzD,GACA,CACF,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,sBAAsB,CAAC,YAAY,GAAG;IACrC,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EAAE,6CAA6C;CAC1D,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ViewContext, ViewContextData, } from "@voplus/morpho-document-core/es/data/context/ViewContext";
|
|
2
1
|
import React, { useMemo } from "react";
|
|
3
2
|
import { observe } from "@voplus/morpho-ui";
|
|
4
|
-
import NotificationMenu from "../../controls/NotificationMenu";
|
|
5
|
-
import NotificationTabs from "../NotificationTabs";
|
|
6
|
-
import { FontAwesomeIcon as FAIcon, faBellSolid } from "@voplus/morpho-ui/es/faIcons";
|
|
7
3
|
import { useHandleError } from "@voplus/morpho-document-core";
|
|
8
4
|
import { useNotification } from "../../../../data/notification";
|
|
5
|
+
import { ViewContext, ViewContextData, } from "@voplus/morpho-document-core/es/data/context/ViewContext";
|
|
6
|
+
import { FontAwesomeIcon as FAIcon, faBellSolid } from "@voplus/morpho-ui/es/faIcons";
|
|
9
7
|
import PropertiesHeader from "@voplus/morpho-org/es/components/PropertiesHeader";
|
|
8
|
+
import NotificationMenu from "../../controls/NotificationMenu";
|
|
9
|
+
import NotificationTabs from "../NotificationTabs";
|
|
10
10
|
import Routes from "../../../Routes";
|
|
11
|
-
import "./index.css";
|
|
12
11
|
import classnames from "classnames";
|
|
12
|
+
import "./index.css";
|
|
13
13
|
const NotificationPropertiesView = (props) => {
|
|
14
14
|
const id = props.id;
|
|
15
15
|
const handleError = useHandleError();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationPropertiesView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationPropertiesView/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,cA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