@procore/saved-views 5.1.0-alpha → 5.1.0-alpha.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/README.md +679 -61
- package/dist/legacy/index.d.mts +6 -10
- package/dist/legacy/index.d.ts +6 -10
- package/dist/legacy/index.js +542 -435
- package/dist/legacy/index.mjs +570 -451
- package/dist/modern/index.d.mts +6 -10
- package/dist/modern/index.d.ts +6 -10
- package/dist/modern/index.js +540 -434
- package/dist/modern/index.mjs +568 -450
- package/package.json +1 -1
package/dist/legacy/index.js
CHANGED
|
@@ -2011,9 +2011,9 @@ var require_dist = __commonJS({
|
|
|
2011
2011
|
}
|
|
2012
2012
|
});
|
|
2013
2013
|
|
|
2014
|
-
// node_modules/react-is/cjs/react-is.production.min.js
|
|
2014
|
+
// ../../node_modules/styled-components/node_modules/react-is/cjs/react-is.production.min.js
|
|
2015
2015
|
var require_react_is_production_min = __commonJS({
|
|
2016
|
-
"node_modules/react-is/cjs/react-is.production.min.js"(exports2) {
|
|
2016
|
+
"../../node_modules/styled-components/node_modules/react-is/cjs/react-is.production.min.js"(exports2) {
|
|
2017
2017
|
"use strict";
|
|
2018
2018
|
var b2 = 60103;
|
|
2019
2019
|
var c2 = 60106;
|
|
@@ -2149,9 +2149,9 @@ var require_react_is_production_min = __commonJS({
|
|
|
2149
2149
|
}
|
|
2150
2150
|
});
|
|
2151
2151
|
|
|
2152
|
-
// node_modules/react-is/cjs/react-is.development.js
|
|
2152
|
+
// ../../node_modules/styled-components/node_modules/react-is/cjs/react-is.development.js
|
|
2153
2153
|
var require_react_is_development = __commonJS({
|
|
2154
|
-
"node_modules/react-is/cjs/react-is.development.js"(exports2) {
|
|
2154
|
+
"../../node_modules/styled-components/node_modules/react-is/cjs/react-is.development.js"(exports2) {
|
|
2155
2155
|
"use strict";
|
|
2156
2156
|
if (process.env.NODE_ENV !== "production") {
|
|
2157
2157
|
(function() {
|
|
@@ -2341,9 +2341,9 @@ var require_react_is_development = __commonJS({
|
|
|
2341
2341
|
}
|
|
2342
2342
|
});
|
|
2343
2343
|
|
|
2344
|
-
// node_modules/react-is/index.js
|
|
2344
|
+
// ../../node_modules/styled-components/node_modules/react-is/index.js
|
|
2345
2345
|
var require_react_is = __commonJS({
|
|
2346
|
-
"node_modules/react-is/index.js"(exports2, module2) {
|
|
2346
|
+
"../../node_modules/styled-components/node_modules/react-is/index.js"(exports2, module2) {
|
|
2347
2347
|
"use strict";
|
|
2348
2348
|
if (process.env.NODE_ENV === "production") {
|
|
2349
2349
|
module2.exports = require_react_is_production_min();
|
|
@@ -8811,7 +8811,8 @@ var en_default = {
|
|
|
8811
8811
|
viewTemporarily: "View Temporarily",
|
|
8812
8812
|
createView: "Create View",
|
|
8813
8813
|
copyShareLink: "Copy Share Link",
|
|
8814
|
-
linkCopied: "Share link copied to clipboard"
|
|
8814
|
+
linkCopied: "Share link copied to clipboard",
|
|
8815
|
+
clearTemporary: "Remove"
|
|
8815
8816
|
},
|
|
8816
8817
|
modal: {
|
|
8817
8818
|
edit: {
|
|
@@ -8825,8 +8826,7 @@ var en_default = {
|
|
|
8825
8826
|
description: "This view cannot be restored once it has been deleted."
|
|
8826
8827
|
},
|
|
8827
8828
|
copyConfirmation: {
|
|
8828
|
-
|
|
8829
|
-
description: "You pasted a link to a saved view that does not yet exist for you. You can create it as a personal saved view or just view it temporarily."
|
|
8829
|
+
description: "You pasted a link to a saved view that does not yet exist for you.\nYou can create it as a personal saved view or just view it\ntemporarily."
|
|
8830
8830
|
},
|
|
8831
8831
|
fields: {
|
|
8832
8832
|
name: "Name",
|
|
@@ -8874,6 +8874,7 @@ var en_default = {
|
|
|
8874
8874
|
rfi: "All RFIs",
|
|
8875
8875
|
submittal_log: "All Submittals"
|
|
8876
8876
|
},
|
|
8877
|
+
temporaryViewName: "Temporary View",
|
|
8877
8878
|
viewLevel: {
|
|
8878
8879
|
company: "Company Views",
|
|
8879
8880
|
project: "Project Views",
|
|
@@ -9719,7 +9720,7 @@ function __rest(s2, e2) {
|
|
|
9719
9720
|
return t2;
|
|
9720
9721
|
}
|
|
9721
9722
|
|
|
9722
|
-
//
|
|
9723
|
+
// node_modules/@procore/core-icons/dist/Icon.js
|
|
9723
9724
|
var React = __toESM(require("react"));
|
|
9724
9725
|
function getSize(size) {
|
|
9725
9726
|
if (size === "sm") {
|
|
@@ -9738,7 +9739,7 @@ function Icon(_a) {
|
|
|
9738
9739
|
return React.isValidElement(children) ? React.cloneElement(children, __assign(__assign({ "aria-hidden": true, "data-qa": "ci-".concat(props.name) }, props), { width: getSize(props.size), height: getSize(props.size), focusable: false, style: __assign(__assign({}, props.style), { flex: "0 0 auto" }) })) : null;
|
|
9739
9740
|
}
|
|
9740
9741
|
|
|
9741
|
-
//
|
|
9742
|
+
// node_modules/@procore/core-icons/dist/icons/Building.js
|
|
9742
9743
|
var React2 = __toESM(require("react"));
|
|
9743
9744
|
var Building = React2.forwardRef(function Building2(props, ref) {
|
|
9744
9745
|
return React2.createElement(
|
|
@@ -9754,7 +9755,7 @@ var Building = React2.forwardRef(function Building2(props, ref) {
|
|
|
9754
9755
|
Building.displayName = "Building";
|
|
9755
9756
|
var Building_default = Building;
|
|
9756
9757
|
|
|
9757
|
-
//
|
|
9758
|
+
// node_modules/@procore/core-icons/dist/icons/ChevronDown.js
|
|
9758
9759
|
var React3 = __toESM(require("react"));
|
|
9759
9760
|
var ChevronDown = React3.forwardRef(function ChevronDown2(props, ref) {
|
|
9760
9761
|
return React3.createElement(
|
|
@@ -9770,7 +9771,7 @@ var ChevronDown = React3.forwardRef(function ChevronDown2(props, ref) {
|
|
|
9770
9771
|
ChevronDown.displayName = "ChevronDown";
|
|
9771
9772
|
var ChevronDown_default = ChevronDown;
|
|
9772
9773
|
|
|
9773
|
-
//
|
|
9774
|
+
// node_modules/@procore/core-icons/dist/icons/ChevronRight.js
|
|
9774
9775
|
var React4 = __toESM(require("react"));
|
|
9775
9776
|
var ChevronRight = React4.forwardRef(function ChevronRight2(props, ref) {
|
|
9776
9777
|
return React4.createElement(
|
|
@@ -9786,100 +9787,116 @@ var ChevronRight = React4.forwardRef(function ChevronRight2(props, ref) {
|
|
|
9786
9787
|
ChevronRight.displayName = "ChevronRight";
|
|
9787
9788
|
var ChevronRight_default = ChevronRight;
|
|
9788
9789
|
|
|
9789
|
-
//
|
|
9790
|
+
// node_modules/@procore/core-icons/dist/icons/Clear.js
|
|
9790
9791
|
var React5 = __toESM(require("react"));
|
|
9791
|
-
var
|
|
9792
|
+
var Clear = React5.forwardRef(function Clear2(props, ref) {
|
|
9792
9793
|
return React5.createElement(
|
|
9793
9794
|
Icon,
|
|
9794
|
-
__assign({}, props, { name: "
|
|
9795
|
+
__assign({}, props, { name: "Clear" }),
|
|
9795
9796
|
React5.createElement(
|
|
9796
9797
|
"svg",
|
|
9797
9798
|
{ width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
|
|
9798
|
-
React5.createElement("path", {
|
|
9799
|
-
React5.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.55556 19.705C7.55556 18.4375 8.55048 17.41 9.77778 17.41H19.7778C21.0051 17.41 22 18.4375 22 19.705C22 20.9725 21.0051 22 19.7778 22H9.77778C8.55048 22 7.55556 20.9725 7.55556 19.705ZM10.6111 20.4844C11.0713 20.4844 11.4444 20.0991 11.4444 19.6238C11.4444 19.1484 11.0713 18.7631 10.6111 18.7631C10.1509 18.7631 9.77778 19.1484 9.77778 19.6238C9.77778 20.0991 10.1509 20.4844 10.6111 20.4844ZM14.2222 19.6238C14.2222 20.0991 13.8491 20.4844 13.3889 20.4844C12.9287 20.4844 12.5556 20.0991 12.5556 19.6238C12.5556 19.1484 12.9287 18.7631 13.3889 18.7631C13.8491 18.7631 14.2222 19.1484 14.2222 19.6238ZM16.1667 20.4844C16.6269 20.4844 17 20.0991 17 19.6238C17 19.1484 16.6269 18.7631 16.1667 18.7631C15.7064 18.7631 15.3333 19.1484 15.3333 19.6238C15.3333 20.0991 15.7064 20.4844 16.1667 20.4844ZM19.7778 19.6238C19.7778 20.0991 19.4047 20.4844 18.9444 20.4844C18.4842 20.4844 18.1111 20.0991 18.1111 19.6238C18.1111 19.1484 18.4842 18.7631 18.9444 18.7631C19.4047 18.7631 19.7778 19.1484 19.7778 19.6238Z", fill: "currentColor" })
|
|
9799
|
+
React5.createElement("path", { d: "M14.3686 12.0003L21.0003 5.36856L18.6317 3L12 9.63169L5.36856 3.00025L3 5.36881L9.63144 12.0003L3 18.6317L5.36856 21.0003L12 14.3688L18.6317 21.0005L21.0003 18.6319L14.3686 12.0003Z", fill: "currentColor" })
|
|
9800
9800
|
)
|
|
9801
9801
|
);
|
|
9802
9802
|
});
|
|
9803
|
-
|
|
9804
|
-
var
|
|
9803
|
+
Clear.displayName = "Clear";
|
|
9804
|
+
var Clear_default = Clear;
|
|
9805
9805
|
|
|
9806
|
-
//
|
|
9806
|
+
// node_modules/@procore/core-icons/dist/icons/Excavator.js
|
|
9807
9807
|
var React6 = __toESM(require("react"));
|
|
9808
|
-
var
|
|
9808
|
+
var Excavator = React6.forwardRef(function Excavator2(props, ref) {
|
|
9809
9809
|
return React6.createElement(
|
|
9810
9810
|
Icon,
|
|
9811
|
-
__assign({}, props, { name: "
|
|
9811
|
+
__assign({}, props, { name: "Excavator" }),
|
|
9812
9812
|
React6.createElement(
|
|
9813
9813
|
"svg",
|
|
9814
9814
|
{ width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
|
|
9815
|
-
React6.createElement("path", { d: "
|
|
9816
|
-
React6.createElement("path", { d: "
|
|
9817
|
-
React6.createElement("path", { d: "M16.2319 13.25H3V10.75H16.2336L12.2665 6.78227L14.0344 5.01465L21.0179 11.9993L14.034 18.9839L12.2661 17.2162L16.2319 13.25Z", fill: "currentColor" })
|
|
9815
|
+
React6.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.54979 2H8.26065L11.4955 8H17.5V12.5L20 14.5V16H9.5V8.5L7.27126 3.72125H6.64878L3.82536 10.525H7.55556L6.32099 13.9675H2V10.525V10.5L5.54979 2ZM15.3333 10.0325H12V12.3275H15.3333V10.0325Z", fill: "currentColor" }),
|
|
9816
|
+
React6.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.55556 19.705C7.55556 18.4375 8.55048 17.41 9.77778 17.41H19.7778C21.0051 17.41 22 18.4375 22 19.705C22 20.9725 21.0051 22 19.7778 22H9.77778C8.55048 22 7.55556 20.9725 7.55556 19.705ZM10.6111 20.4844C11.0713 20.4844 11.4444 20.0991 11.4444 19.6238C11.4444 19.1484 11.0713 18.7631 10.6111 18.7631C10.1509 18.7631 9.77778 19.1484 9.77778 19.6238C9.77778 20.0991 10.1509 20.4844 10.6111 20.4844ZM14.2222 19.6238C14.2222 20.0991 13.8491 20.4844 13.3889 20.4844C12.9287 20.4844 12.5556 20.0991 12.5556 19.6238C12.5556 19.1484 12.9287 18.7631 13.3889 18.7631C13.8491 18.7631 14.2222 19.1484 14.2222 19.6238ZM16.1667 20.4844C16.6269 20.4844 17 20.0991 17 19.6238C17 19.1484 16.6269 18.7631 16.1667 18.7631C15.7064 18.7631 15.3333 19.1484 15.3333 19.6238C15.3333 20.0991 15.7064 20.4844 16.1667 20.4844ZM19.7778 19.6238C19.7778 20.0991 19.4047 20.4844 18.9444 20.4844C18.4842 20.4844 18.1111 20.0991 18.1111 19.6238C18.1111 19.1484 18.4842 18.7631 18.9444 18.7631C19.4047 18.7631 19.7778 19.1484 19.7778 19.6238Z", fill: "currentColor" })
|
|
9818
9817
|
)
|
|
9819
9818
|
);
|
|
9820
9819
|
});
|
|
9821
|
-
|
|
9822
|
-
var
|
|
9820
|
+
Excavator.displayName = "Excavator";
|
|
9821
|
+
var Excavator_default = Excavator;
|
|
9823
9822
|
|
|
9824
|
-
//
|
|
9823
|
+
// node_modules/@procore/core-icons/dist/icons/ExpandSidebar.js
|
|
9825
9824
|
var React7 = __toESM(require("react"));
|
|
9826
|
-
var
|
|
9825
|
+
var ExpandSidebar = React7.forwardRef(function ExpandSidebar2(props, ref) {
|
|
9827
9826
|
return React7.createElement(
|
|
9828
9827
|
Icon,
|
|
9829
|
-
__assign({}, props, { name: "
|
|
9828
|
+
__assign({}, props, { name: "ExpandSidebar" }),
|
|
9830
9829
|
React7.createElement(
|
|
9831
9830
|
"svg",
|
|
9832
9831
|
{ width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
|
|
9833
|
-
React7.createElement("path", {
|
|
9832
|
+
React7.createElement("path", { d: "M3 6.5H11V9H3V6.5Z", fill: "currentColor" }),
|
|
9833
|
+
React7.createElement("path", { d: "M3 15H11V17.5H3V15Z", fill: "currentColor" }),
|
|
9834
|
+
React7.createElement("path", { d: "M16.2319 13.25H3V10.75H16.2336L12.2665 6.78227L14.0344 5.01465L21.0179 11.9993L14.034 18.9839L12.2661 17.2162L16.2319 13.25Z", fill: "currentColor" })
|
|
9834
9835
|
)
|
|
9835
9836
|
);
|
|
9836
9837
|
});
|
|
9837
|
-
|
|
9838
|
-
var
|
|
9838
|
+
ExpandSidebar.displayName = "ExpandSidebar";
|
|
9839
|
+
var ExpandSidebar_default = ExpandSidebar;
|
|
9839
9840
|
|
|
9840
|
-
//
|
|
9841
|
+
// node_modules/@procore/core-icons/dist/icons/Help.js
|
|
9841
9842
|
var React8 = __toESM(require("react"));
|
|
9842
|
-
var
|
|
9843
|
+
var Help = React8.forwardRef(function Help2(props, ref) {
|
|
9843
9844
|
return React8.createElement(
|
|
9844
9845
|
Icon,
|
|
9845
|
-
__assign({}, props, { name: "
|
|
9846
|
+
__assign({}, props, { name: "Help" }),
|
|
9846
9847
|
React8.createElement(
|
|
9847
9848
|
"svg",
|
|
9848
9849
|
{ width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
|
|
9849
|
-
React8.createElement("path", { d: "
|
|
9850
|
-
React8.createElement("path", { d: "M15 10.5C15 10.501 15 10.502 15 10.503V10.5269C14.9854 12.1712 13.6478 13.5 12 13.5L10.5 13.5V16.5H12C15.1813 16.5 17.7844 14.0241 17.9873 10.894L18.0086 10.9064L18.0001 10.8343L18 7.5C18 4.18629 15.3137 1.5 12 1.5H7.5C4.18629 1.5 1.5 4.18629 1.5 7.5V10.5C1.5 12.7208 2.7066 14.6599 4.5 15.6973L4.5 7.5C4.5 5.84315 5.84315 4.5 7.5 4.5L12 4.5C13.6569 4.5 15 5.84315 15 7.5H14.9867L15 7.52707L15 10.5Z", fill: "currentColor" })
|
|
9850
|
+
React8.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M22.5 12C22.5 17.799 17.799 22.5 12 22.5C6.20101 22.5 1.5 17.799 1.5 12C1.5 6.20101 6.20101 1.5 12 1.5C17.799 1.5 22.5 6.20101 22.5 12ZM10.5263 7.95937C10.2808 8.36033 10.1916 8.91994 10.1916 9.37657H7.5C7.5 8.66165 7.62111 7.4859 8.25879 6.44439C8.95769 5.30289 10.172 4.5 11.9579 4.5C13.5589 4.5 14.7796 4.98286 15.5728 5.91817C16.3382 6.82071 16.5 7.90665 16.5 8.67364C16.5 10.8341 15.0595 12.1455 13.8423 12.7536C13.5724 12.8885 13.381 13.0989 13.2617 13.2697V14.25H10.5701V13.1798C10.5701 12.8171 10.6368 12.3478 10.903 11.8984C11.162 11.4612 11.7165 10.699 12.681 10.2171C13.3984 9.85866 13.8084 9.32492 13.8084 8.67364C13.8084 8.26908 13.7179 7.97113 13.5581 7.78266C13.426 7.62697 13.0486 7.31172 11.9579 7.31172C11.0523 7.31172 10.7105 7.65841 10.5263 7.95937ZM11.954 19.5059C12.925 19.5059 13.7121 18.7187 13.7121 17.7477C13.7121 16.7767 12.925 15.9895 11.954 15.9895C10.9829 15.9895 10.1958 16.7767 10.1958 17.7477C10.1958 18.7187 10.9829 19.5059 11.954 19.5059Z", fill: "currentColor" })
|
|
9851
9851
|
)
|
|
9852
9852
|
);
|
|
9853
9853
|
});
|
|
9854
|
-
|
|
9855
|
-
var
|
|
9854
|
+
Help.displayName = "Help";
|
|
9855
|
+
var Help_default = Help;
|
|
9856
9856
|
|
|
9857
|
-
//
|
|
9857
|
+
// node_modules/@procore/core-icons/dist/icons/Link.js
|
|
9858
9858
|
var React9 = __toESM(require("react"));
|
|
9859
|
-
var
|
|
9859
|
+
var Link = React9.forwardRef(function Link2(props, ref) {
|
|
9860
9860
|
return React9.createElement(
|
|
9861
9861
|
Icon,
|
|
9862
|
-
__assign({}, props, { name: "
|
|
9862
|
+
__assign({}, props, { name: "Link" }),
|
|
9863
9863
|
React9.createElement(
|
|
9864
9864
|
"svg",
|
|
9865
9865
|
{ width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
|
|
9866
|
-
React9.createElement("path", { d: "
|
|
9866
|
+
React9.createElement("path", { d: "M6.01273 13.106C6.21565 9.97594 8.81868 7.5 12 7.5H13.5V10.5L12 10.5C10.3431 10.5 9 11.8431 9 13.5L9 16.5C9 18.1569 10.3431 19.5 12 19.5H16.5C18.1569 19.5 19.5 18.1569 19.5 16.5L19.5 8.30269C21.2934 9.34012 22.5 11.2792 22.5 13.5V16.5C22.5 19.8137 19.8137 22.5 16.5 22.5H12C8.68629 22.5 6 19.8137 6 16.5L6 13.0987L6.01273 13.106Z", fill: "currentColor" }),
|
|
9867
|
+
React9.createElement("path", { d: "M15 10.5C15 10.501 15 10.502 15 10.503V10.5269C14.9854 12.1712 13.6478 13.5 12 13.5L10.5 13.5V16.5H12C15.1813 16.5 17.7844 14.0241 17.9873 10.894L18.0086 10.9064L18.0001 10.8343L18 7.5C18 4.18629 15.3137 1.5 12 1.5H7.5C4.18629 1.5 1.5 4.18629 1.5 7.5V10.5C1.5 12.7208 2.7066 14.6599 4.5 15.6973L4.5 7.5C4.5 5.84315 5.84315 4.5 7.5 4.5L12 4.5C13.6569 4.5 15 5.84315 15 7.5H14.9867L15 7.52707L15 10.5Z", fill: "currentColor" })
|
|
9867
9868
|
)
|
|
9868
9869
|
);
|
|
9869
9870
|
});
|
|
9870
|
-
|
|
9871
|
-
var
|
|
9871
|
+
Link.displayName = "Link";
|
|
9872
|
+
var Link_default = Link;
|
|
9872
9873
|
|
|
9873
|
-
//
|
|
9874
|
+
// node_modules/@procore/core-icons/dist/icons/Person.js
|
|
9874
9875
|
var React10 = __toESM(require("react"));
|
|
9875
|
-
var
|
|
9876
|
+
var Person = React10.forwardRef(function Person2(props, ref) {
|
|
9876
9877
|
return React10.createElement(
|
|
9877
9878
|
Icon,
|
|
9878
|
-
__assign({}, props, { name: "
|
|
9879
|
+
__assign({}, props, { name: "Person" }),
|
|
9879
9880
|
React10.createElement(
|
|
9880
9881
|
"svg",
|
|
9881
9882
|
{ width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
|
|
9882
|
-
React10.createElement("path", { d: "
|
|
9883
|
+
React10.createElement("path", { d: "M12 12C14.21 12 16 10.21 16 8C16 5.79 14.21 4 12 4C9.79 4 8 5.79 8 8C8 10.21 9.79 12 12 12ZM12 14C9.33 14 4 15.34 4 18V20H20V18C20 15.34 14.67 14 12 14Z", fill: "currentColor" })
|
|
9884
|
+
)
|
|
9885
|
+
);
|
|
9886
|
+
});
|
|
9887
|
+
Person.displayName = "Person";
|
|
9888
|
+
var Person_default = Person;
|
|
9889
|
+
|
|
9890
|
+
// node_modules/@procore/core-icons/dist/icons/Plus.js
|
|
9891
|
+
var React11 = __toESM(require("react"));
|
|
9892
|
+
var Plus = React11.forwardRef(function Plus2(props, ref) {
|
|
9893
|
+
return React11.createElement(
|
|
9894
|
+
Icon,
|
|
9895
|
+
__assign({}, props, { name: "Plus" }),
|
|
9896
|
+
React11.createElement(
|
|
9897
|
+
"svg",
|
|
9898
|
+
{ width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
|
|
9899
|
+
React11.createElement("path", { d: "M13.25 5H10.75V10.75H5V13.25H10.75V19H13.25V13.25H19V10.75H13.25V5Z", fill: "currentColor" })
|
|
9883
9900
|
)
|
|
9884
9901
|
);
|
|
9885
9902
|
});
|
|
@@ -9890,7 +9907,7 @@ var Plus_default = Plus;
|
|
|
9890
9907
|
var import_core_react2 = require("@procore/core-react");
|
|
9891
9908
|
var import_react3 = __toESM(require("react"));
|
|
9892
9909
|
|
|
9893
|
-
// node_modules/styled-components/dist/styled-components.esm.js
|
|
9910
|
+
// ../../node_modules/styled-components/dist/styled-components.esm.js
|
|
9894
9911
|
var import_react_is = __toESM(require_react_is());
|
|
9895
9912
|
var import_react = __toESM(require("react"));
|
|
9896
9913
|
var import_shallowequal = __toESM(require_shallowequal());
|
|
@@ -10445,7 +10462,7 @@ function memoize(fn) {
|
|
|
10445
10462
|
};
|
|
10446
10463
|
}
|
|
10447
10464
|
|
|
10448
|
-
// ../../node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
|
|
10465
|
+
// ../../node_modules/styled-components/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
|
|
10449
10466
|
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
|
|
10450
10467
|
var isPropValid = /* @__PURE__ */ memoize(
|
|
10451
10468
|
function(prop) {
|
|
@@ -10454,7 +10471,7 @@ var isPropValid = /* @__PURE__ */ memoize(
|
|
|
10454
10471
|
/* Z+1 */
|
|
10455
10472
|
);
|
|
10456
10473
|
|
|
10457
|
-
// node_modules/styled-components/dist/styled-components.esm.js
|
|
10474
|
+
// ../../node_modules/styled-components/dist/styled-components.esm.js
|
|
10458
10475
|
var import_hoist_non_react_statics = __toESM(require_hoist_non_react_statics_cjs());
|
|
10459
10476
|
function m() {
|
|
10460
10477
|
return (m = Object.assign || function(e2) {
|
|
@@ -11185,7 +11202,7 @@ var useSavedViewsPanel_default = useSavedViewsPanel;
|
|
|
11185
11202
|
|
|
11186
11203
|
// src/SavedViews/components/MenuItems/SavedViewsCollectionsMenuItem.tsx
|
|
11187
11204
|
var import_core_react3 = require("@procore/core-react");
|
|
11188
|
-
var
|
|
11205
|
+
var React15 = __toESM(require("react"));
|
|
11189
11206
|
var import_toast_alert = require("@procore/toast-alert");
|
|
11190
11207
|
var RowActionsBox = styled_components_esm_default(import_core_react3.Flex)`
|
|
11191
11208
|
justify-content: center;
|
|
@@ -11202,7 +11219,7 @@ var Container2 = styled_components_esm_default(import_core_react3.Flex)`
|
|
|
11202
11219
|
${({ "aria-selected": selected }) => selected ? "color: hsl(218, 75%, 45%);" : ""}
|
|
11203
11220
|
`;
|
|
11204
11221
|
var SavedViewCollectionMenuItem = (props) => {
|
|
11205
|
-
const onClick =
|
|
11222
|
+
const onClick = React15.useCallback(
|
|
11206
11223
|
(a2) => {
|
|
11207
11224
|
var _a, _b;
|
|
11208
11225
|
if (!props.item) {
|
|
@@ -11231,11 +11248,12 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11231
11248
|
const copyShareLink = async (event) => {
|
|
11232
11249
|
event.stopPropagation();
|
|
11233
11250
|
try {
|
|
11234
|
-
const
|
|
11235
|
-
|
|
11251
|
+
const { origin, pathname } = window.location;
|
|
11252
|
+
const shareUrl = new URL(`${origin}${pathname}`);
|
|
11253
|
+
shareUrl.searchParams.set("saved-view", props.item.share_token);
|
|
11254
|
+
await navigator.clipboard.writeText(shareUrl.toString());
|
|
11236
11255
|
showToast.success(i18n.t("savedViews.actions.linkCopied"));
|
|
11237
11256
|
} catch (error) {
|
|
11238
|
-
console.error("Failed to copy link:", error);
|
|
11239
11257
|
showToast.error(i18n.t("savedViews.errors.copyFailed"));
|
|
11240
11258
|
}
|
|
11241
11259
|
};
|
|
@@ -11249,7 +11267,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11249
11267
|
label: i18n.t("savedViews.actions.delete")
|
|
11250
11268
|
}
|
|
11251
11269
|
];
|
|
11252
|
-
return /* @__PURE__ */
|
|
11270
|
+
return /* @__PURE__ */ React15.createElement(
|
|
11253
11271
|
Container2,
|
|
11254
11272
|
{
|
|
11255
11273
|
"aria-selected": Boolean(props.selected),
|
|
@@ -11260,7 +11278,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11260
11278
|
}),
|
|
11261
11279
|
"data-testid": "saved-view-collection-menu-item"
|
|
11262
11280
|
},
|
|
11263
|
-
/* @__PURE__ */
|
|
11281
|
+
/* @__PURE__ */ React15.createElement(
|
|
11264
11282
|
"span",
|
|
11265
11283
|
{
|
|
11266
11284
|
"data-testid": "saved-view-display-name",
|
|
@@ -11268,7 +11286,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11268
11286
|
},
|
|
11269
11287
|
props.item.name
|
|
11270
11288
|
),
|
|
11271
|
-
/* @__PURE__ */
|
|
11289
|
+
/* @__PURE__ */ React15.createElement(RowActionsBox, null, /* @__PURE__ */ React15.createElement(import_core_react3.Box, { justifyContent: "space-between" }, props.item.id !== "default" && props.canUpdate && /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(
|
|
11272
11290
|
import_core_react3.Button,
|
|
11273
11291
|
{
|
|
11274
11292
|
onClick: updateItem,
|
|
@@ -11279,7 +11297,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11279
11297
|
loading: props.isUpdateProcessing
|
|
11280
11298
|
},
|
|
11281
11299
|
i18n.t("savedViews.actions.update")
|
|
11282
|
-
)), props.item.id !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary" && /* @__PURE__ */
|
|
11300
|
+
)), props.item.id !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary" && /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(
|
|
11283
11301
|
import_core_react3.Button,
|
|
11284
11302
|
{
|
|
11285
11303
|
onClick: copyShareLink,
|
|
@@ -11288,8 +11306,23 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11288
11306
|
"aria-label": i18n.t("savedViews.actions.copyShareLink"),
|
|
11289
11307
|
"data-testid": "copy-share-link-button"
|
|
11290
11308
|
},
|
|
11291
|
-
/* @__PURE__ */
|
|
11292
|
-
))
|
|
11309
|
+
/* @__PURE__ */ React15.createElement(Link_default, { size: "sm" })
|
|
11310
|
+
)), props.item.id === "temporary" && /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(
|
|
11311
|
+
import_core_react3.Button,
|
|
11312
|
+
{
|
|
11313
|
+
onClick: (e2) => {
|
|
11314
|
+
var _a;
|
|
11315
|
+
e2.stopPropagation();
|
|
11316
|
+
(_a = props.onClearTemporary) == null ? void 0 : _a.call(props);
|
|
11317
|
+
},
|
|
11318
|
+
variant: "tertiary",
|
|
11319
|
+
size: "sm",
|
|
11320
|
+
"aria-label": i18n.t("savedViews.actions.clearTemporary"),
|
|
11321
|
+
title: i18n.t("savedViews.actions.clearTemporary"),
|
|
11322
|
+
"data-testid": "clear-temporary-view-button"
|
|
11323
|
+
},
|
|
11324
|
+
/* @__PURE__ */ React15.createElement(Clear_default, { size: "sm" })
|
|
11325
|
+
))), /* @__PURE__ */ React15.createElement(import_core_react3.Box, null, props.item.id !== "default" && props.canEditOrDelete && /* @__PURE__ */ React15.createElement("div", { onClick: (e2) => e2.stopPropagation() }, /* @__PURE__ */ React15.createElement(
|
|
11293
11326
|
import_core_react3.DropdownFlyout,
|
|
11294
11327
|
{
|
|
11295
11328
|
"data-testid": "saved-view-overflow-button",
|
|
@@ -11317,7 +11350,7 @@ var import_core_react7 = require("@procore/core-react");
|
|
|
11317
11350
|
var import_toast_alert2 = require("@procore/toast-alert");
|
|
11318
11351
|
var import_react9 = __toESM(require("react"));
|
|
11319
11352
|
|
|
11320
|
-
//
|
|
11353
|
+
// node_modules/@procore/core-http/dist/modern/index.js
|
|
11321
11354
|
function getCSRFToken() {
|
|
11322
11355
|
const token = document.cookie.match("(^|;)\\s*csrf_token\\s*=\\s*([^;]+)");
|
|
11323
11356
|
return token ? decodeURIComponent(token.pop() || "") : "";
|
|
@@ -11374,7 +11407,7 @@ var useApiRequest = (props, method, mutationKey) => {
|
|
|
11374
11407
|
mutationFn: async (savedView) => {
|
|
11375
11408
|
let url = "";
|
|
11376
11409
|
if (method === "DELETE" || method === "PUT") {
|
|
11377
|
-
url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedView.
|
|
11410
|
+
url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedView.share_token}?permissions_domain=${domain}`;
|
|
11378
11411
|
} else {
|
|
11379
11412
|
url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views?table_name=${tableName}&permissions_domain=${domain}`;
|
|
11380
11413
|
}
|
|
@@ -11403,7 +11436,9 @@ var useApiRequest = (props, method, mutationKey) => {
|
|
|
11403
11436
|
domain,
|
|
11404
11437
|
tableName
|
|
11405
11438
|
]);
|
|
11406
|
-
const oldView = oldData == null ? void 0 : oldData.find(
|
|
11439
|
+
const oldView = oldData == null ? void 0 : oldData.find(
|
|
11440
|
+
(item) => item.share_token === savedView.share_token
|
|
11441
|
+
);
|
|
11407
11442
|
if ((oldView == null ? void 0 : oldView.name) !== savedView.name) {
|
|
11408
11443
|
queryClient2.invalidateQueries({
|
|
11409
11444
|
queryKey: ["savedViews", domain, tableName]
|
|
@@ -11417,7 +11452,7 @@ var useApiRequest = (props, method, mutationKey) => {
|
|
|
11417
11452
|
if (!oldData)
|
|
11418
11453
|
return [savedView];
|
|
11419
11454
|
return oldData.map(
|
|
11420
|
-
(item) => item.
|
|
11455
|
+
(item) => item.share_token === savedView.share_token ? savedView : item
|
|
11421
11456
|
);
|
|
11422
11457
|
}
|
|
11423
11458
|
);
|
|
@@ -11434,7 +11469,6 @@ var useSavedViewsQuery = (props) => {
|
|
|
11434
11469
|
const { projectId, companyId, domain, tableName } = props;
|
|
11435
11470
|
const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views?table_name=${tableName}&permissions_domain=${domain}`;
|
|
11436
11471
|
return (0, import_react_query2.useQuery)({
|
|
11437
|
-
enabled: props.enableSavedViews,
|
|
11438
11472
|
queryKey: ["savedViews", domain, tableName],
|
|
11439
11473
|
queryFn: async () => {
|
|
11440
11474
|
const getUrl2 = `${url}&per_page=${PAGE_SIZE}`;
|
|
@@ -11447,7 +11481,6 @@ var useSavedViewsPermissions = (props) => {
|
|
|
11447
11481
|
const { projectId, companyId, domain } = props;
|
|
11448
11482
|
const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/permissions?permissions_domain=${domain}`;
|
|
11449
11483
|
return (0, import_react_query2.useQuery)({
|
|
11450
|
-
enabled: props.enableSavedViews,
|
|
11451
11484
|
queryKey: ["savedViewsConfig", domain],
|
|
11452
11485
|
queryFn: async () => {
|
|
11453
11486
|
const response = await requestJSON(url);
|
|
@@ -11470,13 +11503,13 @@ var useDeleteSavedView = (props) => useApiRequest(props, "DELETE", [
|
|
|
11470
11503
|
props.domain,
|
|
11471
11504
|
props.tableName
|
|
11472
11505
|
]);
|
|
11473
|
-
var useFetchSavedViewById = (
|
|
11506
|
+
var useFetchSavedViewById = (savedViewToken, queryInput, enabled = true) => {
|
|
11474
11507
|
const { projectId, companyId } = queryInput;
|
|
11475
11508
|
return (0, import_react_query2.useQuery)({
|
|
11476
|
-
enabled: enabled && Boolean(
|
|
11477
|
-
queryKey: ["savedView",
|
|
11509
|
+
enabled: enabled && Boolean(savedViewToken),
|
|
11510
|
+
queryKey: ["savedView", savedViewToken],
|
|
11478
11511
|
queryFn: async () => {
|
|
11479
|
-
const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${
|
|
11512
|
+
const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedViewToken}`;
|
|
11480
11513
|
const response = await requestJSON(url);
|
|
11481
11514
|
return response.data;
|
|
11482
11515
|
}
|
|
@@ -11555,7 +11588,7 @@ var getColumnIdentifier = (col) => {
|
|
|
11555
11588
|
}
|
|
11556
11589
|
return "";
|
|
11557
11590
|
};
|
|
11558
|
-
var updateTableConfig = (view, tableApi, provider
|
|
11591
|
+
var updateTableConfig = (view, tableApi, provider) => {
|
|
11559
11592
|
if (provider === "smart-grid") {
|
|
11560
11593
|
setSmartGridConfig(
|
|
11561
11594
|
tableApi,
|
|
@@ -11570,9 +11603,6 @@ var updateTableConfig = (view, tableApi, provider, onTableConfigChange) => {
|
|
|
11570
11603
|
dataTableApi == null ? void 0 : dataTableApi.setRowHeight(rowHeight);
|
|
11571
11604
|
}
|
|
11572
11605
|
dataTableApi == null ? void 0 : dataTableApi.setTableConfiguration(tableConfig);
|
|
11573
|
-
if (onTableConfigChange) {
|
|
11574
|
-
onTableConfigChange(tableConfig);
|
|
11575
|
-
}
|
|
11576
11606
|
}
|
|
11577
11607
|
}
|
|
11578
11608
|
};
|
|
@@ -11751,12 +11781,11 @@ var Panel2 = styled_components_esm_default(import_core_react7.DetailPage.Card)`
|
|
|
11751
11781
|
box-shadow: none;
|
|
11752
11782
|
`;
|
|
11753
11783
|
var PanelContent = (props) => {
|
|
11754
|
-
var _a, _b;
|
|
11784
|
+
var _a, _b, _c;
|
|
11755
11785
|
const { showToast } = (0, import_toast_alert2.useToastAlertContext)();
|
|
11756
11786
|
const I18n = (0, import_core_react7.useI18nContext)();
|
|
11757
11787
|
const { mutate: updateSavedView, isPending: isUpdateLoading } = useUpdateSavedView(props.queryInput);
|
|
11758
|
-
const {
|
|
11759
|
-
const savedViews = props.savedViews ?? savedViewsFromQuery;
|
|
11788
|
+
const { error: savedViewsError } = useSavedViewsQuery(props.queryInput);
|
|
11760
11789
|
const errorToastRef = import_react9.default.useRef(null);
|
|
11761
11790
|
import_react9.default.useEffect(() => {
|
|
11762
11791
|
if (savedViewsError && savedViewsError !== errorToastRef.current) {
|
|
@@ -11765,7 +11794,7 @@ var PanelContent = (props) => {
|
|
|
11765
11794
|
}
|
|
11766
11795
|
}, [savedViewsError, showToast, I18n]);
|
|
11767
11796
|
const { data: permissions } = useSavedViewsPermissions(props.queryInput);
|
|
11768
|
-
const selectedRowRef = useScrollToRef(savedViews);
|
|
11797
|
+
const selectedRowRef = useScrollToRef(props.savedViews);
|
|
11769
11798
|
const onUpdate = (data) => {
|
|
11770
11799
|
const newSavedView = {
|
|
11771
11800
|
...data,
|
|
@@ -11775,8 +11804,7 @@ var PanelContent = (props) => {
|
|
|
11775
11804
|
updateSavedView(newSavedView, {
|
|
11776
11805
|
onSuccess: () => {
|
|
11777
11806
|
showToast.success(I18n.t("savedViews.update.success"));
|
|
11778
|
-
props.
|
|
11779
|
-
props.setSelectedSavedView(newSavedView);
|
|
11807
|
+
props.onSelect({ item: newSavedView });
|
|
11780
11808
|
},
|
|
11781
11809
|
onError: () => {
|
|
11782
11810
|
showToast.error(I18n.t("savedViews.errors.update"));
|
|
@@ -11786,7 +11814,9 @@ var PanelContent = (props) => {
|
|
|
11786
11814
|
const { groups, toggleGroup } = useGroups();
|
|
11787
11815
|
const isDefaultSelected = ((_a = props.selectedSavedView) == null ? void 0 : _a.id) === "default";
|
|
11788
11816
|
const isTemporarySelected = ((_b = props.selectedSavedView) == null ? void 0 : _b.id) === "temporary";
|
|
11789
|
-
const temporaryView = savedViews == null ? void 0 :
|
|
11817
|
+
const temporaryView = (_c = props.savedViews) == null ? void 0 : _c.find(
|
|
11818
|
+
(view) => view.id === "temporary"
|
|
11819
|
+
);
|
|
11790
11820
|
return /* @__PURE__ */ import_react9.default.createElement(Panel2, { "data-testid": "inner-panel" }, /* @__PURE__ */ import_react9.default.createElement(import_core_react7.Flex, { direction: "column", style: { height: "100%", width: "100%" } }, temporaryView && /* @__PURE__ */ import_react9.default.createElement(
|
|
11791
11821
|
Row,
|
|
11792
11822
|
{
|
|
@@ -11798,7 +11828,8 @@ var PanelContent = (props) => {
|
|
|
11798
11828
|
SavedViewCollectionMenuItem,
|
|
11799
11829
|
{
|
|
11800
11830
|
item: temporaryView,
|
|
11801
|
-
selected: isTemporarySelected
|
|
11831
|
+
selected: isTemporarySelected,
|
|
11832
|
+
onClearTemporary: props.onClearTemporary
|
|
11802
11833
|
}
|
|
11803
11834
|
)
|
|
11804
11835
|
), /* @__PURE__ */ import_react9.default.createElement(
|
|
@@ -11817,7 +11848,7 @@ var PanelContent = (props) => {
|
|
|
11817
11848
|
)
|
|
11818
11849
|
), VIEW_LEVELS.map((level) => {
|
|
11819
11850
|
const isExpanded = groups[level];
|
|
11820
|
-
const views = isExpanded && savedViews ? savedViews.filter(
|
|
11851
|
+
const views = isExpanded && props.savedViews ? props.savedViews.filter(
|
|
11821
11852
|
(view) => view.view_level === level && view.id !== "temporary"
|
|
11822
11853
|
) : [];
|
|
11823
11854
|
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, { key: level }, /* @__PURE__ */ import_react9.default.createElement(
|
|
@@ -11869,7 +11900,7 @@ var PanelContent = (props) => {
|
|
|
11869
11900
|
};
|
|
11870
11901
|
|
|
11871
11902
|
// src/SavedViews/components/SavedViews/SmartGrid/SmartGridSavedViews.tsx
|
|
11872
|
-
var
|
|
11903
|
+
var import_react15 = __toESM(require("react"));
|
|
11873
11904
|
|
|
11874
11905
|
// src/SavedViews/components/SavedViews/SmartGrid/SmartGridDefaultSavedView.tsx
|
|
11875
11906
|
var import_core_react8 = require("@procore/core-react");
|
|
@@ -11930,7 +11961,7 @@ var useSmartGridConfig = (gridApi) => {
|
|
|
11930
11961
|
|
|
11931
11962
|
// src/SavedViews/components/SavedViews/SavedViews.tsx
|
|
11932
11963
|
var import_core_react13 = require("@procore/core-react");
|
|
11933
|
-
var
|
|
11964
|
+
var import_react14 = __toESM(require("react"));
|
|
11934
11965
|
var import_react_query3 = require("@tanstack/react-query");
|
|
11935
11966
|
|
|
11936
11967
|
// src/SavedViews/components/SavedViewsModals/SavedViewsDeleteConfirmationModalShared.tsx
|
|
@@ -11962,7 +11993,7 @@ var import_react12 = __toESM(require("react"));
|
|
|
11962
11993
|
|
|
11963
11994
|
// src/SavedViews/components/SavedViewsModals/SavedViewsCreateUpdateModalBase.tsx
|
|
11964
11995
|
var import_core_react10 = require("@procore/core-react");
|
|
11965
|
-
var
|
|
11996
|
+
var React19 = __toESM(require("react"));
|
|
11966
11997
|
|
|
11967
11998
|
// ../../node_modules/yup/index.esm.js
|
|
11968
11999
|
var import_property_expr = __toESM(require_property_expr());
|
|
@@ -14305,7 +14336,6 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14305
14336
|
tableName,
|
|
14306
14337
|
defaultView,
|
|
14307
14338
|
selectedSavedView,
|
|
14308
|
-
setSelectedSavedView,
|
|
14309
14339
|
setOpenEditCreateModal,
|
|
14310
14340
|
onSelect
|
|
14311
14341
|
}) => {
|
|
@@ -14343,8 +14373,8 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14343
14373
|
};
|
|
14344
14374
|
updateSavedView(body, {
|
|
14345
14375
|
onSuccess: (updatedSavedView) => {
|
|
14376
|
+
onSelect(updatedSavedView);
|
|
14346
14377
|
setOpenEditCreateModal(false);
|
|
14347
|
-
setSelectedSavedView(updatedSavedView);
|
|
14348
14378
|
}
|
|
14349
14379
|
});
|
|
14350
14380
|
} else {
|
|
@@ -14363,7 +14393,7 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14363
14393
|
}
|
|
14364
14394
|
};
|
|
14365
14395
|
const viewLevelOptions = getViewLevelOptions(permissions, I18n);
|
|
14366
|
-
return /* @__PURE__ */
|
|
14396
|
+
return /* @__PURE__ */ React19.createElement(
|
|
14367
14397
|
import_core_react10.Modal,
|
|
14368
14398
|
{
|
|
14369
14399
|
"aria-label": I18n.t("savedViews.ariaLabels.modal"),
|
|
@@ -14372,14 +14402,14 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14372
14402
|
style: { width: "540px" },
|
|
14373
14403
|
"data-testid": "create-update-modal"
|
|
14374
14404
|
},
|
|
14375
|
-
/* @__PURE__ */
|
|
14405
|
+
/* @__PURE__ */ React19.createElement(ScrollContainer, null, /* @__PURE__ */ React19.createElement(
|
|
14376
14406
|
import_core_react10.Modal.Header,
|
|
14377
14407
|
{
|
|
14378
14408
|
onClose,
|
|
14379
14409
|
style: { borderBottom: `1px solid ${import_core_react10.colors.gray85}` }
|
|
14380
14410
|
},
|
|
14381
|
-
/* @__PURE__ */
|
|
14382
|
-
), /* @__PURE__ */
|
|
14411
|
+
/* @__PURE__ */ React19.createElement(import_core_react10.H2, null, header)
|
|
14412
|
+
), /* @__PURE__ */ React19.createElement(
|
|
14383
14413
|
import_core_react10.Form,
|
|
14384
14414
|
{
|
|
14385
14415
|
initialValues: {
|
|
@@ -14405,13 +14435,13 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14405
14435
|
onReset: onCancel,
|
|
14406
14436
|
validateOnChange: true
|
|
14407
14437
|
},
|
|
14408
|
-
/* @__PURE__ */
|
|
14438
|
+
/* @__PURE__ */ React19.createElement(import_core_react10.Form.Form, { name: header }, /* @__PURE__ */ React19.createElement(
|
|
14409
14439
|
import_core_react10.Modal.Body,
|
|
14410
14440
|
{
|
|
14411
14441
|
style: { paddingTop: 0, paddingBottom: 0, marginTop: import_core_react10.spacing.lg }
|
|
14412
14442
|
},
|
|
14413
|
-
errors && /* @__PURE__ */
|
|
14414
|
-
/* @__PURE__ */
|
|
14443
|
+
errors && /* @__PURE__ */ React19.createElement(import_core_react10.ErrorBanner, { style: { marginBottom: import_core_react10.spacing.xl } }, /* @__PURE__ */ React19.createElement(import_core_react10.Banner.Content, null, /* @__PURE__ */ React19.createElement(import_core_react10.Banner.Title, null, I18n.t("savedViews.modal.errors.title", { mode })), /* @__PURE__ */ React19.createElement(import_core_react10.Banner.Body, null, (errors == null ? void 0 : errors.form) || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
|
|
14444
|
+
/* @__PURE__ */ React19.createElement(import_core_react10.Form.Row, null, /* @__PURE__ */ React19.createElement(
|
|
14415
14445
|
import_core_react10.Form.Text,
|
|
14416
14446
|
{
|
|
14417
14447
|
name: "name",
|
|
@@ -14422,12 +14452,12 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14422
14452
|
onChange: () => resetMutations()
|
|
14423
14453
|
}
|
|
14424
14454
|
)),
|
|
14425
|
-
/* @__PURE__ */
|
|
14455
|
+
/* @__PURE__ */ React19.createElement(
|
|
14426
14456
|
import_core_react10.Form.Row,
|
|
14427
14457
|
{
|
|
14428
14458
|
style: { marginTop: (errors == null ? void 0 : errors.name) ? import_core_react10.spacing.xl : import_core_react10.spacing.none }
|
|
14429
14459
|
},
|
|
14430
|
-
/* @__PURE__ */
|
|
14460
|
+
/* @__PURE__ */ React19.createElement(
|
|
14431
14461
|
import_core_react10.Form.TextArea,
|
|
14432
14462
|
{
|
|
14433
14463
|
name: "description",
|
|
@@ -14438,7 +14468,7 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14438
14468
|
}
|
|
14439
14469
|
)
|
|
14440
14470
|
),
|
|
14441
|
-
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */
|
|
14471
|
+
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React19.createElement(import_core_react10.Form.Row, null, /* @__PURE__ */ React19.createElement(
|
|
14442
14472
|
import_core_react10.Form.Select,
|
|
14443
14473
|
{
|
|
14444
14474
|
name: "view_level",
|
|
@@ -14448,8 +14478,8 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14448
14478
|
onSearch: false,
|
|
14449
14479
|
onClear: false
|
|
14450
14480
|
}
|
|
14451
|
-
)) : /* @__PURE__ */
|
|
14452
|
-
), /* @__PURE__ */
|
|
14481
|
+
)) : /* @__PURE__ */ React19.createElement(React19.Fragment, null)
|
|
14482
|
+
), /* @__PURE__ */ React19.createElement(import_core_react10.Modal.Footer, { style: { borderTop: `1px solid ${import_core_react10.colors.gray85}` } }, /* @__PURE__ */ React19.createElement(import_core_react10.Flex, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React19.createElement(import_core_react10.Typography, { color: "gray45", italic: true }, /* @__PURE__ */ React19.createElement(import_core_react10.Typography, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React19.createElement(import_core_react10.Modal.FooterButtons, null, /* @__PURE__ */ React19.createElement(import_core_react10.Button, { type: "reset", variant: "tertiary", disabled: isLoading }, I18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React19.createElement(
|
|
14453
14483
|
import_core_react10.Button,
|
|
14454
14484
|
{
|
|
14455
14485
|
"data-testid": "create-update-modal-button",
|
|
@@ -14474,7 +14504,6 @@ var SavedViewsFormModal = ({
|
|
|
14474
14504
|
tableName,
|
|
14475
14505
|
queryInput,
|
|
14476
14506
|
selectedSavedView,
|
|
14477
|
-
setSelectedSavedView,
|
|
14478
14507
|
setOpenEditCreateModal,
|
|
14479
14508
|
onSelect,
|
|
14480
14509
|
defaultView
|
|
@@ -14493,7 +14522,6 @@ var SavedViewsFormModal = ({
|
|
|
14493
14522
|
tableConfig,
|
|
14494
14523
|
tableName,
|
|
14495
14524
|
selectedSavedView,
|
|
14496
|
-
setSelectedSavedView,
|
|
14497
14525
|
setOpenEditCreateModal,
|
|
14498
14526
|
onSelect,
|
|
14499
14527
|
defaultView
|
|
@@ -14501,269 +14529,289 @@ var SavedViewsFormModal = ({
|
|
|
14501
14529
|
);
|
|
14502
14530
|
};
|
|
14503
14531
|
|
|
14504
|
-
// src/SavedViews/components/SavedViewsModals/
|
|
14532
|
+
// src/SavedViews/components/SavedViewsModals/SharedViewFormModal.tsx
|
|
14505
14533
|
var import_core_react12 = require("@procore/core-react");
|
|
14506
|
-
var
|
|
14507
|
-
var
|
|
14508
|
-
|
|
14509
|
-
|
|
14510
|
-
|
|
14534
|
+
var React21 = __toESM(require("react"));
|
|
14535
|
+
var SharedViewFormModal = ({
|
|
14536
|
+
open,
|
|
14537
|
+
fetchedView,
|
|
14538
|
+
onClose,
|
|
14539
|
+
onCreateTemporaryView,
|
|
14540
|
+
onCreateView,
|
|
14541
|
+
createError,
|
|
14542
|
+
isCreating,
|
|
14543
|
+
resetCreateError
|
|
14544
|
+
}) => {
|
|
14545
|
+
const I18n = (0, import_core_react12.useI18nContext)();
|
|
14546
|
+
const NAME_MAX_LENGTH = 150;
|
|
14547
|
+
const errors = extractMessage(createError, I18n);
|
|
14548
|
+
const handleNameChange = () => {
|
|
14549
|
+
if (resetCreateError) {
|
|
14550
|
+
resetCreateError();
|
|
14551
|
+
}
|
|
14511
14552
|
};
|
|
14512
|
-
const
|
|
14513
|
-
onCreateView
|
|
14553
|
+
const handleOnSubmit = (data) => {
|
|
14554
|
+
onCreateView(data.name, data.description);
|
|
14514
14555
|
};
|
|
14515
|
-
return /* @__PURE__ */
|
|
14556
|
+
return /* @__PURE__ */ React21.createElement(
|
|
14516
14557
|
import_core_react12.Modal,
|
|
14517
14558
|
{
|
|
14518
|
-
"data-testid": "
|
|
14559
|
+
"data-testid": "shared-view-form-modal",
|
|
14519
14560
|
open,
|
|
14520
|
-
onClickOverlay: onClose
|
|
14521
|
-
|
|
14522
|
-
|
|
14523
|
-
|
|
14524
|
-
|
|
14525
|
-
/* @__PURE__ */ import_react13.default.createElement(import_core_react12.Modal.Body, null, /* @__PURE__ */ import_react13.default.createElement(import_core_react12.P, null, i18n.t("savedViews.modal.copyConfirmation.description"))),
|
|
14526
|
-
/* @__PURE__ */ import_react13.default.createElement(import_core_react12.Modal.Footer, null, /* @__PURE__ */ import_react13.default.createElement(import_core_react12.Modal.FooterButtons, null, /* @__PURE__ */ import_react13.default.createElement(
|
|
14527
|
-
import_core_react12.Button,
|
|
14561
|
+
onClickOverlay: onClose,
|
|
14562
|
+
style: { width: "540px" }
|
|
14563
|
+
},
|
|
14564
|
+
/* @__PURE__ */ React21.createElement(
|
|
14565
|
+
import_core_react12.Modal.Header,
|
|
14528
14566
|
{
|
|
14529
|
-
|
|
14530
|
-
|
|
14531
|
-
|
|
14567
|
+
onClose,
|
|
14568
|
+
style: {
|
|
14569
|
+
paddingTop: import_core_react12.spacing.lg,
|
|
14570
|
+
paddingBottom: import_core_react12.spacing.xs,
|
|
14571
|
+
paddingLeft: import_core_react12.spacing.xl,
|
|
14572
|
+
paddingRight: import_core_react12.spacing.xl
|
|
14573
|
+
}
|
|
14532
14574
|
},
|
|
14533
|
-
|
|
14534
|
-
),
|
|
14535
|
-
|
|
14575
|
+
I18n.t("savedViews.modal.create.title")
|
|
14576
|
+
),
|
|
14577
|
+
/* @__PURE__ */ React21.createElement(
|
|
14578
|
+
import_core_react12.P,
|
|
14536
14579
|
{
|
|
14537
|
-
|
|
14538
|
-
|
|
14539
|
-
|
|
14580
|
+
style: {
|
|
14581
|
+
paddingLeft: import_core_react12.spacing.xl,
|
|
14582
|
+
paddingRight: import_core_react12.spacing.xl,
|
|
14583
|
+
paddingBottom: import_core_react12.spacing.lg,
|
|
14584
|
+
paddingTop: import_core_react12.spacing.none,
|
|
14585
|
+
margin: 0,
|
|
14586
|
+
color: import_core_react12.colors.gray45,
|
|
14587
|
+
whiteSpace: "pre-line"
|
|
14588
|
+
}
|
|
14589
|
+
},
|
|
14590
|
+
I18n.t("savedViews.modal.copyConfirmation.description")
|
|
14591
|
+
),
|
|
14592
|
+
/* @__PURE__ */ React21.createElement(
|
|
14593
|
+
import_core_react12.Form,
|
|
14594
|
+
{
|
|
14595
|
+
initialValues: {
|
|
14596
|
+
name: fetchedView.name,
|
|
14597
|
+
description: fetchedView.description ?? ""
|
|
14598
|
+
},
|
|
14599
|
+
view: "create",
|
|
14600
|
+
validationSchema: create$3().shape({
|
|
14601
|
+
name: create$6().trim().max(
|
|
14602
|
+
NAME_MAX_LENGTH,
|
|
14603
|
+
I18n.t("savedViews.modal.errors.maxLengthName", {
|
|
14604
|
+
maxLength: NAME_MAX_LENGTH
|
|
14605
|
+
})
|
|
14606
|
+
).required(I18n.t("savedViews.modal.errors.required"))
|
|
14607
|
+
}),
|
|
14608
|
+
onSubmit: handleOnSubmit,
|
|
14609
|
+
validateOnChange: true
|
|
14540
14610
|
},
|
|
14541
|
-
|
|
14542
|
-
|
|
14611
|
+
/* @__PURE__ */ React21.createElement(import_core_react12.Form.Form, { name: "share-view-form" }, /* @__PURE__ */ React21.createElement(
|
|
14612
|
+
import_core_react12.Modal.Body,
|
|
14613
|
+
{
|
|
14614
|
+
style: {
|
|
14615
|
+
paddingTop: import_core_react12.spacing.lg,
|
|
14616
|
+
paddingBottom: 0,
|
|
14617
|
+
borderTop: `1px solid ${import_core_react12.colors.gray85}`
|
|
14618
|
+
}
|
|
14619
|
+
},
|
|
14620
|
+
errors && /* @__PURE__ */ React21.createElement(import_core_react12.ErrorBanner, { style: { marginBottom: import_core_react12.spacing.xl } }, /* @__PURE__ */ React21.createElement(import_core_react12.Banner.Content, null, /* @__PURE__ */ React21.createElement(import_core_react12.Banner.Title, null, I18n.t("savedViews.modal.errors.title", {
|
|
14621
|
+
mode: "create"
|
|
14622
|
+
})), /* @__PURE__ */ React21.createElement(import_core_react12.Banner.Body, null, (errors == null ? void 0 : errors.form) || I18n.t("savedViews.modal.errors.description.create")))),
|
|
14623
|
+
/* @__PURE__ */ React21.createElement(import_core_react12.Form.Row, null, /* @__PURE__ */ React21.createElement(
|
|
14624
|
+
import_core_react12.Form.Text,
|
|
14625
|
+
{
|
|
14626
|
+
name: "name",
|
|
14627
|
+
error: errors == null ? void 0 : errors.name,
|
|
14628
|
+
placeholder: I18n.t("savedViews.modal.fields.name"),
|
|
14629
|
+
label: I18n.t("savedViews.modal.fields.name"),
|
|
14630
|
+
colWidth: 12,
|
|
14631
|
+
onChange: handleNameChange
|
|
14632
|
+
}
|
|
14633
|
+
)),
|
|
14634
|
+
/* @__PURE__ */ React21.createElement(
|
|
14635
|
+
import_core_react12.Form.Row,
|
|
14636
|
+
{
|
|
14637
|
+
style: { marginTop: (errors == null ? void 0 : errors.name) ? import_core_react12.spacing.xl : import_core_react12.spacing.none }
|
|
14638
|
+
},
|
|
14639
|
+
/* @__PURE__ */ React21.createElement(
|
|
14640
|
+
import_core_react12.Form.TextArea,
|
|
14641
|
+
{
|
|
14642
|
+
name: "description",
|
|
14643
|
+
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
14644
|
+
label: I18n.t("savedViews.modal.fields.description"),
|
|
14645
|
+
colWidth: 12,
|
|
14646
|
+
resize: "vertical"
|
|
14647
|
+
}
|
|
14648
|
+
)
|
|
14649
|
+
)
|
|
14650
|
+
), /* @__PURE__ */ React21.createElement(import_core_react12.Modal.Footer, { style: { borderTop: `1px solid ${import_core_react12.colors.gray85}` } }, /* @__PURE__ */ React21.createElement(import_core_react12.Flex, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React21.createElement(import_core_react12.Typography, { color: "gray45", italic: true }, /* @__PURE__ */ React21.createElement(import_core_react12.Typography, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React21.createElement(import_core_react12.Modal.FooterButtons, null, /* @__PURE__ */ React21.createElement(
|
|
14651
|
+
import_core_react12.Button,
|
|
14652
|
+
{
|
|
14653
|
+
variant: "secondary",
|
|
14654
|
+
onClick: onCreateTemporaryView,
|
|
14655
|
+
"data-testid": "view-temporarily-button",
|
|
14656
|
+
disabled: isCreating
|
|
14657
|
+
},
|
|
14658
|
+
I18n.t("savedViews.actions.viewTemporarily")
|
|
14659
|
+
), /* @__PURE__ */ React21.createElement(
|
|
14660
|
+
import_core_react12.Button,
|
|
14661
|
+
{
|
|
14662
|
+
type: "submit",
|
|
14663
|
+
variant: "primary",
|
|
14664
|
+
"data-testid": "create-view-button",
|
|
14665
|
+
disabled: isCreating,
|
|
14666
|
+
loading: isCreating
|
|
14667
|
+
},
|
|
14668
|
+
I18n.t("savedViews.actions.create")
|
|
14669
|
+
)))))
|
|
14670
|
+
)
|
|
14543
14671
|
);
|
|
14544
14672
|
};
|
|
14545
14673
|
|
|
14546
14674
|
// src/utils/Hooks/useViewSelection.ts
|
|
14547
|
-
var
|
|
14548
|
-
|
|
14549
|
-
// src/utils/Hooks/useUrlSync.ts
|
|
14550
|
-
var import_react14 = require("react");
|
|
14675
|
+
var import_react13 = require("react");
|
|
14551
14676
|
var import_react_router_dom = require("react-router-dom");
|
|
14552
|
-
var useUrlSync = (selectedView, availableViews, defaultView, onViewFound, onViewNotFound) => {
|
|
14553
|
-
const [searchParams, setSearchParams] = (0, import_react_router_dom.useSearchParams)();
|
|
14554
|
-
const applySavedViewFromUrl = (savedViewId) => {
|
|
14555
|
-
if (savedViewId === "default") {
|
|
14556
|
-
if (defaultView.id !== (selectedView == null ? void 0 : selectedView.id)) {
|
|
14557
|
-
onViewFound(defaultView);
|
|
14558
|
-
}
|
|
14559
|
-
return;
|
|
14560
|
-
}
|
|
14561
|
-
const viewInUserViews = availableViews.find((v2) => v2.id === savedViewId);
|
|
14562
|
-
if (viewInUserViews) {
|
|
14563
|
-
if (viewInUserViews.id !== (selectedView == null ? void 0 : selectedView.id)) {
|
|
14564
|
-
onViewFound(viewInUserViews);
|
|
14565
|
-
}
|
|
14566
|
-
} else {
|
|
14567
|
-
onViewNotFound(savedViewId);
|
|
14568
|
-
}
|
|
14569
|
-
};
|
|
14570
|
-
const applyListView = (viewParam) => {
|
|
14571
|
-
if (viewParam === "list" && defaultView.id !== (selectedView == null ? void 0 : selectedView.id)) {
|
|
14572
|
-
onViewFound(defaultView);
|
|
14573
|
-
}
|
|
14574
|
-
};
|
|
14575
|
-
(0, import_react14.useEffect)(() => {
|
|
14576
|
-
if (!availableViews.length)
|
|
14577
|
-
return;
|
|
14578
|
-
const savedViewId = searchParams.get("saved-view");
|
|
14579
|
-
const viewParamFromConsumer = searchParams.get("view");
|
|
14580
|
-
if (savedViewId) {
|
|
14581
|
-
applySavedViewFromUrl(savedViewId);
|
|
14582
|
-
return;
|
|
14583
|
-
}
|
|
14584
|
-
if (viewParamFromConsumer) {
|
|
14585
|
-
applyListView(viewParamFromConsumer);
|
|
14586
|
-
}
|
|
14587
|
-
}, [
|
|
14588
|
-
searchParams,
|
|
14589
|
-
availableViews,
|
|
14590
|
-
defaultView,
|
|
14591
|
-
selectedView,
|
|
14592
|
-
onViewFound,
|
|
14593
|
-
onViewNotFound
|
|
14594
|
-
]);
|
|
14595
|
-
const updateUrl = (view) => {
|
|
14596
|
-
setSearchParams(
|
|
14597
|
-
(currentParams) => {
|
|
14598
|
-
const updatedParams = new URLSearchParams(currentParams);
|
|
14599
|
-
if (view.id === "default") {
|
|
14600
|
-
updatedParams.delete("saved-view");
|
|
14601
|
-
} else {
|
|
14602
|
-
updatedParams.set("saved-view", view.id);
|
|
14603
|
-
}
|
|
14604
|
-
return updatedParams;
|
|
14605
|
-
},
|
|
14606
|
-
{ replace: true }
|
|
14607
|
-
);
|
|
14608
|
-
};
|
|
14609
|
-
return { updateUrl };
|
|
14610
|
-
};
|
|
14611
14677
|
|
|
14612
|
-
// src/utils/
|
|
14613
|
-
var
|
|
14614
|
-
|
|
14678
|
+
// src/utils/viewStorage.ts
|
|
14679
|
+
var ViewStorage = {
|
|
14680
|
+
save(key, view) {
|
|
14681
|
+
localStorage.setItem(key, JSON.stringify(view));
|
|
14682
|
+
},
|
|
14683
|
+
load(key) {
|
|
14615
14684
|
try {
|
|
14616
|
-
const
|
|
14617
|
-
|
|
14618
|
-
`${config.domain}_${config.tableName}_${config.stickyViewsKey}_${config.projectId}_${config.userId}`
|
|
14619
|
-
)
|
|
14620
|
-
);
|
|
14621
|
-
return savedView || config.defaultView;
|
|
14685
|
+
const stored = localStorage.getItem(key);
|
|
14686
|
+
return stored ? JSON.parse(stored) : null;
|
|
14622
14687
|
} catch (e2) {
|
|
14623
|
-
return
|
|
14688
|
+
return null;
|
|
14624
14689
|
}
|
|
14690
|
+
},
|
|
14691
|
+
remove(key) {
|
|
14692
|
+
localStorage.removeItem(key);
|
|
14693
|
+
}
|
|
14694
|
+
};
|
|
14695
|
+
|
|
14696
|
+
// src/utils/Hooks/useViewSelection.ts
|
|
14697
|
+
var getUpdatedSearchParams = (currentParams, view) => {
|
|
14698
|
+
const updatedParams = new URLSearchParams(currentParams);
|
|
14699
|
+
if (view.id === "default") {
|
|
14700
|
+
updatedParams.delete("saved-view");
|
|
14701
|
+
} else if (view.id === "temporary") {
|
|
14702
|
+
updatedParams.set("saved-view", "temporary");
|
|
14703
|
+
} else {
|
|
14704
|
+
updatedParams.set("saved-view", view.share_token);
|
|
14705
|
+
}
|
|
14706
|
+
return updatedParams;
|
|
14707
|
+
};
|
|
14708
|
+
var checkIsViewSelected = (selectedView, viewId) => {
|
|
14709
|
+
return (selectedView == null ? void 0 : selectedView.share_token) === viewId || (selectedView == null ? void 0 : selectedView.id) === viewId;
|
|
14710
|
+
};
|
|
14711
|
+
var useViewSelection = (config, savedViews, openSharedViewModal) => {
|
|
14712
|
+
const storageKey = `${config.domain}_${config.tableName}_${config.stickyViewsKey}_${config.projectId}_${config.userId}`;
|
|
14713
|
+
const temporaryStorageKey = `${storageKey}_temporary`;
|
|
14714
|
+
const [searchParams, setSearchParams] = (0, import_react_router_dom.useSearchParams)();
|
|
14715
|
+
const [selectedSavedView, setSelectedSavedView] = (0, import_react13.useState)(() => {
|
|
14716
|
+
const stored = ViewStorage.load(storageKey);
|
|
14717
|
+
return stored ?? config.defaultView;
|
|
14625
14718
|
});
|
|
14626
|
-
const [temporaryView, setTemporaryView] = (0,
|
|
14627
|
-
|
|
14628
|
-
|
|
14629
|
-
|
|
14630
|
-
id: "temporary",
|
|
14631
|
-
name: "Temporary View"
|
|
14632
|
-
};
|
|
14633
|
-
setTemporaryView(tempView);
|
|
14634
|
-
return tempView;
|
|
14635
|
-
}, []);
|
|
14636
|
-
const clearTemporaryView = (0, import_react15.useCallback)(() => setTemporaryView(null), []);
|
|
14637
|
-
const updateLocalStorage = (0, import_react15.useCallback)(
|
|
14719
|
+
const [temporaryView, setTemporaryView] = (0, import_react13.useState)(() => {
|
|
14720
|
+
return ViewStorage.load(temporaryStorageKey);
|
|
14721
|
+
});
|
|
14722
|
+
const updateLocalStorage = (0, import_react13.useCallback)(
|
|
14638
14723
|
(view) => {
|
|
14639
14724
|
if (config.stickyViewsKey) {
|
|
14640
|
-
|
|
14641
|
-
`${config.domain}_${config.tableName}_${config.stickyViewsKey}_${config.projectId}_${config.userId}`,
|
|
14642
|
-
JSON.stringify(view)
|
|
14643
|
-
);
|
|
14725
|
+
ViewStorage.save(storageKey, view);
|
|
14644
14726
|
}
|
|
14645
14727
|
},
|
|
14646
|
-
[
|
|
14647
|
-
config.domain,
|
|
14648
|
-
config.tableName,
|
|
14649
|
-
config.stickyViewsKey,
|
|
14650
|
-
config.projectId,
|
|
14651
|
-
config.userId
|
|
14652
|
-
]
|
|
14728
|
+
[config.stickyViewsKey, storageKey]
|
|
14653
14729
|
);
|
|
14654
|
-
const
|
|
14655
|
-
|
|
14656
|
-
|
|
14657
|
-
|
|
14658
|
-
|
|
14659
|
-
|
|
14660
|
-
|
|
14661
|
-
|
|
14662
|
-
openCrossUserModal(viewId);
|
|
14663
|
-
};
|
|
14664
|
-
const { updateUrl } = useUrlSync(
|
|
14665
|
-
selectedSavedView,
|
|
14666
|
-
allViews,
|
|
14667
|
-
config.defaultView,
|
|
14668
|
-
onUrlViewFound,
|
|
14669
|
-
onUrlViewNotFound
|
|
14730
|
+
const updateUrlForView = (0, import_react13.useCallback)(
|
|
14731
|
+
(view) => {
|
|
14732
|
+
setSearchParams(
|
|
14733
|
+
(currentParams) => getUpdatedSearchParams(currentParams, view),
|
|
14734
|
+
{ replace: true }
|
|
14735
|
+
);
|
|
14736
|
+
},
|
|
14737
|
+
[setSearchParams]
|
|
14670
14738
|
);
|
|
14671
|
-
const
|
|
14739
|
+
const baseViews = savedViews ?? [];
|
|
14740
|
+
const allViews = temporaryView ? [...baseViews, temporaryView] : baseViews;
|
|
14741
|
+
const selectView = (0, import_react13.useCallback)(
|
|
14672
14742
|
(view) => {
|
|
14673
|
-
if (view.id !== "temporary" && temporaryView) {
|
|
14674
|
-
clearTemporaryView();
|
|
14675
|
-
}
|
|
14676
14743
|
const viewToSelect = config.onSelect({ item: view });
|
|
14677
14744
|
setSelectedSavedView(viewToSelect);
|
|
14678
14745
|
updateLocalStorage(viewToSelect);
|
|
14679
|
-
|
|
14746
|
+
updateUrlForView(viewToSelect);
|
|
14680
14747
|
return viewToSelect;
|
|
14681
14748
|
},
|
|
14682
|
-
[config,
|
|
14749
|
+
[config, updateLocalStorage, updateUrlForView]
|
|
14683
14750
|
);
|
|
14684
|
-
|
|
14685
|
-
|
|
14686
|
-
|
|
14687
|
-
|
|
14688
|
-
|
|
14689
|
-
|
|
14690
|
-
};
|
|
14691
|
-
};
|
|
14692
|
-
|
|
14693
|
-
// src/utils/Hooks/useCrossUserSharing.ts
|
|
14694
|
-
var import_react16 = __toESM(require("react"));
|
|
14695
|
-
var useCrossUserSharing = (queryInput, viewId, selectedSavedView, defaultView, actions, tableName) => {
|
|
14696
|
-
const { data: fetchedView, isError: fetchError } = useFetchSavedViewById(
|
|
14697
|
-
viewId,
|
|
14698
|
-
queryInput,
|
|
14699
|
-
Boolean(viewId)
|
|
14700
|
-
);
|
|
14701
|
-
const { mutate: createSavedView } = useCreateSavedView(queryInput);
|
|
14702
|
-
import_react16.default.useEffect(() => {
|
|
14703
|
-
if (fetchError && viewId) {
|
|
14704
|
-
actions.selectView(selectedSavedView ?? defaultView);
|
|
14705
|
-
actions.closeModal();
|
|
14706
|
-
}
|
|
14707
|
-
}, [fetchError, viewId, actions, selectedSavedView, defaultView]);
|
|
14708
|
-
const viewSharedViewTemporarily = () => {
|
|
14709
|
-
if (fetchedView) {
|
|
14710
|
-
const tempView = actions.createTemporaryView(fetchedView);
|
|
14711
|
-
actions.selectView(tempView);
|
|
14712
|
-
actions.closeModal();
|
|
14713
|
-
}
|
|
14714
|
-
};
|
|
14715
|
-
const createPersonalCopyOfSharedView = () => {
|
|
14716
|
-
if (fetchedView) {
|
|
14717
|
-
const viewToCreate = {
|
|
14718
|
-
name: fetchedView.name,
|
|
14719
|
-
description: fetchedView.description,
|
|
14720
|
-
table_name: tableName,
|
|
14721
|
-
table_config: fetchedView.table_config,
|
|
14722
|
-
view_level: "personal"
|
|
14751
|
+
const createTemporaryView = (0, import_react13.useCallback)(
|
|
14752
|
+
(fetchedView) => {
|
|
14753
|
+
const tempView = {
|
|
14754
|
+
...fetchedView,
|
|
14755
|
+
id: "temporary",
|
|
14756
|
+
name: "Temporary View"
|
|
14723
14757
|
};
|
|
14724
|
-
|
|
14725
|
-
|
|
14726
|
-
|
|
14727
|
-
|
|
14728
|
-
|
|
14729
|
-
|
|
14730
|
-
}
|
|
14731
|
-
};
|
|
14732
|
-
return {
|
|
14733
|
-
fetchedView,
|
|
14734
|
-
viewSharedViewTemporarily,
|
|
14735
|
-
createPersonalCopyOfSharedView
|
|
14736
|
-
};
|
|
14737
|
-
};
|
|
14738
|
-
|
|
14739
|
-
// src/utils/Hooks/useModalState.ts
|
|
14740
|
-
var import_react17 = require("react");
|
|
14741
|
-
var useModalState = () => {
|
|
14742
|
-
const [activeModal, setActiveModal] = (0, import_react17.useState)(null);
|
|
14743
|
-
const [modalData, setModalData] = (0, import_react17.useState)(null);
|
|
14744
|
-
const openModal = (0, import_react17.useCallback)(
|
|
14745
|
-
(type, data) => {
|
|
14746
|
-
setActiveModal(type);
|
|
14747
|
-
setModalData(data ?? null);
|
|
14748
|
-
},
|
|
14749
|
-
[]
|
|
14758
|
+
ViewStorage.save(temporaryStorageKey, tempView);
|
|
14759
|
+
setTemporaryView(tempView);
|
|
14760
|
+
selectView(tempView);
|
|
14761
|
+
return tempView;
|
|
14762
|
+
},
|
|
14763
|
+
[temporaryStorageKey, selectView]
|
|
14750
14764
|
);
|
|
14751
|
-
const
|
|
14752
|
-
|
|
14753
|
-
|
|
14754
|
-
|
|
14755
|
-
|
|
14756
|
-
|
|
14757
|
-
|
|
14765
|
+
const clearTemporaryView = (0, import_react13.useCallback)(() => {
|
|
14766
|
+
ViewStorage.remove(temporaryStorageKey);
|
|
14767
|
+
setTemporaryView(null);
|
|
14768
|
+
selectView(config.defaultView);
|
|
14769
|
+
}, [temporaryStorageKey, config.defaultView, selectView]);
|
|
14770
|
+
const isViewAlreadySelected = (0, import_react13.useCallback)(
|
|
14771
|
+
(viewId) => checkIsViewSelected(selectedSavedView, viewId),
|
|
14772
|
+
[selectedSavedView]
|
|
14773
|
+
);
|
|
14774
|
+
const handleSavedViewFromUrl = (0, import_react13.useCallback)(
|
|
14775
|
+
(viewId) => {
|
|
14776
|
+
if (isViewAlreadySelected(viewId)) {
|
|
14777
|
+
return;
|
|
14778
|
+
}
|
|
14779
|
+
openSharedViewModal(viewId);
|
|
14758
14780
|
},
|
|
14759
|
-
[
|
|
14781
|
+
[isViewAlreadySelected, openSharedViewModal]
|
|
14760
14782
|
);
|
|
14783
|
+
const handleListViewFromUrl = (0, import_react13.useCallback)(() => {
|
|
14784
|
+
if (config.defaultView.id !== (selectedSavedView == null ? void 0 : selectedSavedView.id)) {
|
|
14785
|
+
selectView(config.defaultView);
|
|
14786
|
+
}
|
|
14787
|
+
}, [config.defaultView, selectedSavedView, selectView]);
|
|
14788
|
+
(0, import_react13.useEffect)(() => {
|
|
14789
|
+
if (!allViews.length)
|
|
14790
|
+
return;
|
|
14791
|
+
const savedViewId = searchParams.get("saved-view");
|
|
14792
|
+
const viewParamFromConsumer = searchParams.get("view");
|
|
14793
|
+
if (savedViewId) {
|
|
14794
|
+
handleSavedViewFromUrl(savedViewId);
|
|
14795
|
+
return;
|
|
14796
|
+
}
|
|
14797
|
+
if (viewParamFromConsumer === "list") {
|
|
14798
|
+
handleListViewFromUrl();
|
|
14799
|
+
}
|
|
14800
|
+
}, [
|
|
14801
|
+
searchParams,
|
|
14802
|
+
savedViews,
|
|
14803
|
+
temporaryView,
|
|
14804
|
+
handleSavedViewFromUrl,
|
|
14805
|
+
handleListViewFromUrl,
|
|
14806
|
+
allViews.length
|
|
14807
|
+
]);
|
|
14761
14808
|
return {
|
|
14762
|
-
|
|
14763
|
-
|
|
14764
|
-
|
|
14765
|
-
|
|
14766
|
-
|
|
14809
|
+
selectedView: selectedSavedView,
|
|
14810
|
+
selectView,
|
|
14811
|
+
temporaryView,
|
|
14812
|
+
createTemporaryView,
|
|
14813
|
+
clearTemporaryView,
|
|
14814
|
+
allViews
|
|
14767
14815
|
};
|
|
14768
14816
|
};
|
|
14769
14817
|
|
|
@@ -14783,16 +14831,26 @@ var SavedViewsContent = (props) => {
|
|
|
14783
14831
|
};
|
|
14784
14832
|
const { data: savedViews } = useSavedViewsQuery(queryInput);
|
|
14785
14833
|
const { mutate: deleteSavedView } = useDeleteSavedView(queryInput);
|
|
14786
|
-
const
|
|
14787
|
-
const
|
|
14788
|
-
|
|
14834
|
+
const [activeModal, setActiveModal] = (0, import_react14.useState)(null);
|
|
14835
|
+
const [modalData, setModalData] = (0, import_react14.useState)(null);
|
|
14836
|
+
const openModal = (type, data) => {
|
|
14837
|
+
setActiveModal(type);
|
|
14838
|
+
setModalData(data ?? null);
|
|
14839
|
+
};
|
|
14840
|
+
const closeModal = (0, import_react14.useCallback)(() => {
|
|
14841
|
+
setActiveModal(null);
|
|
14842
|
+
setModalData(null);
|
|
14843
|
+
}, []);
|
|
14844
|
+
const isModalOpen = (type) => activeModal === type;
|
|
14845
|
+
const openSharedViewModal = (viewId) => {
|
|
14846
|
+
openModal("sharedView" /* SHARED_VIEW */, { viewId });
|
|
14789
14847
|
};
|
|
14790
14848
|
const {
|
|
14791
14849
|
selectedView,
|
|
14792
14850
|
selectView,
|
|
14793
|
-
|
|
14794
|
-
|
|
14795
|
-
|
|
14851
|
+
createTemporaryView,
|
|
14852
|
+
clearTemporaryView,
|
|
14853
|
+
allViews
|
|
14796
14854
|
} = useViewSelection(
|
|
14797
14855
|
{
|
|
14798
14856
|
domain: props.domain,
|
|
@@ -14804,24 +14862,54 @@ var SavedViewsContent = (props) => {
|
|
|
14804
14862
|
onSelect: props.onSelect
|
|
14805
14863
|
},
|
|
14806
14864
|
savedViews,
|
|
14807
|
-
|
|
14865
|
+
openSharedViewModal
|
|
14808
14866
|
);
|
|
14809
|
-
const {
|
|
14810
|
-
fetchedView,
|
|
14811
|
-
viewSharedViewTemporarily,
|
|
14812
|
-
createPersonalCopyOfSharedView
|
|
14813
|
-
} = useCrossUserSharing(
|
|
14814
|
-
queryInput,
|
|
14867
|
+
const { data: fetchedView, isError: fetchError } = useFetchSavedViewById(
|
|
14815
14868
|
(modalData == null ? void 0 : modalData.viewId) ?? null,
|
|
14816
|
-
|
|
14817
|
-
|
|
14818
|
-
{
|
|
14819
|
-
selectView,
|
|
14820
|
-
createTemporaryView,
|
|
14821
|
-
closeModal
|
|
14822
|
-
},
|
|
14823
|
-
props.tableName
|
|
14869
|
+
queryInput,
|
|
14870
|
+
Boolean(modalData == null ? void 0 : modalData.viewId)
|
|
14824
14871
|
);
|
|
14872
|
+
const {
|
|
14873
|
+
mutate: createSavedView,
|
|
14874
|
+
isPending: isCreating,
|
|
14875
|
+
error: createError,
|
|
14876
|
+
reset: resetCreateError
|
|
14877
|
+
} = useCreateSavedView(queryInput);
|
|
14878
|
+
(0, import_react14.useEffect)(() => {
|
|
14879
|
+
if (fetchError) {
|
|
14880
|
+
selectView(selectedView ?? props.defaultView);
|
|
14881
|
+
closeModal();
|
|
14882
|
+
}
|
|
14883
|
+
}, [fetchError, selectedView, props.defaultView, selectView, closeModal]);
|
|
14884
|
+
const viewSharedViewTemporarily = () => {
|
|
14885
|
+
if (fetchedView) {
|
|
14886
|
+
createTemporaryView(fetchedView);
|
|
14887
|
+
closeModal();
|
|
14888
|
+
}
|
|
14889
|
+
};
|
|
14890
|
+
const createPersonalCopyOfSharedView = (name, description) => {
|
|
14891
|
+
if (fetchedView) {
|
|
14892
|
+
const viewToCreate = {
|
|
14893
|
+
id: "",
|
|
14894
|
+
name,
|
|
14895
|
+
description,
|
|
14896
|
+
table_name: props.tableName,
|
|
14897
|
+
table_config: fetchedView.table_config,
|
|
14898
|
+
view_level: "personal",
|
|
14899
|
+
share_token: ""
|
|
14900
|
+
};
|
|
14901
|
+
createSavedView(viewToCreate, {
|
|
14902
|
+
onSuccess: (newView) => {
|
|
14903
|
+
selectView(newView);
|
|
14904
|
+
closeModal();
|
|
14905
|
+
}
|
|
14906
|
+
});
|
|
14907
|
+
}
|
|
14908
|
+
};
|
|
14909
|
+
const selectCurrentViewAndCloseModal = () => {
|
|
14910
|
+
selectView(selectedView ?? props.defaultView);
|
|
14911
|
+
closeModal();
|
|
14912
|
+
};
|
|
14825
14913
|
const deleteSelectedView = () => {
|
|
14826
14914
|
if (selectedView) {
|
|
14827
14915
|
deleteSavedView(selectedView, {
|
|
@@ -14834,27 +14922,22 @@ var SavedViewsContent = (props) => {
|
|
|
14834
14922
|
closeModal();
|
|
14835
14923
|
};
|
|
14836
14924
|
const i18n = (0, import_core_react13.useI18nContext)();
|
|
14837
|
-
|
|
14838
|
-
const setSelectedSavedView = (view) => {
|
|
14839
|
-
selectView(view);
|
|
14840
|
-
};
|
|
14841
|
-
const allViews = temporaryView ? [...savedViews ?? [], temporaryView] : savedViews ?? [];
|
|
14842
|
-
return /* @__PURE__ */ import_react18.default.createElement(StyledPanel, { provider: props.provider }, /* @__PURE__ */ import_react18.default.createElement(
|
|
14925
|
+
return /* @__PURE__ */ import_react14.default.createElement(StyledPanel, { provider: props.provider }, /* @__PURE__ */ import_react14.default.createElement(
|
|
14843
14926
|
ExpandedPanel,
|
|
14844
14927
|
{
|
|
14845
14928
|
"data-testid": "saved-view-expanded-panel",
|
|
14846
14929
|
provider: props.provider
|
|
14847
14930
|
},
|
|
14848
|
-
/* @__PURE__ */
|
|
14931
|
+
/* @__PURE__ */ import_react14.default.createElement(import_core_react13.Panel.Header, { id: "saved-views-collections-panel-header" }, /* @__PURE__ */ import_react14.default.createElement(import_core_react13.Panel.Title, null, /* @__PURE__ */ import_react14.default.createElement(import_core_react13.Flex, { alignItems: "center" }, /* @__PURE__ */ import_react14.default.createElement(import_core_react13.Box, { paddingRight: "sm" }, i18n.t("savedViews.title")), /* @__PURE__ */ import_react14.default.createElement(import_core_react13.Tooltip, { showDelay: 200, overlay: i18n.t("savedViews.tooltip") }, /* @__PURE__ */ import_react14.default.createElement(Help_default, { size: "sm" })))), /* @__PURE__ */ import_react14.default.createElement(
|
|
14849
14932
|
import_core_react13.Tooltip,
|
|
14850
14933
|
{
|
|
14851
14934
|
overlay: i18n.t("savedViews.actions.create"),
|
|
14852
14935
|
showDelay: 1e3
|
|
14853
14936
|
},
|
|
14854
|
-
/* @__PURE__ */
|
|
14937
|
+
/* @__PURE__ */ import_react14.default.createElement("span", null, /* @__PURE__ */ import_react14.default.createElement(
|
|
14855
14938
|
import_core_react13.Button,
|
|
14856
14939
|
{
|
|
14857
|
-
icon: /* @__PURE__ */
|
|
14940
|
+
icon: /* @__PURE__ */ import_react14.default.createElement(Plus_default, null),
|
|
14858
14941
|
variant: "secondary",
|
|
14859
14942
|
"data-testid": "expanded-panel-create-button",
|
|
14860
14943
|
onClick: () => openModal("create" /* CREATE */),
|
|
@@ -14863,14 +14946,12 @@ var SavedViewsContent = (props) => {
|
|
|
14863
14946
|
i18n.t("savedViews.actions.create")
|
|
14864
14947
|
))
|
|
14865
14948
|
)),
|
|
14866
|
-
/* @__PURE__ */
|
|
14949
|
+
/* @__PURE__ */ import_react14.default.createElement(import_core_react13.Panel.Body, { style: { display: "flex", flexFlow: "column" } }, /* @__PURE__ */ import_react14.default.createElement(
|
|
14867
14950
|
PanelContent,
|
|
14868
14951
|
{
|
|
14869
|
-
onSelect:
|
|
14952
|
+
onSelect: ({ item }) => selectView(item),
|
|
14870
14953
|
openModal,
|
|
14871
14954
|
onDelete: () => openModal("delete" /* DELETE */),
|
|
14872
|
-
updateLocalStorage,
|
|
14873
|
-
setSelectedSavedView,
|
|
14874
14955
|
queryInput,
|
|
14875
14956
|
selectedSavedView: selectedView,
|
|
14876
14957
|
tableConfig: props.tableConfig,
|
|
@@ -14878,10 +14959,11 @@ var SavedViewsContent = (props) => {
|
|
|
14878
14959
|
stickyViewsKey: props.stickyViewsKey,
|
|
14879
14960
|
savedViews: allViews,
|
|
14880
14961
|
provider: props.provider,
|
|
14881
|
-
userId: props.userId
|
|
14962
|
+
userId: props.userId,
|
|
14963
|
+
onClearTemporary: clearTemporaryView
|
|
14882
14964
|
}
|
|
14883
14965
|
))
|
|
14884
|
-
), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */
|
|
14966
|
+
), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */ import_react14.default.createElement(
|
|
14885
14967
|
SavedViewsFormModal,
|
|
14886
14968
|
{
|
|
14887
14969
|
open: true,
|
|
@@ -14891,87 +14973,107 @@ var SavedViewsContent = (props) => {
|
|
|
14891
14973
|
tableConfig: props.tableConfig,
|
|
14892
14974
|
tableName: props.tableName,
|
|
14893
14975
|
selectedSavedView: selectedView,
|
|
14894
|
-
setSelectedSavedView,
|
|
14895
14976
|
onSelect: selectView,
|
|
14896
14977
|
setOpenEditCreateModal: closeModal,
|
|
14897
14978
|
defaultView: props.defaultView
|
|
14898
14979
|
}
|
|
14899
|
-
), selectedView && isModalOpen("delete" /* DELETE */) && /* @__PURE__ */
|
|
14980
|
+
), selectedView && isModalOpen("delete" /* DELETE */) && /* @__PURE__ */ import_react14.default.createElement(
|
|
14900
14981
|
SavedViewsDeleteConfirmationModalShared,
|
|
14901
14982
|
{
|
|
14902
14983
|
open: true,
|
|
14903
14984
|
onDelete: confirmDeleteAndCloseModal,
|
|
14904
14985
|
onCancel: closeModal
|
|
14905
14986
|
}
|
|
14906
|
-
), fetchedView && isModalOpen("
|
|
14907
|
-
|
|
14987
|
+
), fetchedView && isModalOpen("sharedView" /* SHARED_VIEW */) && /* @__PURE__ */ import_react14.default.createElement(
|
|
14988
|
+
SharedViewFormModal,
|
|
14908
14989
|
{
|
|
14909
14990
|
open: true,
|
|
14910
|
-
|
|
14911
|
-
onClose:
|
|
14912
|
-
|
|
14913
|
-
onCreateView: createPersonalCopyOfSharedView
|
|
14991
|
+
fetchedView,
|
|
14992
|
+
onClose: selectCurrentViewAndCloseModal,
|
|
14993
|
+
onCreateTemporaryView: viewSharedViewTemporarily,
|
|
14994
|
+
onCreateView: createPersonalCopyOfSharedView,
|
|
14995
|
+
createError,
|
|
14996
|
+
isCreating,
|
|
14997
|
+
resetCreateError
|
|
14914
14998
|
}
|
|
14915
14999
|
));
|
|
14916
15000
|
};
|
|
14917
15001
|
var SavedViews = (props) => {
|
|
14918
|
-
return /* @__PURE__ */
|
|
15002
|
+
return /* @__PURE__ */ import_react14.default.createElement(EnvironmentI18nProvider, null, /* @__PURE__ */ import_react14.default.createElement(import_react_query3.QueryClientProvider, { client: queryClient }, /* @__PURE__ */ import_react14.default.createElement(SavedViewsContent, { ...props })));
|
|
14919
15003
|
};
|
|
14920
15004
|
|
|
14921
15005
|
// src/SavedViews/components/SavedViews/SmartGrid/SmartGridSavedViews.tsx
|
|
14922
15006
|
var import_toast_alert3 = require("@procore/toast-alert");
|
|
15007
|
+
var generateStickyViewsKey = (domain, tableName, userId, projectId, companyId) => {
|
|
15008
|
+
return `savedView-${domain}-${tableName}-${companyId}-${projectId}-${userId}`;
|
|
15009
|
+
};
|
|
14923
15010
|
var SmartGridSavedViews = (props) => {
|
|
14924
|
-
const { gridApi, projectId, companyId } = props;
|
|
15011
|
+
const { gridApi, userId, projectId, companyId } = props;
|
|
14925
15012
|
const { config: tableConfig, setConfig: setTableConfig } = useSmartGridConfig(gridApi);
|
|
14926
15013
|
const defaultView = useDefaultView({
|
|
14927
15014
|
defaultViewName: props.defaultViewName,
|
|
14928
15015
|
domain: props.domain
|
|
14929
15016
|
});
|
|
14930
|
-
const onSelect = (
|
|
14931
|
-
|
|
14932
|
-
|
|
14933
|
-
|
|
14934
|
-
|
|
14935
|
-
|
|
14936
|
-
|
|
14937
|
-
|
|
14938
|
-
|
|
14939
|
-
|
|
14940
|
-
|
|
14941
|
-
|
|
14942
|
-
|
|
14943
|
-
|
|
14944
|
-
|
|
14945
|
-
|
|
14946
|
-
|
|
14947
|
-
|
|
14948
|
-
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
15017
|
+
const onSelect = (0, import_react15.useCallback)(
|
|
15018
|
+
({ item }) => {
|
|
15019
|
+
if (!gridApi)
|
|
15020
|
+
return item;
|
|
15021
|
+
if (item.id === "default") {
|
|
15022
|
+
gridApi.autoSizeAllColumns();
|
|
15023
|
+
gridApi.resetColumnState();
|
|
15024
|
+
gridApi.setFilterModel(props.defaultViewFilters);
|
|
15025
|
+
gridApi.setGridOption("rowHeight", props.defaultRowHeight);
|
|
15026
|
+
gridApi.refreshCells();
|
|
15027
|
+
return item;
|
|
15028
|
+
}
|
|
15029
|
+
const updatedView = {
|
|
15030
|
+
...item,
|
|
15031
|
+
table_config: customAndConfigSync(
|
|
15032
|
+
item.table_config,
|
|
15033
|
+
tableConfig
|
|
15034
|
+
)
|
|
15035
|
+
};
|
|
15036
|
+
updateTableConfig(updatedView, gridApi, "smart-grid");
|
|
15037
|
+
setTableConfig(updatedView.table_config);
|
|
15038
|
+
return updatedView;
|
|
15039
|
+
},
|
|
15040
|
+
[
|
|
15041
|
+
gridApi,
|
|
15042
|
+
props.defaultViewFilters,
|
|
15043
|
+
props.defaultRowHeight,
|
|
15044
|
+
tableConfig,
|
|
15045
|
+
setTableConfig
|
|
15046
|
+
]
|
|
15047
|
+
);
|
|
15048
|
+
const stickyViewsKey = generateStickyViewsKey(
|
|
15049
|
+
props.domain,
|
|
15050
|
+
props.tableName,
|
|
15051
|
+
userId,
|
|
15052
|
+
projectId,
|
|
15053
|
+
companyId
|
|
15054
|
+
);
|
|
15055
|
+
return /* @__PURE__ */ import_react15.default.createElement(import_toast_alert3.ToastAlertProvider, null, /* @__PURE__ */ import_react15.default.createElement(
|
|
14953
15056
|
SavedViews,
|
|
14954
15057
|
{
|
|
14955
15058
|
onSelect,
|
|
14956
15059
|
domain: props.domain,
|
|
14957
|
-
userId
|
|
15060
|
+
userId,
|
|
14958
15061
|
projectId,
|
|
14959
15062
|
companyId,
|
|
14960
15063
|
provider: "smart-grid",
|
|
14961
15064
|
defaultView,
|
|
14962
15065
|
tableName: props.tableName,
|
|
14963
15066
|
tableConfig,
|
|
14964
|
-
stickyViewsKey
|
|
14965
|
-
enableSavedViews: props.enableSavedViews
|
|
15067
|
+
stickyViewsKey
|
|
14966
15068
|
}
|
|
14967
15069
|
));
|
|
14968
15070
|
};
|
|
14969
15071
|
|
|
14970
15072
|
// src/SavedViews/components/SavedViews/DataTable/DataTableSavedViews.tsx
|
|
14971
|
-
var
|
|
15073
|
+
var import_react17 = __toESM(require("react"));
|
|
14972
15074
|
|
|
14973
15075
|
// src/SavedViews/components/SavedViews/DataTable/DataTableDefaultSavedView.tsx
|
|
14974
|
-
var
|
|
15076
|
+
var import_react16 = require("react");
|
|
14975
15077
|
var import_core_react14 = require("@procore/core-react");
|
|
14976
15078
|
var DEFAULT_COLUMN_STATE = {
|
|
14977
15079
|
hidden: false,
|
|
@@ -15028,7 +15130,7 @@ var useDefaultViewName2 = (domain, defaultViewName) => {
|
|
|
15028
15130
|
};
|
|
15029
15131
|
var useDefaultView2 = (props) => {
|
|
15030
15132
|
const name = useDefaultViewName2(props.domain, props.defaultViewName);
|
|
15031
|
-
const extractedDefaultConfig = (0,
|
|
15133
|
+
const extractedDefaultConfig = (0, import_react16.useMemo)(
|
|
15032
15134
|
() => extractDefaultView(props.columnDefinitions, props.receivedConfigFromTool),
|
|
15033
15135
|
[props.columnDefinitions, props.receivedConfigFromTool]
|
|
15034
15136
|
);
|
|
@@ -15042,58 +15144,63 @@ var useDefaultView2 = (props) => {
|
|
|
15042
15144
|
|
|
15043
15145
|
// src/SavedViews/components/SavedViews/DataTable/DataTableSavedViews.tsx
|
|
15044
15146
|
var import_toast_alert4 = require("@procore/toast-alert");
|
|
15045
|
-
var
|
|
15046
|
-
|
|
15047
|
-
|
|
15147
|
+
var generateStickyViewsKey2 = (domain, tableName, userId, projectId, companyId) => {
|
|
15148
|
+
return `savedView-${domain}-${tableName}-${companyId}-${projectId}-${userId}`;
|
|
15149
|
+
};
|
|
15150
|
+
var DataTableSavedViews = (0, import_react17.forwardRef)((props, ref) => {
|
|
15151
|
+
const { tableApi, userId, projectId, companyId } = props;
|
|
15152
|
+
const [internalTableConfig, setInternalTableConfig] = (0, import_react17.useState)(
|
|
15048
15153
|
props.defaultViewConfig
|
|
15049
15154
|
);
|
|
15050
|
-
(0,
|
|
15155
|
+
(0, import_react17.useImperativeHandle)(ref, () => ({
|
|
15051
15156
|
setTableConfig: (newConfig) => {
|
|
15052
|
-
|
|
15157
|
+
setInternalTableConfig(newConfig);
|
|
15053
15158
|
}
|
|
15054
15159
|
}));
|
|
15055
|
-
const handleConfigChange = (0, import_react21.useCallback)(
|
|
15056
|
-
(newConfig) => {
|
|
15057
|
-
setInternalTableConfig(newConfig);
|
|
15058
|
-
onTableConfigChange(newConfig);
|
|
15059
|
-
},
|
|
15060
|
-
[onTableConfigChange]
|
|
15061
|
-
);
|
|
15062
15160
|
const defaultView = useDefaultView2({
|
|
15063
15161
|
defaultViewName: props.defaultViewName,
|
|
15064
15162
|
receivedConfigFromTool: props.defaultViewConfig,
|
|
15065
15163
|
domain: props.domain,
|
|
15066
15164
|
columnDefinitions: props.columnDefinitions
|
|
15067
15165
|
});
|
|
15068
|
-
const onSelect = (
|
|
15069
|
-
|
|
15070
|
-
|
|
15071
|
-
|
|
15072
|
-
|
|
15073
|
-
|
|
15074
|
-
|
|
15075
|
-
|
|
15076
|
-
|
|
15077
|
-
|
|
15078
|
-
|
|
15079
|
-
|
|
15166
|
+
const onSelect = (0, import_react17.useCallback)(
|
|
15167
|
+
({ item }) => {
|
|
15168
|
+
const isDefaultView = item.id === "default";
|
|
15169
|
+
const updatedView = isDefaultView ? defaultView : {
|
|
15170
|
+
...item,
|
|
15171
|
+
table_config: customAndConfigSync(
|
|
15172
|
+
item.table_config,
|
|
15173
|
+
defaultView.table_config
|
|
15174
|
+
)
|
|
15175
|
+
};
|
|
15176
|
+
updateTableConfig(updatedView, tableApi, "data-table");
|
|
15177
|
+
return updatedView;
|
|
15178
|
+
},
|
|
15179
|
+
[defaultView, tableApi]
|
|
15180
|
+
);
|
|
15080
15181
|
if (!internalTableConfig) {
|
|
15081
15182
|
return null;
|
|
15082
15183
|
}
|
|
15083
|
-
|
|
15184
|
+
const stickyViewsKey = generateStickyViewsKey2(
|
|
15185
|
+
props.domain,
|
|
15186
|
+
props.tableName,
|
|
15187
|
+
userId,
|
|
15188
|
+
projectId,
|
|
15189
|
+
companyId
|
|
15190
|
+
);
|
|
15191
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_toast_alert4.ToastAlertProvider, null, /* @__PURE__ */ import_react17.default.createElement(
|
|
15084
15192
|
SavedViews,
|
|
15085
15193
|
{
|
|
15086
15194
|
onSelect,
|
|
15087
15195
|
domain: props.domain,
|
|
15088
|
-
userId
|
|
15196
|
+
userId,
|
|
15089
15197
|
projectId,
|
|
15090
15198
|
companyId,
|
|
15091
15199
|
provider: "data-table",
|
|
15092
15200
|
defaultView,
|
|
15093
15201
|
tableName: props.tableName,
|
|
15094
15202
|
tableConfig: internalTableConfig,
|
|
15095
|
-
stickyViewsKey
|
|
15096
|
-
enableSavedViews: props.enableSavedViews
|
|
15203
|
+
stickyViewsKey
|
|
15097
15204
|
}
|
|
15098
15205
|
));
|
|
15099
15206
|
});
|