@voplus/morpho-document 9.0.8 → 9.0.9
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/action-plan/interfaces.d.ts +5 -0
- package/es/data/action-plan/types.d.ts +2 -1
- package/es/modules/action-plan/components/ActionPlanProperties/index.d.ts +1 -1
- package/es/modules/action-plan/components/ActionPlanProperties/index.js +22 -2
- package/es/modules/action-plan/components/ActionPlanProperties/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -23,7 +23,8 @@ export type CreateActionPlanOptions = {
|
|
|
23
23
|
} & StoreActionOptions;
|
|
24
24
|
export type EditActionPlanOptions = {
|
|
25
25
|
data: {
|
|
26
|
-
ActionChanges
|
|
26
|
+
ActionChanges?: ActionEditOptions[];
|
|
27
|
+
OwnerIds?: string[];
|
|
27
28
|
};
|
|
28
29
|
} & StoreActionOptions;
|
|
29
30
|
export type DeleteActionPlanOptions = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export type ActionPlanPropertiesName = "Status" | "CreateDate" | "Folder";
|
|
2
|
+
export type ActionPlanPropertiesName = "Status" | "CreateDate" | "Folder" | "NextExecutionDate" | "Owners";
|
|
3
3
|
declare const ActionPlanProperties: {
|
|
4
4
|
(props: {
|
|
5
5
|
id: string;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { observe } from "@voplus/morpho-ui";
|
|
3
3
|
import { Scrollbars } from "react-custom-scrollbars-2";
|
|
4
|
+
import { useApplicationContext } from "@voplus/morpho-data";
|
|
4
5
|
import { useActionPlan, useActionPlanStore } from "../../../../data/action-plan";
|
|
5
6
|
import FieldsProperties from "@voplus/morpho-fields/es/components/FieldsProperties";
|
|
6
7
|
import StatusLabel from "@voplus/morpho-ui/es/controls/DocumentStatusLabel/StatusLabel";
|
|
7
8
|
import PropertiesSection from "@voplus/morpho-ui/es/controls/PropertiesSection";
|
|
9
|
+
import MentionList from "@voplus/morpho-org/es/controls/MentionList";
|
|
8
10
|
import DocumentReference from "../../../../controls/DocumentReference";
|
|
9
11
|
import UTCShortDate from "@voplus/morpho-ui/es/controls/UTCShortDate";
|
|
10
12
|
import Prop from "@voplus/morpho-ui/es/controls/Prop";
|
|
@@ -13,6 +15,7 @@ const ActionPlanProperties = (props) => {
|
|
|
13
15
|
const classId = "action-plan-properties";
|
|
14
16
|
const { id, actionPlanTitle, actionPlanProperties } = props;
|
|
15
17
|
const actionPlan = useActionPlan(id);
|
|
18
|
+
const { user } = useApplicationContext();
|
|
16
19
|
const store = useActionPlanStore();
|
|
17
20
|
return observe(() => {
|
|
18
21
|
const filterPro = actionPlanProperties === null || actionPlanProperties === void 0 ? void 0 : actionPlanProperties.filter((i) => (i === null || i === void 0 ? void 0 : i.visible) !== false);
|
|
@@ -22,13 +25,24 @@ const ActionPlanProperties = (props) => {
|
|
|
22
25
|
React.createElement(FieldsProperties, { id: id }))));
|
|
23
26
|
});
|
|
24
27
|
function renderProp(item) {
|
|
28
|
+
var _a;
|
|
25
29
|
switch (item.name) {
|
|
26
30
|
case "Status":
|
|
27
31
|
return (actionPlan === null || actionPlan === void 0 ? void 0 : actionPlan.status) ? (React.createElement(Prop, { label: item.name, className: `${classId}-${item.name}` },
|
|
28
32
|
React.createElement(StatusLabel, { size: "small", status: actionPlan === null || actionPlan === void 0 ? void 0 : actionPlan.status }))) : null;
|
|
29
|
-
case "
|
|
33
|
+
case "Owners":
|
|
30
34
|
return (React.createElement(Prop, { label: item.name, className: `${classId}-${item.name}` },
|
|
35
|
+
React.createElement(MentionList, { placeholder: "Select Owner", contacts: ((_a = actionPlan === null || actionPlan === void 0 ? void 0 : actionPlan.owners) === null || _a === void 0 ? void 0 : _a.length) ? actionPlan === null || actionPlan === void 0 ? void 0 : actionPlan.owners : [], canEdit: user.can("edit", actionPlan.p), onChange: (list) => {
|
|
36
|
+
let ownerIds = [];
|
|
37
|
+
list.map((i) => ownerIds.push(i.id));
|
|
38
|
+
store.edit(id, { data: { OwnerIds: ownerIds }, error: "message" });
|
|
39
|
+
} })));
|
|
40
|
+
case "CreateDate":
|
|
41
|
+
return (React.createElement(Prop, { label: "Create Date", className: `${classId}-${item.name}` },
|
|
31
42
|
React.createElement(UTCShortDate, { value: actionPlan === null || actionPlan === void 0 ? void 0 : actionPlan.createDate, format: "DD MMM YYYY" })));
|
|
43
|
+
case "NextExecutionDate":
|
|
44
|
+
return (actionPlan === null || actionPlan === void 0 ? void 0 : actionPlan.nextExecutionDate) ? (React.createElement(Prop, { label: "Next Execution Date", className: `${classId}-${item.name}` },
|
|
45
|
+
React.createElement(UTCShortDate, { value: actionPlan === null || actionPlan === void 0 ? void 0 : actionPlan.nextExecutionDate, format: "DD MMM YYYY" }))) : null;
|
|
32
46
|
case "Folder":
|
|
33
47
|
return (React.createElement(Prop, { label: item.name, className: `${classId}-${item.name}` }, (actionPlan === null || actionPlan === void 0 ? void 0 : actionPlan.parentId) ? React.createElement(DocumentReference, { id: actionPlan.parentId }) : React.createElement(React.Fragment, null)));
|
|
34
48
|
}
|
|
@@ -36,7 +50,13 @@ const ActionPlanProperties = (props) => {
|
|
|
36
50
|
};
|
|
37
51
|
ActionPlanProperties.defaultProps = {
|
|
38
52
|
actionPlanTitle: "ACTION PLAN PROPERTIES",
|
|
39
|
-
actionPlanProperties: [
|
|
53
|
+
actionPlanProperties: [
|
|
54
|
+
{ name: "CreateDate" },
|
|
55
|
+
{ name: "NextExecutionDate" },
|
|
56
|
+
{ name: "Status" },
|
|
57
|
+
{ name: "Owners" },
|
|
58
|
+
{ name: "Folder" },
|
|
59
|
+
],
|
|
40
60
|
};
|
|
41
61
|
export default ActionPlanProperties;
|
|
42
62
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/action-plan/components/ActionPlanProperties/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,gBAAgB,MAAM,sDAAsD,CAAC;AACpF,OAAO,WAAW,MAAM,+DAA+D,CAAC;AACxF,OAAO,iBAAiB,MAAM,iDAAiD,CAAC;AAChF,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AACvE,OAAO,YAAY,MAAM,4CAA4C,CAAC;AACtE,OAAO,IAAI,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/action-plan/components/ActionPlanProperties/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,gBAAgB,MAAM,sDAAsD,CAAC;AACpF,OAAO,WAAW,MAAM,+DAA+D,CAAC;AACxF,OAAO,iBAAiB,MAAM,iDAAiD,CAAC;AAChF,OAAO,WAAW,MAAM,4CAA4C,CAAC;AACrE,OAAO,iBAAiB,MAAM,wCAAwC,CAAC;AACvE,OAAO,YAAY,MAAM,4CAA4C,CAAC;AACtE,OAAO,IAAI,MAAM,oCAAoC,CAAC;AAStD,MAAM,oBAAoB,GAAG,CAAC,KAI7B,EAAE,EAAE;IACJ,yCAAyC;IACzC,MAAM,OAAO,GAAG,wBAAwB,CAAC;IAEzC,MAAM,EAAE,EAAE,EAAE,eAAe,EAAE,oBAAoB,EAAE,GAAG,KAAK,CAAC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