@voplus/morpho-workspace 1.2.6 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/data/notification/{NotificaitonStore.d.ts → NotificationStore.d.ts} +8 -8
- package/es/data/notification/{NotificaitonStore.js → NotificationStore.js} +10 -7
- package/es/data/notification/NotificationStore.js.map +1 -0
- package/es/data/notification/hooks.d.ts +4 -4
- package/es/data/notification/hooks.js +8 -8
- package/es/data/notification/hooks.js.map +1 -1
- package/es/data/notification/index.d.ts +1 -1
- package/es/data/notification/index.js +1 -1
- package/es/data/notification/interfaces.d.ts +5 -3
- package/es/data/notification/types.d.ts +7 -7
- package/es/modules/board/components/SubDocumentList/index.js +2 -1
- package/es/modules/board/components/SubDocumentList/index.js.map +1 -1
- package/es/modules/notification/components/MentionNotificationCard/index.d.ts +10 -0
- package/es/modules/notification/components/MentionNotificationCard/index.js +31 -0
- package/es/modules/notification/components/MentionNotificationCard/index.js.map +1 -0
- package/es/modules/notification/components/MentionNotificationCard/index.less +23 -0
- package/es/modules/notification/components/NotificationList/index.d.ts +14 -5
- package/es/modules/notification/components/NotificationList/index.js +60 -17
- package/es/modules/notification/components/NotificationList/index.js.map +1 -1
- package/es/modules/notification/components/NotificationList/index.less +11 -1
- package/es/pages/Routes.js +1 -1
- package/es/pages/Routes.js.map +1 -1
- package/es/pages/Space/components/Documents/index.js +18 -33
- package/es/pages/Space/components/Documents/index.js.map +1 -1
- package/es/pages/Space/components/Documents/index.less +1 -5
- package/es/pages/Space/components/Notifications/index.d.ts +6 -0
- package/es/pages/Space/components/Notifications/index.js +37 -0
- package/es/pages/Space/components/Notifications/index.js.map +1 -0
- package/es/pages/Space/pages/MySpace/index.js +44 -41
- package/es/pages/Space/pages/MySpace/index.js.map +1 -1
- package/es/pages/Space/pages/MySpace/index.less +20 -34
- package/es/pages/Space/pages/MySpace/state.d.ts +15 -16
- package/es/pages/Space/pages/MySpace/state.js +38 -74
- package/es/pages/Space/pages/MySpace/state.js.map +1 -1
- package/package.json +1 -1
- package/es/MySpace.d.ts +0 -7
- package/es/MySpace.js +0 -14
- package/es/MySpace.js.map +0 -1
- package/es/data/notification/NotificaitonStore.js.map +0 -1
- package/es/modules/notification/NotificationRoutes.d.ts +0 -17
- package/es/modules/notification/NotificationRoutes.js +0 -29
- package/es/modules/notification/NotificationRoutes.js.map +0 -1
- package/es/modules/notification/components/MentionNotificaitonCard/index.d.ts +0 -9
- package/es/modules/notification/components/MentionNotificaitonCard/index.js +0 -27
- package/es/modules/notification/components/MentionNotificaitonCard/index.js.map +0 -1
- package/es/modules/notification/components/MentionNotificaitonCard/index.less +0 -16
- package/es/modules/notification/pages/NotificationListView/index.d.ts +0 -6
- package/es/modules/notification/pages/NotificationListView/index.js +0 -17
- package/es/modules/notification/pages/NotificationListView/index.js.map +0 -1
@@ -1,26 +1,26 @@
|
|
1
1
|
import { ApiEndPoint } from "@voplus/api";
|
2
2
|
import { CountedMap, Store } from "@voplus/morpho-data";
|
3
|
-
import {
|
3
|
+
import { INotification, LoadNotificationOptions, NotificationEditOptions } from ".";
|
4
4
|
import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
|
5
5
|
/** Notificaiton store supply backend functions. */
|
6
|
-
export declare class
|
6
|
+
export declare class NotificationStore extends Store {
|
7
7
|
readonly endpoint: ApiEndPoint;
|
8
8
|
/** Name of the store */
|
9
9
|
readonly name: string;
|
10
10
|
constructor(endpoint: ApiEndPoint);
|
11
11
|
/** All currently used notificaiton. */
|
12
|
-
readonly items: CountedMap<string,
|
12
|
+
readonly items: CountedMap<string, INotification>;
|
13
13
|
/** Load a notificaiton from server.
|
14
14
|
* @param {string} id - id of the notificaiton.
|
15
|
-
* @param {
|
15
|
+
* @param {LoadNotificationOptions} options - Optional load options.
|
16
16
|
*/
|
17
|
-
load(id: string, options
|
17
|
+
load(id: string, options?: LoadNotificationOptions): Promise<INotification>;
|
18
18
|
/** Load a list of documents from server.
|
19
19
|
* @param {LoadDocumentListOptions}
|
20
20
|
*/
|
21
|
-
loadList(options?: LoadDocumentListOptions): Promise<
|
21
|
+
loadList(options?: LoadDocumentListOptions): Promise<INotification[]>;
|
22
22
|
/** Edit an existing item on server. */
|
23
|
-
edit(id: string, options:
|
23
|
+
edit(id: string, options: NotificationEditOptions): Promise<any>;
|
24
24
|
}
|
25
25
|
/** React hook to retrieve NotificaitonStore */
|
26
|
-
export declare const
|
26
|
+
export declare const useNotificationStore: () => NotificationStore;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { RequestBuilder } from "@voplus/api";
|
2
2
|
import { CountedMap, Store, useApplicationContext } from "@voplus/morpho-data";
|
3
3
|
import { observable } from "mobx";
|
4
|
-
const StoreName = "
|
4
|
+
const StoreName = "NotificationStore";
|
5
5
|
/** Notificaiton store supply backend functions. */
|
6
|
-
export class
|
6
|
+
export class NotificationStore extends Store {
|
7
7
|
constructor(endpoint) {
|
8
8
|
super();
|
9
9
|
Object.defineProperty(this, "endpoint", {
|
@@ -29,9 +29,10 @@ export class NotificaitonStore extends Store {
|
|
29
29
|
}
|
30
30
|
/** Load a notificaiton from server.
|
31
31
|
* @param {string} id - id of the notificaiton.
|
32
|
-
* @param {
|
32
|
+
* @param {LoadNotificationOptions} options - Optional load options.
|
33
33
|
*/
|
34
34
|
async load(id, options) {
|
35
|
+
options = options !== null && options !== void 0 ? options : {};
|
35
36
|
let query = "";
|
36
37
|
if (options.includes)
|
37
38
|
query = query.concat(`includes=${options.includes}`);
|
@@ -57,16 +58,18 @@ export class NotificaitonStore extends Store {
|
|
57
58
|
async edit(id, options) {
|
58
59
|
return this.action(async () => {
|
59
60
|
const r = await this.endpoint.post(`/api/myspace/notifications/${id}`, new RequestBuilder().json(options.data));
|
60
|
-
|
61
|
+
const t = (await r.json());
|
62
|
+
this.items.overwrite(t.id, t);
|
63
|
+
return t;
|
61
64
|
}, options);
|
62
65
|
}
|
63
66
|
}
|
64
67
|
/** React hook to retrieve NotificaitonStore */
|
65
|
-
export const
|
68
|
+
export const useNotificationStore = () => {
|
66
69
|
const context = useApplicationContext();
|
67
70
|
if (!context.getService(StoreName)) {
|
68
|
-
context.registerService(new
|
71
|
+
context.registerService(new NotificationStore(context.api.currentEndPoint));
|
69
72
|
}
|
70
73
|
return context.getService(StoreName);
|
71
74
|
};
|
72
|
-
//# sourceMappingURL=
|
75
|
+
//# sourceMappingURL=NotificationStore.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"NotificationStore.js","sourceRoot":"","sources":["../../../src/data/notification/NotificationStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAI/E,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAElC,MAAM,SAAS,GAAG,mBAAmB,CAAC;AAEtC,mDAAmD;AACnD,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAIxC,YAAmC,QAAqB;QACpD,KAAK,EAAE,CAAC;;;;;mBADuB;;QAHnC,wBAAwB;QACxB;;;;mBAA+B,SAAS;WAAC;QAMzC,uCAAuC;QACvC;;;;mBAA2D,IAAI,UAAU,CACrE,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAoB,CAAA,EAC9D,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CACrC;WAAC;IANF,CAAC;IAQD;;;MAGE;IACK,KAAK,CAAC,IAAI,CAAC,EAAU,EAAE,OAAiC;QAC3D,OAAO,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;QACxB,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,IAAI,OAAO,CAAC,QAAQ;YAAE,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,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AAC,CAAC,IAAI,EAAE,CAAkB,CAAC;YAErD,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;YACrB,OAAO,CAAC,CAAC;QACb,CAAC,EAAE,OAAO,CAAC,CAAC;IAChB,CAAC;CACJ;AAED,+CAA+C;AAC/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACrC,MAAM,OAAO,GAAG,qBAAqB,EAAE,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;QAChC,OAAO,CAAC,eAAe,CAAC,IAAI,iBAAiB,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC;KAC/E;IACD,OAAO,OAAO,CAAC,UAAU,CAAC,SAAS,CAAuB,CAAC;AAC/D,CAAC,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
import { INotificaiton, LoadNotificaitonOptions } from ".";
|
1
|
+
import { INotification, LoadNotificationOptions } from ".";
|
3
2
|
import { ListDataContextState } from "@voplus/morpho-ui/es/data";
|
4
|
-
|
5
|
-
export declare const
|
3
|
+
import { LoadDocumentListOptions } from "@voplus/morpho-document-core";
|
4
|
+
export declare const useNotification: (id: string, options?: LoadNotificationOptions | undefined) => INotification;
|
5
|
+
export declare const useNotificationListEffect: (list: ListDataContextState<INotification> | null, effect: (list: INotification[], total?: number | undefined) => void, options?: LoadDocumentListOptions | undefined) => void;
|
@@ -1,15 +1,15 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
1
|
+
import { useNotificationStore } from ".";
|
2
|
+
import { useListLoaderEffect } from "@voplus/morpho-ui/es/hooks";
|
3
3
|
import { useLoadCountedMapItem } from "@voplus/morpho-data";
|
4
|
-
export const
|
4
|
+
export const useNotification = (id, options) => {
|
5
5
|
options = options ? options : {};
|
6
|
-
const store =
|
6
|
+
const store = useNotificationStore();
|
7
7
|
return useLoadCountedMapItem(id, store.items, () => store.load(id, options), options);
|
8
8
|
};
|
9
|
-
export const
|
9
|
+
export const useNotificationListEffect = (list, effect, options) => {
|
10
10
|
const deps = options ? options : {};
|
11
|
-
const
|
12
|
-
// Call
|
13
|
-
return
|
11
|
+
const store = useNotificationStore();
|
12
|
+
// Call useListLoaderEffect and ensure won't load twice for same loading options.
|
13
|
+
return useListLoaderEffect(list, store.items, effect, () => store.loadList(options), [deps]);
|
14
14
|
};
|
15
15
|
//# sourceMappingURL=hooks.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/data/notification/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"hooks.js","sourceRoot":"","sources":["../../../src/data/notification/hooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0C,oBAAoB,EAAE,MAAM,GAAG,CAAC;AAIjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAU,EAAE,OAAiC,EAAE,EAAE;IAChF,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA8B,CAAC;IAC9D,MAAM,KAAK,GAAG,oBAAoB,EAAE,CAAC;IAErC,OAAO,qBAAqB,CAAC,EAAE,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,OAAQ,CAAC,EAAE,OAAO,CAAC,CAAC;AACxF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACxC,IAAgD,EAChD,MAAsD,EACtD,OAAiC,EAChC,EAAE;IACH,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,EAA8B,CAAC;IAEjE,MAAM,KAAK,GAAG,oBAAoB,EAAE,CAAC;IAErC,iFAAiF;IACjF,OAAO,mBAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AAC9F,CAAC,CAAC"}
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import { ILoadable } from "@voplus/morpho-data";
|
2
|
-
export
|
2
|
+
export declare type NotificationStatus = "Unread" | "Read" | "Later" | "Dismissed";
|
3
|
+
export interface INotification extends ILoadable {
|
3
4
|
id: string;
|
4
5
|
type: string;
|
5
|
-
status:
|
6
|
+
status: NotificationStatus;
|
6
7
|
dismissDate?: Date;
|
8
|
+
createDate: Date;
|
7
9
|
}
|
8
|
-
export interface IMentionedNotification extends
|
10
|
+
export interface IMentionedNotification extends INotification {
|
9
11
|
content: {
|
10
12
|
content: string;
|
11
13
|
documentId: string;
|
@@ -1,13 +1,13 @@
|
|
1
|
+
import { INotification, NotificationStatus } from ".";
|
1
2
|
import { LoadOptions, StoreActionOptions } from "@voplus/morpho-data";
|
2
|
-
import { INotificaiton } from ".";
|
3
3
|
/** Custom load contact options type */
|
4
|
-
export declare type
|
4
|
+
export declare type LoadNotificationOptions = {
|
5
5
|
/** Comma separated include options e.g. path */
|
6
6
|
includes?: string;
|
7
|
-
} & LoadOptions<
|
8
|
-
export declare type
|
9
|
-
status?:
|
7
|
+
} & LoadOptions<INotification>;
|
8
|
+
export declare type NotificationEditDataOptions = {
|
9
|
+
status?: NotificationStatus;
|
10
10
|
};
|
11
|
-
export declare type
|
12
|
-
data:
|
11
|
+
export declare type NotificationEditOptions = {
|
12
|
+
data: NotificationEditDataOptions;
|
13
13
|
} & StoreActionOptions;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/board/components/SubDocumentList/index.tsx"],"names":[],"mappings":"AAAA,OAA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AAK,CAAC,CAAC;YACpD,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,KAAK,CAAC,cAAe,CAAC,OAAO,EAAE,CAAC,CAAC;SACjC;IACF,CAAC;IAED,kCAAkC;IAClC,SAAS,OAAO;QACf,MAAM,GAAG,GAAa,EAAE,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACxC,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;IAC7C,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC,eAAe,CAAC,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { NotificationStatus } from "../../../../data/notification";
|
2
|
+
import React from "react";
|
3
|
+
declare const MentionNotificationCard: (props: {
|
4
|
+
id: string;
|
5
|
+
active?: boolean | undefined;
|
6
|
+
className?: string | undefined;
|
7
|
+
onClick?: React.MouseEventHandler<HTMLDivElement> | undefined;
|
8
|
+
onChangeStatus?: ((state: NotificationStatus) => void) | undefined;
|
9
|
+
}) => JSX.Element;
|
10
|
+
export default MentionNotificationCard;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { Button, Space } from "@voplus/antd";
|
2
|
+
import { useNotification, } from "../../../../data/notification";
|
3
|
+
import Card from "@voplus/morpho-ui/es/controls/Card";
|
4
|
+
import ProseMirrorViewer from "@voplus/morpho-text/es/controls/ProseMirror/Viewer";
|
5
|
+
import React from "react";
|
6
|
+
import classnames from "classnames";
|
7
|
+
import moment from "moment";
|
8
|
+
import { observe } from "@voplus/morpho-ui";
|
9
|
+
import styles from "./index.less";
|
10
|
+
const MentionNotificationCard = (props) => {
|
11
|
+
const notification = useNotification(props.id);
|
12
|
+
return observe(() => (React.createElement(Card, { className: classnames(styles["notification-card"], props.className, { active: props.active }), bordered: true,
|
13
|
+
//hoverShadow
|
14
|
+
shadow: true },
|
15
|
+
React.createElement("div", { onClick: props.onClick },
|
16
|
+
React.createElement("h3", null, "Mention Notification"),
|
17
|
+
React.createElement(ProseMirrorViewer, { html: notification.content.content }),
|
18
|
+
React.createElement("div", { className: "notification-footer" },
|
19
|
+
React.createElement("div", { className: "notification-date" }, moment(notification.createDate).format("DD MMM yyyy")),
|
20
|
+
React.createElement("div", { className: "notification-btn" },
|
21
|
+
React.createElement(Space, null,
|
22
|
+
notification.status !== "Dismissed" && (React.createElement(Button, { onClick: (ev) => onChangeStatus(ev, "Dismissed") }, "Dismiss")),
|
23
|
+
notification.status !== "Later" && notification.status !== "Dismissed" && (React.createElement(Button, { onClick: (ev) => onChangeStatus(ev, "Later") }, "Later")))))))));
|
24
|
+
function onChangeStatus(ev, status) {
|
25
|
+
var _a;
|
26
|
+
(_a = props.onChangeStatus) === null || _a === void 0 ? void 0 : _a.call(props, status);
|
27
|
+
ev.stopPropagation();
|
28
|
+
}
|
29
|
+
};
|
30
|
+
export default MentionNotificationCard;
|
31
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/MentionNotificationCard/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAGN,eAAe,GACf,MAAM,+BAA+B,CAAC;AAEvC,OAAO,IAAI,MAAM,oCAAoC,CAAC;AACtD,OAAO,iBAAiB,MAAM,oDAAoD,CAAC;AACnF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,MAAM,MAAM,cAAc,CAAC;AAElC,MAAM,uBAAuB,GAAG,CAAC,KAMhC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EF,eAAe,uBAAuB,CAAC"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
.notification-card {
|
2
|
+
cursor: pointer;
|
3
|
+
margin: 10px 30px 10px 30px;
|
4
|
+
&:hover {
|
5
|
+
border: 1px solid rgb(210, 210, 210);
|
6
|
+
box-shadow: 2px 2px 5px #ddddf7;
|
7
|
+
}
|
8
|
+
&:global(.active) {
|
9
|
+
border: 1px solid rgb(210, 210, 210);
|
10
|
+
box-shadow: 2px 2px 5px #ddddf7;
|
11
|
+
}
|
12
|
+
:global {
|
13
|
+
.notification-footer {
|
14
|
+
margin-top: 20px;
|
15
|
+
display: flex;
|
16
|
+
justify-content: space-between;
|
17
|
+
align-items: center;
|
18
|
+
.notification-date {
|
19
|
+
color: gray;
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
@@ -1,7 +1,16 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { FilterOption } from "@voplus/morpho-data";
|
3
1
|
import "./index.less";
|
4
|
-
|
5
|
-
|
2
|
+
import { INotification, NotificationStatus } from "../../../../data/notification";
|
3
|
+
import React from "react";
|
4
|
+
declare const NotificationList: (props: {
|
5
|
+
/** status of notifications shown on the list. */
|
6
|
+
status: string;
|
7
|
+
/** The current active item */
|
8
|
+
active?: string | undefined;
|
9
|
+
/** Call back when an item has been clicked on the list. */
|
10
|
+
onClickItem?: ((ev: React.MouseEvent<HTMLDivElement, MouseEvent>, item: INotification) => void) | undefined;
|
11
|
+
/** Call back when received total number of notifications. */
|
12
|
+
onTotal?: ((total: number) => void) | undefined;
|
13
|
+
/** Call back when an item's status changed. */
|
14
|
+
onItemStatusChanged?: ((old: NotificationStatus, item: INotification) => void) | undefined;
|
6
15
|
}) => JSX.Element;
|
7
|
-
export default
|
16
|
+
export default NotificationList;
|
@@ -1,26 +1,69 @@
|
|
1
|
+
import "./index.less";
|
2
|
+
import { useNotification, useNotificationListEffect, useNotificationStore, } from "../../../../data/notification";
|
1
3
|
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
2
|
-
import React
|
3
|
-
import MentionNotificaitonCard from "../../../../modules/notification/components/MentionNotificaitonCard";
|
4
|
-
import { useNotificaitonListEffect } from "../../../../data/notification";
|
5
|
-
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
|
4
|
+
import React from "react";
|
6
5
|
import { observe, useRenderOnChange } from "@voplus/morpho-ui";
|
7
|
-
import
|
8
|
-
import "
|
9
|
-
|
10
|
-
|
6
|
+
import { CSSTransition } from "react-transition-group";
|
7
|
+
import ListView from "@voplus/morpho-ui/es/components/layout/ListView/ListView2";
|
8
|
+
import MentionNotificationCard from "../MentionNotificationCard";
|
9
|
+
import PropertiesView from "@voplus/morpho-document/es/components/PropertiesView";
|
10
|
+
import S from "string";
|
11
|
+
import { runInAction } from "mobx";
|
12
|
+
const NotificationList = (props) => {
|
13
|
+
const store = useNotificationStore();
|
11
14
|
// const list = useCreateListDataState<INotificaiton>({}, []);
|
12
|
-
const list = useCreateListDataState({ filterDefaults: { filters:
|
13
|
-
|
14
|
-
|
15
|
-
list.clear();
|
16
|
-
}, [props.filters]);
|
17
|
-
list.filters.options.Filters = props.filters || [];
|
15
|
+
const list = useCreateListDataState({ filterDefaults: { filters: filters() } }, [
|
16
|
+
props.status,
|
17
|
+
]);
|
18
18
|
/** 如果 list.filters.options变更了就重渲染,使下一行的useNotificaitonListEffect 可以接收新参数*/
|
19
19
|
useRenderOnChange(() => list.filters.options);
|
20
20
|
/** 把ListDataState传给useNotificaitonListEffect,使之可以自動更新loading, hasmore. */
|
21
|
-
|
21
|
+
useNotificationListEffect(list, (result, total) => {
|
22
|
+
var _a;
|
23
|
+
list.union(result);
|
24
|
+
(_a = props.onTotal) === null || _a === void 0 ? void 0 : _a.call(props, total);
|
25
|
+
}, {
|
26
|
+
Total: true,
|
27
|
+
...list.filters.options,
|
28
|
+
});
|
29
|
+
// try to load the active notification and add to list if it's not already there.
|
30
|
+
useNotification(props.active, {
|
31
|
+
onLoad: (item) => {
|
32
|
+
list.insert(item, 0);
|
33
|
+
if (item.status === "Unread") {
|
34
|
+
editStatus(item.id, "Read");
|
35
|
+
}
|
36
|
+
},
|
37
|
+
});
|
22
38
|
return observe(() => (React.createElement(ListDataContext.Provider, { value: list },
|
23
|
-
React.createElement(ListView, { headerProps: { viewTitle: "My
|
39
|
+
React.createElement(ListView, { headerProps: { viewTitle: "My Notifications", addAble: false, sortable: false }, className: "my-space-notifications", renderItem: ({ item }) => {
|
40
|
+
return (React.createElement(CSSTransition, { key: item.id, in: list.isRemoving(item.id) !== true, timeout: 300, classNames: "notification-card" },
|
41
|
+
React.createElement(MentionNotificationCard, { id: item.id, active: props.active === item.id ? true : false, onClick: (ev) => { var _a; return (_a = props.onClickItem) === null || _a === void 0 ? void 0 : _a.call(props, ev, item); }, onChangeStatus: (status) => editStatus(item.id, status) })));
|
42
|
+
}, propertiesView: (id, item) => React.createElement(PropertiesView, { id: item.content.documentId }) }))));
|
43
|
+
function filters() {
|
44
|
+
if (!props.status || props.status == "all")
|
45
|
+
return [];
|
46
|
+
return [
|
47
|
+
{
|
48
|
+
c: "Status",
|
49
|
+
o: "=",
|
50
|
+
l: "And",
|
51
|
+
v1: S(props.status).capitalize().toString(),
|
52
|
+
},
|
53
|
+
];
|
54
|
+
}
|
55
|
+
function editStatus(id, status) {
|
56
|
+
runInAction(async () => {
|
57
|
+
var _a;
|
58
|
+
const item = store.items.get(id);
|
59
|
+
const old = item.status;
|
60
|
+
await store.edit(id, { data: { status: status }, error: "message" });
|
61
|
+
(_a = props.onItemStatusChanged) === null || _a === void 0 ? void 0 : _a.call(props, old, item);
|
62
|
+
if (props.status === "unread" && item.status === "Read")
|
63
|
+
return;
|
64
|
+
list.remove(item.id, { delay: 300 });
|
65
|
+
});
|
66
|
+
}
|
24
67
|
};
|
25
|
-
export default
|
68
|
+
export default NotificationList;
|
26
69
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationList/index.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/notification/components/NotificationList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,cAAc,CAAC;AAEtB,OAAO,EAGN,eAAe,EACf,yBAAyB,EACzB,oBAAoB,GACpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACpF,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,QAAQ,MAAM,2DAA2D,CAAC;AACjF,OAAO,uBAAuB,MAAM,4BAA4B,CAAC;AACjE,OAAO,cAAc,MAAM,sDAAsD,CAAC;AAClF,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEnC,MAAM,gBAAgB,GAAG,CAAC,KAezB,EAAE,EAAE;IACJ,MAAM,KAAK,GAAG,oBAAoB,EAAE,CAAC;IACrC,8DAA8D;IAC9D,MAAM,IAAI,GAAG,sBAAsB,CAAgB,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE;QAC9F,KAAK,CAAC,MAAM;KACZ,CAAC,CAAC;IAEH,2EAA2E;IAC3E,iBAAiB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAE9C,0EAA0E;IAC1E,yBAAyB,CACxB,IAAI,EACJ,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;;QACjB,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACnB,MAAA,KAAK,CAAC,OAAO,+CAAb,KAAK,EA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AC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
@@ -1,6 +1,16 @@
|
|
1
1
|
:global {
|
2
|
-
.my-space-
|
2
|
+
.my-space-notifications {
|
3
3
|
background-color: #fff;
|
4
4
|
padding: 0 !important;
|
5
|
+
.list-view-main {
|
6
|
+
background-color: #f5f5f5;
|
7
|
+
}
|
8
|
+
}
|
9
|
+
.notification-card-exit {
|
10
|
+
opacity: 1;
|
11
|
+
}
|
12
|
+
.notification-card-exit-active {
|
13
|
+
opacity: 0;
|
14
|
+
transition: opacity 300ms;
|
5
15
|
}
|
6
16
|
}
|
package/es/pages/Routes.js
CHANGED
@@ -10,7 +10,7 @@ const ProjectRoutes = () => {
|
|
10
10
|
React.createElement(Route, { path: Routes.ProjectDefaultView.route, exact: true, component: Routes.ProjectDefaultView.component }),
|
11
11
|
React.createElement(Route, { path: Routes.WorkDefaultView.route, exact: true, component: Routes.WorkDefaultView.component }),
|
12
12
|
React.createElement(Route, { path: Routes.WorkTypeDefaultView.route, exact: true, component: Routes.WorkTypeDefaultView.component }),
|
13
|
-
React.createElement(Route, { path: Routes.MySpace.route,
|
13
|
+
React.createElement(Route, { path: Routes.MySpace.route, component: Routes.MySpace.component })));
|
14
14
|
};
|
15
15
|
const Routes = {
|
16
16
|
ProjectDefaultView: {
|
package/es/pages/Routes.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Routes.js","sourceRoot":"","sources":["../../src/pages/Routes.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,kBAAkB,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,8BAA8B,CAAC;A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,IAAI,CAAC;YACtB,IAAI,EAAE,oBAAoB;YAC1B,cAAc,EAAE,MAAM,CAAC,kBAAkB,CAAC,UAAU;YACpD,SAAS,EAAE,oBAAC,aAAa,OAAG;SAC5B,CAAC,CAAC;QACH,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC;YACtB,IAAI,EAAE,iBAAiB;YACvB,cAAc,EAAE,MAAM,CAAC,eAAe,CAAC,UAAU;YACjD,SAAS,EAAE,oBAAC,aAAa,OAAG;SAC5B,CAAC,CAAC;QACH,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC;YACtB,IAAI,EAAE,qBAAqB;YAC3B,cAAc,EAAE,MAAM,CAAC,mBAAmB,CAAC,UAAU;YACrD,SAAS,EAAE,oBAAC,aAAa,OAAG;SAC5B,CAAC,CAAC;QACH,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC;YACtB,IAAI,EAAE,SAAS;YACf,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,UAAU;YACzC,SAAS,EAAE,oBAAC,aAAa,OAAG;SAC5B,CAAC,CAAC;IACJ,CAAC;CACD,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
@@ -1,40 +1,25 @@
|
|
1
1
|
import "./index.less";
|
2
|
-
import { useAutoUpdateListData, useDocumentListEffect, } from "@voplus/morpho-document-core";
|
3
|
-
import { ListDataContext, useCreateListDataState } from "@voplus/morpho-ui/es/data";
|
4
|
-
import DocumentIcon from "@voplus/morpho-document/es/pages/VSubmit/components/DocumentIcon";
|
5
2
|
import React from "react";
|
6
|
-
import
|
7
|
-
import { SearchOutlined } from "@ant-design/icons";
|
8
|
-
import SortViewDropdown from "@voplus/morpho-ui/es/components/layout/ListView/controls/SortViewDropdown";
|
9
|
-
import TimeoutInput from "@voplus/morpho-ui/es/controls/TimeoutInput";
|
3
|
+
import ViewFrame from "@voplus/morpho-document/es/components/ViewFrame";
|
10
4
|
import { observe } from "@voplus/morpho-ui";
|
11
|
-
import {
|
5
|
+
import { useLayout } from "@voplus/morpho-data";
|
6
|
+
import { useRouteMatch } from "react-router";
|
12
7
|
const Documents = (props) => {
|
13
|
-
|
14
|
-
|
15
|
-
const
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
React.createElement("header", null,
|
29
|
-
React.createElement("div", { className: "title" }, "My Documents"),
|
30
|
-
React.createElement("div", null,
|
31
|
-
React.createElement(SortViewDropdown, { onSort: onSort, className: "sort-btn" }),
|
32
|
-
React.createElement(TimeoutInput, { suffix: React.createElement(SearchOutlined, null), allowClear: true, onIdle: (e) => console.log(e, "e") }))),
|
33
|
-
React.createElement(Scrollbars, { autoHide: true },
|
34
|
-
React.createElement("div", { className: "my-document-view_list" },
|
35
|
-
React.createElement(ListDataContext.Provider, { value: list }, list.data.map((i) => (React.createElement(DocumentIcon, { id: i.id, key: i.id })))))))));
|
36
|
-
function onSort(sort) {
|
37
|
-
list.triggerSort(sort);
|
8
|
+
var _a;
|
9
|
+
let match = useRouteMatch();
|
10
|
+
const layout = useLayout();
|
11
|
+
const query = new URLSearchParams(layout.history.location.search);
|
12
|
+
const id = (_a = query.get("active")) !== null && _a !== void 0 ? _a : props.id;
|
13
|
+
const view = query.get("view");
|
14
|
+
return observe(() => (React.createElement("div", { className: "my-documents" },
|
15
|
+
React.createElement(ViewFrame, { id: id, view: view, onNavigate: onNavigate }),
|
16
|
+
")")));
|
17
|
+
function onNavigate(id, view) {
|
18
|
+
const viewQuery = view ? `&view=${view}` : "";
|
19
|
+
if (id != props.id)
|
20
|
+
layout.history.push(`${match.url}?active=${id}${viewQuery}`);
|
21
|
+
else
|
22
|
+
layout.history.push(`${match.url}?${viewQuery}`);
|
38
23
|
}
|
39
24
|
};
|
40
25
|
export default Documents;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/pages/Space/components/Documents/index.tsx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