@procore/saved-views 5.1.0-alpha.1 → 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 +541 -440
- package/dist/legacy/index.mjs +569 -456
- package/dist/modern/index.d.mts +6 -10
- package/dist/modern/index.d.ts +6 -10
- package/dist/modern/index.js +539 -439
- package/dist/modern/index.mjs +567 -455
- package/package.json +1 -1
package/dist/modern/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
|
if (!props.item) {
|
|
11208
11225
|
return;
|
|
@@ -11229,11 +11246,12 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11229
11246
|
const copyShareLink = async (event) => {
|
|
11230
11247
|
event.stopPropagation();
|
|
11231
11248
|
try {
|
|
11232
|
-
const
|
|
11233
|
-
|
|
11249
|
+
const { origin, pathname } = window.location;
|
|
11250
|
+
const shareUrl = new URL(`${origin}${pathname}`);
|
|
11251
|
+
shareUrl.searchParams.set("saved-view", props.item.share_token);
|
|
11252
|
+
await navigator.clipboard.writeText(shareUrl.toString());
|
|
11234
11253
|
showToast.success(i18n.t("savedViews.actions.linkCopied"));
|
|
11235
11254
|
} catch (error) {
|
|
11236
|
-
console.error("Failed to copy link:", error);
|
|
11237
11255
|
showToast.error(i18n.t("savedViews.errors.copyFailed"));
|
|
11238
11256
|
}
|
|
11239
11257
|
};
|
|
@@ -11247,7 +11265,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11247
11265
|
label: i18n.t("savedViews.actions.delete")
|
|
11248
11266
|
}
|
|
11249
11267
|
];
|
|
11250
|
-
return /* @__PURE__ */
|
|
11268
|
+
return /* @__PURE__ */ React15.createElement(
|
|
11251
11269
|
Container2,
|
|
11252
11270
|
{
|
|
11253
11271
|
"aria-selected": Boolean(props.selected),
|
|
@@ -11258,7 +11276,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11258
11276
|
}),
|
|
11259
11277
|
"data-testid": "saved-view-collection-menu-item"
|
|
11260
11278
|
},
|
|
11261
|
-
/* @__PURE__ */
|
|
11279
|
+
/* @__PURE__ */ React15.createElement(
|
|
11262
11280
|
"span",
|
|
11263
11281
|
{
|
|
11264
11282
|
"data-testid": "saved-view-display-name",
|
|
@@ -11266,7 +11284,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11266
11284
|
},
|
|
11267
11285
|
props.item.name
|
|
11268
11286
|
),
|
|
11269
|
-
/* @__PURE__ */
|
|
11287
|
+
/* @__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(
|
|
11270
11288
|
import_core_react3.Button,
|
|
11271
11289
|
{
|
|
11272
11290
|
onClick: updateItem,
|
|
@@ -11277,7 +11295,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11277
11295
|
loading: props.isUpdateProcessing
|
|
11278
11296
|
},
|
|
11279
11297
|
i18n.t("savedViews.actions.update")
|
|
11280
|
-
)), props.item.id !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary" && /* @__PURE__ */
|
|
11298
|
+
)), props.item.id !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary" && /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(
|
|
11281
11299
|
import_core_react3.Button,
|
|
11282
11300
|
{
|
|
11283
11301
|
onClick: copyShareLink,
|
|
@@ -11286,8 +11304,22 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11286
11304
|
"aria-label": i18n.t("savedViews.actions.copyShareLink"),
|
|
11287
11305
|
"data-testid": "copy-share-link-button"
|
|
11288
11306
|
},
|
|
11289
|
-
/* @__PURE__ */
|
|
11290
|
-
))
|
|
11307
|
+
/* @__PURE__ */ React15.createElement(Link_default, { size: "sm" })
|
|
11308
|
+
)), props.item.id === "temporary" && /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(
|
|
11309
|
+
import_core_react3.Button,
|
|
11310
|
+
{
|
|
11311
|
+
onClick: (e2) => {
|
|
11312
|
+
e2.stopPropagation();
|
|
11313
|
+
props.onClearTemporary?.();
|
|
11314
|
+
},
|
|
11315
|
+
variant: "tertiary",
|
|
11316
|
+
size: "sm",
|
|
11317
|
+
"aria-label": i18n.t("savedViews.actions.clearTemporary"),
|
|
11318
|
+
title: i18n.t("savedViews.actions.clearTemporary"),
|
|
11319
|
+
"data-testid": "clear-temporary-view-button"
|
|
11320
|
+
},
|
|
11321
|
+
/* @__PURE__ */ React15.createElement(Clear_default, { size: "sm" })
|
|
11322
|
+
))), /* @__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(
|
|
11291
11323
|
import_core_react3.DropdownFlyout,
|
|
11292
11324
|
{
|
|
11293
11325
|
"data-testid": "saved-view-overflow-button",
|
|
@@ -11315,7 +11347,7 @@ var import_core_react7 = require("@procore/core-react");
|
|
|
11315
11347
|
var import_toast_alert2 = require("@procore/toast-alert");
|
|
11316
11348
|
var import_react9 = __toESM(require("react"));
|
|
11317
11349
|
|
|
11318
|
-
//
|
|
11350
|
+
// node_modules/@procore/core-http/dist/modern/index.js
|
|
11319
11351
|
function getCSRFToken() {
|
|
11320
11352
|
const token = document.cookie.match("(^|;)\\s*csrf_token\\s*=\\s*([^;]+)");
|
|
11321
11353
|
return token ? decodeURIComponent(token.pop() || "") : "";
|
|
@@ -11372,7 +11404,7 @@ var useApiRequest = (props, method, mutationKey) => {
|
|
|
11372
11404
|
mutationFn: async (savedView) => {
|
|
11373
11405
|
let url = "";
|
|
11374
11406
|
if (method === "DELETE" || method === "PUT") {
|
|
11375
|
-
url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedView.
|
|
11407
|
+
url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedView.share_token}?permissions_domain=${domain}`;
|
|
11376
11408
|
} else {
|
|
11377
11409
|
url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views?table_name=${tableName}&permissions_domain=${domain}`;
|
|
11378
11410
|
}
|
|
@@ -11401,7 +11433,9 @@ var useApiRequest = (props, method, mutationKey) => {
|
|
|
11401
11433
|
domain,
|
|
11402
11434
|
tableName
|
|
11403
11435
|
]);
|
|
11404
|
-
const oldView = oldData?.find(
|
|
11436
|
+
const oldView = oldData?.find(
|
|
11437
|
+
(item) => item.share_token === savedView.share_token
|
|
11438
|
+
);
|
|
11405
11439
|
if (oldView?.name !== savedView.name) {
|
|
11406
11440
|
queryClient2.invalidateQueries({
|
|
11407
11441
|
queryKey: ["savedViews", domain, tableName]
|
|
@@ -11415,7 +11449,7 @@ var useApiRequest = (props, method, mutationKey) => {
|
|
|
11415
11449
|
if (!oldData)
|
|
11416
11450
|
return [savedView];
|
|
11417
11451
|
return oldData.map(
|
|
11418
|
-
(item) => item.
|
|
11452
|
+
(item) => item.share_token === savedView.share_token ? savedView : item
|
|
11419
11453
|
);
|
|
11420
11454
|
}
|
|
11421
11455
|
);
|
|
@@ -11432,7 +11466,6 @@ var useSavedViewsQuery = (props) => {
|
|
|
11432
11466
|
const { projectId, companyId, domain, tableName } = props;
|
|
11433
11467
|
const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views?table_name=${tableName}&permissions_domain=${domain}`;
|
|
11434
11468
|
return (0, import_react_query2.useQuery)({
|
|
11435
|
-
enabled: props.enableSavedViews,
|
|
11436
11469
|
queryKey: ["savedViews", domain, tableName],
|
|
11437
11470
|
queryFn: async () => {
|
|
11438
11471
|
const getUrl2 = `${url}&per_page=${PAGE_SIZE}`;
|
|
@@ -11445,7 +11478,6 @@ var useSavedViewsPermissions = (props) => {
|
|
|
11445
11478
|
const { projectId, companyId, domain } = props;
|
|
11446
11479
|
const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/permissions?permissions_domain=${domain}`;
|
|
11447
11480
|
return (0, import_react_query2.useQuery)({
|
|
11448
|
-
enabled: props.enableSavedViews,
|
|
11449
11481
|
queryKey: ["savedViewsConfig", domain],
|
|
11450
11482
|
queryFn: async () => {
|
|
11451
11483
|
const response = await requestJSON(url);
|
|
@@ -11468,13 +11500,13 @@ var useDeleteSavedView = (props) => useApiRequest(props, "DELETE", [
|
|
|
11468
11500
|
props.domain,
|
|
11469
11501
|
props.tableName
|
|
11470
11502
|
]);
|
|
11471
|
-
var useFetchSavedViewById = (
|
|
11503
|
+
var useFetchSavedViewById = (savedViewToken, queryInput, enabled = true) => {
|
|
11472
11504
|
const { projectId, companyId } = queryInput;
|
|
11473
11505
|
return (0, import_react_query2.useQuery)({
|
|
11474
|
-
enabled: enabled && Boolean(
|
|
11475
|
-
queryKey: ["savedView",
|
|
11506
|
+
enabled: enabled && Boolean(savedViewToken),
|
|
11507
|
+
queryKey: ["savedView", savedViewToken],
|
|
11476
11508
|
queryFn: async () => {
|
|
11477
|
-
const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${
|
|
11509
|
+
const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedViewToken}`;
|
|
11478
11510
|
const response = await requestJSON(url);
|
|
11479
11511
|
return response.data;
|
|
11480
11512
|
}
|
|
@@ -11553,7 +11585,7 @@ var getColumnIdentifier = (col) => {
|
|
|
11553
11585
|
}
|
|
11554
11586
|
return "";
|
|
11555
11587
|
};
|
|
11556
|
-
var updateTableConfig = (view, tableApi, provider
|
|
11588
|
+
var updateTableConfig = (view, tableApi, provider) => {
|
|
11557
11589
|
if (provider === "smart-grid") {
|
|
11558
11590
|
setSmartGridConfig(
|
|
11559
11591
|
tableApi,
|
|
@@ -11568,9 +11600,6 @@ var updateTableConfig = (view, tableApi, provider, onTableConfigChange) => {
|
|
|
11568
11600
|
dataTableApi?.setRowHeight(rowHeight);
|
|
11569
11601
|
}
|
|
11570
11602
|
dataTableApi?.setTableConfiguration(tableConfig);
|
|
11571
|
-
if (onTableConfigChange) {
|
|
11572
|
-
onTableConfigChange(tableConfig);
|
|
11573
|
-
}
|
|
11574
11603
|
}
|
|
11575
11604
|
}
|
|
11576
11605
|
};
|
|
@@ -11752,8 +11781,7 @@ var PanelContent = (props) => {
|
|
|
11752
11781
|
const { showToast } = (0, import_toast_alert2.useToastAlertContext)();
|
|
11753
11782
|
const I18n = (0, import_core_react7.useI18nContext)();
|
|
11754
11783
|
const { mutate: updateSavedView, isPending: isUpdateLoading } = useUpdateSavedView(props.queryInput);
|
|
11755
|
-
const {
|
|
11756
|
-
const savedViews = props.savedViews ?? savedViewsFromQuery;
|
|
11784
|
+
const { error: savedViewsError } = useSavedViewsQuery(props.queryInput);
|
|
11757
11785
|
const errorToastRef = import_react9.default.useRef(null);
|
|
11758
11786
|
import_react9.default.useEffect(() => {
|
|
11759
11787
|
if (savedViewsError && savedViewsError !== errorToastRef.current) {
|
|
@@ -11762,7 +11790,7 @@ var PanelContent = (props) => {
|
|
|
11762
11790
|
}
|
|
11763
11791
|
}, [savedViewsError, showToast, I18n]);
|
|
11764
11792
|
const { data: permissions } = useSavedViewsPermissions(props.queryInput);
|
|
11765
|
-
const selectedRowRef = useScrollToRef(savedViews);
|
|
11793
|
+
const selectedRowRef = useScrollToRef(props.savedViews);
|
|
11766
11794
|
const onUpdate = (data) => {
|
|
11767
11795
|
const newSavedView = {
|
|
11768
11796
|
...data,
|
|
@@ -11772,8 +11800,7 @@ var PanelContent = (props) => {
|
|
|
11772
11800
|
updateSavedView(newSavedView, {
|
|
11773
11801
|
onSuccess: () => {
|
|
11774
11802
|
showToast.success(I18n.t("savedViews.update.success"));
|
|
11775
|
-
props.
|
|
11776
|
-
props.setSelectedSavedView(newSavedView);
|
|
11803
|
+
props.onSelect({ item: newSavedView });
|
|
11777
11804
|
},
|
|
11778
11805
|
onError: () => {
|
|
11779
11806
|
showToast.error(I18n.t("savedViews.errors.update"));
|
|
@@ -11783,7 +11810,9 @@ var PanelContent = (props) => {
|
|
|
11783
11810
|
const { groups, toggleGroup } = useGroups();
|
|
11784
11811
|
const isDefaultSelected = props.selectedSavedView?.id === "default";
|
|
11785
11812
|
const isTemporarySelected = props.selectedSavedView?.id === "temporary";
|
|
11786
|
-
const temporaryView = savedViews?.find(
|
|
11813
|
+
const temporaryView = props.savedViews?.find(
|
|
11814
|
+
(view) => view.id === "temporary"
|
|
11815
|
+
);
|
|
11787
11816
|
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(
|
|
11788
11817
|
Row,
|
|
11789
11818
|
{
|
|
@@ -11795,7 +11824,8 @@ var PanelContent = (props) => {
|
|
|
11795
11824
|
SavedViewCollectionMenuItem,
|
|
11796
11825
|
{
|
|
11797
11826
|
item: temporaryView,
|
|
11798
|
-
selected: isTemporarySelected
|
|
11827
|
+
selected: isTemporarySelected,
|
|
11828
|
+
onClearTemporary: props.onClearTemporary
|
|
11799
11829
|
}
|
|
11800
11830
|
)
|
|
11801
11831
|
), /* @__PURE__ */ import_react9.default.createElement(
|
|
@@ -11814,7 +11844,7 @@ var PanelContent = (props) => {
|
|
|
11814
11844
|
)
|
|
11815
11845
|
), VIEW_LEVELS.map((level) => {
|
|
11816
11846
|
const isExpanded = groups[level];
|
|
11817
|
-
const views = isExpanded && savedViews ? savedViews.filter(
|
|
11847
|
+
const views = isExpanded && props.savedViews ? props.savedViews.filter(
|
|
11818
11848
|
(view) => view.view_level === level && view.id !== "temporary"
|
|
11819
11849
|
) : [];
|
|
11820
11850
|
return /* @__PURE__ */ import_react9.default.createElement(import_react9.default.Fragment, { key: level }, /* @__PURE__ */ import_react9.default.createElement(
|
|
@@ -11865,7 +11895,7 @@ var PanelContent = (props) => {
|
|
|
11865
11895
|
};
|
|
11866
11896
|
|
|
11867
11897
|
// src/SavedViews/components/SavedViews/SmartGrid/SmartGridSavedViews.tsx
|
|
11868
|
-
var
|
|
11898
|
+
var import_react15 = __toESM(require("react"));
|
|
11869
11899
|
|
|
11870
11900
|
// src/SavedViews/components/SavedViews/SmartGrid/SmartGridDefaultSavedView.tsx
|
|
11871
11901
|
var import_core_react8 = require("@procore/core-react");
|
|
@@ -11926,7 +11956,7 @@ var useSmartGridConfig = (gridApi) => {
|
|
|
11926
11956
|
|
|
11927
11957
|
// src/SavedViews/components/SavedViews/SavedViews.tsx
|
|
11928
11958
|
var import_core_react13 = require("@procore/core-react");
|
|
11929
|
-
var
|
|
11959
|
+
var import_react14 = __toESM(require("react"));
|
|
11930
11960
|
var import_react_query3 = require("@tanstack/react-query");
|
|
11931
11961
|
|
|
11932
11962
|
// src/SavedViews/components/SavedViewsModals/SavedViewsDeleteConfirmationModalShared.tsx
|
|
@@ -11958,7 +11988,7 @@ var import_react12 = __toESM(require("react"));
|
|
|
11958
11988
|
|
|
11959
11989
|
// src/SavedViews/components/SavedViewsModals/SavedViewsCreateUpdateModalBase.tsx
|
|
11960
11990
|
var import_core_react10 = require("@procore/core-react");
|
|
11961
|
-
var
|
|
11991
|
+
var React19 = __toESM(require("react"));
|
|
11962
11992
|
|
|
11963
11993
|
// ../../node_modules/yup/index.esm.js
|
|
11964
11994
|
var import_property_expr = __toESM(require_property_expr());
|
|
@@ -14301,7 +14331,6 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14301
14331
|
tableName,
|
|
14302
14332
|
defaultView,
|
|
14303
14333
|
selectedSavedView,
|
|
14304
|
-
setSelectedSavedView,
|
|
14305
14334
|
setOpenEditCreateModal,
|
|
14306
14335
|
onSelect
|
|
14307
14336
|
}) => {
|
|
@@ -14339,8 +14368,8 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14339
14368
|
};
|
|
14340
14369
|
updateSavedView(body, {
|
|
14341
14370
|
onSuccess: (updatedSavedView) => {
|
|
14371
|
+
onSelect(updatedSavedView);
|
|
14342
14372
|
setOpenEditCreateModal(false);
|
|
14343
|
-
setSelectedSavedView(updatedSavedView);
|
|
14344
14373
|
}
|
|
14345
14374
|
});
|
|
14346
14375
|
} else {
|
|
@@ -14359,7 +14388,7 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14359
14388
|
}
|
|
14360
14389
|
};
|
|
14361
14390
|
const viewLevelOptions = getViewLevelOptions(permissions, I18n);
|
|
14362
|
-
return /* @__PURE__ */
|
|
14391
|
+
return /* @__PURE__ */ React19.createElement(
|
|
14363
14392
|
import_core_react10.Modal,
|
|
14364
14393
|
{
|
|
14365
14394
|
"aria-label": I18n.t("savedViews.ariaLabels.modal"),
|
|
@@ -14368,14 +14397,14 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14368
14397
|
style: { width: "540px" },
|
|
14369
14398
|
"data-testid": "create-update-modal"
|
|
14370
14399
|
},
|
|
14371
|
-
/* @__PURE__ */
|
|
14400
|
+
/* @__PURE__ */ React19.createElement(ScrollContainer, null, /* @__PURE__ */ React19.createElement(
|
|
14372
14401
|
import_core_react10.Modal.Header,
|
|
14373
14402
|
{
|
|
14374
14403
|
onClose,
|
|
14375
14404
|
style: { borderBottom: `1px solid ${import_core_react10.colors.gray85}` }
|
|
14376
14405
|
},
|
|
14377
|
-
/* @__PURE__ */
|
|
14378
|
-
), /* @__PURE__ */
|
|
14406
|
+
/* @__PURE__ */ React19.createElement(import_core_react10.H2, null, header)
|
|
14407
|
+
), /* @__PURE__ */ React19.createElement(
|
|
14379
14408
|
import_core_react10.Form,
|
|
14380
14409
|
{
|
|
14381
14410
|
initialValues: {
|
|
@@ -14401,13 +14430,13 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14401
14430
|
onReset: onCancel,
|
|
14402
14431
|
validateOnChange: true
|
|
14403
14432
|
},
|
|
14404
|
-
/* @__PURE__ */
|
|
14433
|
+
/* @__PURE__ */ React19.createElement(import_core_react10.Form.Form, { name: header }, /* @__PURE__ */ React19.createElement(
|
|
14405
14434
|
import_core_react10.Modal.Body,
|
|
14406
14435
|
{
|
|
14407
14436
|
style: { paddingTop: 0, paddingBottom: 0, marginTop: import_core_react10.spacing.lg }
|
|
14408
14437
|
},
|
|
14409
|
-
errors && /* @__PURE__ */
|
|
14410
|
-
/* @__PURE__ */
|
|
14438
|
+
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?.form || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
|
|
14439
|
+
/* @__PURE__ */ React19.createElement(import_core_react10.Form.Row, null, /* @__PURE__ */ React19.createElement(
|
|
14411
14440
|
import_core_react10.Form.Text,
|
|
14412
14441
|
{
|
|
14413
14442
|
name: "name",
|
|
@@ -14418,12 +14447,12 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14418
14447
|
onChange: () => resetMutations()
|
|
14419
14448
|
}
|
|
14420
14449
|
)),
|
|
14421
|
-
/* @__PURE__ */
|
|
14450
|
+
/* @__PURE__ */ React19.createElement(
|
|
14422
14451
|
import_core_react10.Form.Row,
|
|
14423
14452
|
{
|
|
14424
14453
|
style: { marginTop: errors?.name ? import_core_react10.spacing.xl : import_core_react10.spacing.none }
|
|
14425
14454
|
},
|
|
14426
|
-
/* @__PURE__ */
|
|
14455
|
+
/* @__PURE__ */ React19.createElement(
|
|
14427
14456
|
import_core_react10.Form.TextArea,
|
|
14428
14457
|
{
|
|
14429
14458
|
name: "description",
|
|
@@ -14434,7 +14463,7 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14434
14463
|
}
|
|
14435
14464
|
)
|
|
14436
14465
|
),
|
|
14437
|
-
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */
|
|
14466
|
+
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React19.createElement(import_core_react10.Form.Row, null, /* @__PURE__ */ React19.createElement(
|
|
14438
14467
|
import_core_react10.Form.Select,
|
|
14439
14468
|
{
|
|
14440
14469
|
name: "view_level",
|
|
@@ -14444,8 +14473,8 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14444
14473
|
onSearch: false,
|
|
14445
14474
|
onClear: false
|
|
14446
14475
|
}
|
|
14447
|
-
)) : /* @__PURE__ */
|
|
14448
|
-
), /* @__PURE__ */
|
|
14476
|
+
)) : /* @__PURE__ */ React19.createElement(React19.Fragment, null)
|
|
14477
|
+
), /* @__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(
|
|
14449
14478
|
import_core_react10.Button,
|
|
14450
14479
|
{
|
|
14451
14480
|
"data-testid": "create-update-modal-button",
|
|
@@ -14470,7 +14499,6 @@ var SavedViewsFormModal = ({
|
|
|
14470
14499
|
tableName,
|
|
14471
14500
|
queryInput,
|
|
14472
14501
|
selectedSavedView,
|
|
14473
|
-
setSelectedSavedView,
|
|
14474
14502
|
setOpenEditCreateModal,
|
|
14475
14503
|
onSelect,
|
|
14476
14504
|
defaultView
|
|
@@ -14489,7 +14517,6 @@ var SavedViewsFormModal = ({
|
|
|
14489
14517
|
tableConfig,
|
|
14490
14518
|
tableName,
|
|
14491
14519
|
selectedSavedView,
|
|
14492
|
-
setSelectedSavedView,
|
|
14493
14520
|
setOpenEditCreateModal,
|
|
14494
14521
|
onSelect,
|
|
14495
14522
|
defaultView
|
|
@@ -14497,274 +14524,289 @@ var SavedViewsFormModal = ({
|
|
|
14497
14524
|
);
|
|
14498
14525
|
};
|
|
14499
14526
|
|
|
14500
|
-
// src/SavedViews/components/SavedViewsModals/
|
|
14527
|
+
// src/SavedViews/components/SavedViewsModals/SharedViewFormModal.tsx
|
|
14501
14528
|
var import_core_react12 = require("@procore/core-react");
|
|
14502
|
-
var
|
|
14503
|
-
var
|
|
14504
|
-
|
|
14505
|
-
|
|
14506
|
-
|
|
14529
|
+
var React21 = __toESM(require("react"));
|
|
14530
|
+
var SharedViewFormModal = ({
|
|
14531
|
+
open,
|
|
14532
|
+
fetchedView,
|
|
14533
|
+
onClose,
|
|
14534
|
+
onCreateTemporaryView,
|
|
14535
|
+
onCreateView,
|
|
14536
|
+
createError,
|
|
14537
|
+
isCreating,
|
|
14538
|
+
resetCreateError
|
|
14539
|
+
}) => {
|
|
14540
|
+
const I18n = (0, import_core_react12.useI18nContext)();
|
|
14541
|
+
const NAME_MAX_LENGTH = 150;
|
|
14542
|
+
const errors = extractMessage(createError, I18n);
|
|
14543
|
+
const handleNameChange = () => {
|
|
14544
|
+
if (resetCreateError) {
|
|
14545
|
+
resetCreateError();
|
|
14546
|
+
}
|
|
14507
14547
|
};
|
|
14508
|
-
const
|
|
14509
|
-
onCreateView
|
|
14548
|
+
const handleOnSubmit = (data) => {
|
|
14549
|
+
onCreateView(data.name, data.description);
|
|
14510
14550
|
};
|
|
14511
|
-
return /* @__PURE__ */
|
|
14551
|
+
return /* @__PURE__ */ React21.createElement(
|
|
14512
14552
|
import_core_react12.Modal,
|
|
14513
14553
|
{
|
|
14514
|
-
"data-testid": "
|
|
14554
|
+
"data-testid": "shared-view-form-modal",
|
|
14515
14555
|
open,
|
|
14516
|
-
onClickOverlay: onClose
|
|
14517
|
-
|
|
14518
|
-
|
|
14519
|
-
|
|
14520
|
-
|
|
14521
|
-
/* @__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"))),
|
|
14522
|
-
/* @__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(
|
|
14523
|
-
import_core_react12.Button,
|
|
14556
|
+
onClickOverlay: onClose,
|
|
14557
|
+
style: { width: "540px" }
|
|
14558
|
+
},
|
|
14559
|
+
/* @__PURE__ */ React21.createElement(
|
|
14560
|
+
import_core_react12.Modal.Header,
|
|
14524
14561
|
{
|
|
14525
|
-
|
|
14526
|
-
|
|
14527
|
-
|
|
14562
|
+
onClose,
|
|
14563
|
+
style: {
|
|
14564
|
+
paddingTop: import_core_react12.spacing.lg,
|
|
14565
|
+
paddingBottom: import_core_react12.spacing.xs,
|
|
14566
|
+
paddingLeft: import_core_react12.spacing.xl,
|
|
14567
|
+
paddingRight: import_core_react12.spacing.xl
|
|
14568
|
+
}
|
|
14528
14569
|
},
|
|
14529
|
-
|
|
14530
|
-
),
|
|
14531
|
-
|
|
14570
|
+
I18n.t("savedViews.modal.create.title")
|
|
14571
|
+
),
|
|
14572
|
+
/* @__PURE__ */ React21.createElement(
|
|
14573
|
+
import_core_react12.P,
|
|
14532
14574
|
{
|
|
14533
|
-
|
|
14534
|
-
|
|
14535
|
-
|
|
14575
|
+
style: {
|
|
14576
|
+
paddingLeft: import_core_react12.spacing.xl,
|
|
14577
|
+
paddingRight: import_core_react12.spacing.xl,
|
|
14578
|
+
paddingBottom: import_core_react12.spacing.lg,
|
|
14579
|
+
paddingTop: import_core_react12.spacing.none,
|
|
14580
|
+
margin: 0,
|
|
14581
|
+
color: import_core_react12.colors.gray45,
|
|
14582
|
+
whiteSpace: "pre-line"
|
|
14583
|
+
}
|
|
14536
14584
|
},
|
|
14537
|
-
|
|
14538
|
-
)
|
|
14585
|
+
I18n.t("savedViews.modal.copyConfirmation.description")
|
|
14586
|
+
),
|
|
14587
|
+
/* @__PURE__ */ React21.createElement(
|
|
14588
|
+
import_core_react12.Form,
|
|
14589
|
+
{
|
|
14590
|
+
initialValues: {
|
|
14591
|
+
name: fetchedView.name,
|
|
14592
|
+
description: fetchedView.description ?? ""
|
|
14593
|
+
},
|
|
14594
|
+
view: "create",
|
|
14595
|
+
validationSchema: create$3().shape({
|
|
14596
|
+
name: create$6().trim().max(
|
|
14597
|
+
NAME_MAX_LENGTH,
|
|
14598
|
+
I18n.t("savedViews.modal.errors.maxLengthName", {
|
|
14599
|
+
maxLength: NAME_MAX_LENGTH
|
|
14600
|
+
})
|
|
14601
|
+
).required(I18n.t("savedViews.modal.errors.required"))
|
|
14602
|
+
}),
|
|
14603
|
+
onSubmit: handleOnSubmit,
|
|
14604
|
+
validateOnChange: true
|
|
14605
|
+
},
|
|
14606
|
+
/* @__PURE__ */ React21.createElement(import_core_react12.Form.Form, { name: "share-view-form" }, /* @__PURE__ */ React21.createElement(
|
|
14607
|
+
import_core_react12.Modal.Body,
|
|
14608
|
+
{
|
|
14609
|
+
style: {
|
|
14610
|
+
paddingTop: import_core_react12.spacing.lg,
|
|
14611
|
+
paddingBottom: 0,
|
|
14612
|
+
borderTop: `1px solid ${import_core_react12.colors.gray85}`
|
|
14613
|
+
}
|
|
14614
|
+
},
|
|
14615
|
+
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", {
|
|
14616
|
+
mode: "create"
|
|
14617
|
+
})), /* @__PURE__ */ React21.createElement(import_core_react12.Banner.Body, null, errors?.form || I18n.t("savedViews.modal.errors.description.create")))),
|
|
14618
|
+
/* @__PURE__ */ React21.createElement(import_core_react12.Form.Row, null, /* @__PURE__ */ React21.createElement(
|
|
14619
|
+
import_core_react12.Form.Text,
|
|
14620
|
+
{
|
|
14621
|
+
name: "name",
|
|
14622
|
+
error: errors?.name,
|
|
14623
|
+
placeholder: I18n.t("savedViews.modal.fields.name"),
|
|
14624
|
+
label: I18n.t("savedViews.modal.fields.name"),
|
|
14625
|
+
colWidth: 12,
|
|
14626
|
+
onChange: handleNameChange
|
|
14627
|
+
}
|
|
14628
|
+
)),
|
|
14629
|
+
/* @__PURE__ */ React21.createElement(
|
|
14630
|
+
import_core_react12.Form.Row,
|
|
14631
|
+
{
|
|
14632
|
+
style: { marginTop: errors?.name ? import_core_react12.spacing.xl : import_core_react12.spacing.none }
|
|
14633
|
+
},
|
|
14634
|
+
/* @__PURE__ */ React21.createElement(
|
|
14635
|
+
import_core_react12.Form.TextArea,
|
|
14636
|
+
{
|
|
14637
|
+
name: "description",
|
|
14638
|
+
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
14639
|
+
label: I18n.t("savedViews.modal.fields.description"),
|
|
14640
|
+
colWidth: 12,
|
|
14641
|
+
resize: "vertical"
|
|
14642
|
+
}
|
|
14643
|
+
)
|
|
14644
|
+
)
|
|
14645
|
+
), /* @__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(
|
|
14646
|
+
import_core_react12.Button,
|
|
14647
|
+
{
|
|
14648
|
+
variant: "secondary",
|
|
14649
|
+
onClick: onCreateTemporaryView,
|
|
14650
|
+
"data-testid": "view-temporarily-button",
|
|
14651
|
+
disabled: isCreating
|
|
14652
|
+
},
|
|
14653
|
+
I18n.t("savedViews.actions.viewTemporarily")
|
|
14654
|
+
), /* @__PURE__ */ React21.createElement(
|
|
14655
|
+
import_core_react12.Button,
|
|
14656
|
+
{
|
|
14657
|
+
type: "submit",
|
|
14658
|
+
variant: "primary",
|
|
14659
|
+
"data-testid": "create-view-button",
|
|
14660
|
+
disabled: isCreating,
|
|
14661
|
+
loading: isCreating
|
|
14662
|
+
},
|
|
14663
|
+
I18n.t("savedViews.actions.create")
|
|
14664
|
+
)))))
|
|
14665
|
+
)
|
|
14539
14666
|
);
|
|
14540
14667
|
};
|
|
14541
14668
|
|
|
14542
14669
|
// src/utils/Hooks/useViewSelection.ts
|
|
14543
|
-
var
|
|
14544
|
-
|
|
14545
|
-
// src/utils/Hooks/useUrlSync.ts
|
|
14546
|
-
var import_react14 = require("react");
|
|
14670
|
+
var import_react13 = require("react");
|
|
14547
14671
|
var import_react_router_dom = require("react-router-dom");
|
|
14548
|
-
var useUrlSync = (selectedView, availableViews, defaultView, onViewFound, onViewNotFound) => {
|
|
14549
|
-
const [searchParams, setSearchParams] = (0, import_react_router_dom.useSearchParams)();
|
|
14550
|
-
const applySavedViewFromUrl = (savedViewId) => {
|
|
14551
|
-
if (savedViewId === "default") {
|
|
14552
|
-
if (defaultView.id !== selectedView?.id) {
|
|
14553
|
-
onViewFound(defaultView);
|
|
14554
|
-
}
|
|
14555
|
-
return;
|
|
14556
|
-
}
|
|
14557
|
-
const viewInUserViews = availableViews.find((v2) => v2.id === savedViewId);
|
|
14558
|
-
if (viewInUserViews) {
|
|
14559
|
-
if (viewInUserViews.id !== selectedView?.id) {
|
|
14560
|
-
onViewFound(viewInUserViews);
|
|
14561
|
-
}
|
|
14562
|
-
} else {
|
|
14563
|
-
onViewNotFound(savedViewId);
|
|
14564
|
-
}
|
|
14565
|
-
};
|
|
14566
|
-
const applyListView = (viewParam) => {
|
|
14567
|
-
if (viewParam === "list" && defaultView.id !== selectedView?.id) {
|
|
14568
|
-
onViewFound(defaultView);
|
|
14569
|
-
}
|
|
14570
|
-
};
|
|
14571
|
-
(0, import_react14.useEffect)(() => {
|
|
14572
|
-
if (!availableViews.length)
|
|
14573
|
-
return;
|
|
14574
|
-
const savedViewId = searchParams.get("saved-view");
|
|
14575
|
-
const viewParamFromConsumer = searchParams.get("view");
|
|
14576
|
-
if (savedViewId) {
|
|
14577
|
-
applySavedViewFromUrl(savedViewId);
|
|
14578
|
-
return;
|
|
14579
|
-
}
|
|
14580
|
-
if (viewParamFromConsumer) {
|
|
14581
|
-
applyListView(viewParamFromConsumer);
|
|
14582
|
-
}
|
|
14583
|
-
}, [
|
|
14584
|
-
searchParams,
|
|
14585
|
-
availableViews,
|
|
14586
|
-
defaultView,
|
|
14587
|
-
selectedView,
|
|
14588
|
-
onViewFound,
|
|
14589
|
-
onViewNotFound
|
|
14590
|
-
]);
|
|
14591
|
-
const updateUrl = (view) => {
|
|
14592
|
-
setSearchParams(
|
|
14593
|
-
(currentParams) => {
|
|
14594
|
-
const updatedParams = new URLSearchParams(currentParams);
|
|
14595
|
-
if (view.id === "default") {
|
|
14596
|
-
updatedParams.delete("saved-view");
|
|
14597
|
-
} else {
|
|
14598
|
-
updatedParams.set("saved-view", view.id);
|
|
14599
|
-
}
|
|
14600
|
-
return updatedParams;
|
|
14601
|
-
},
|
|
14602
|
-
{ replace: true }
|
|
14603
|
-
);
|
|
14604
|
-
};
|
|
14605
|
-
return { updateUrl };
|
|
14606
|
-
};
|
|
14607
14672
|
|
|
14608
|
-
// src/utils/
|
|
14609
|
-
var
|
|
14610
|
-
|
|
14673
|
+
// src/utils/viewStorage.ts
|
|
14674
|
+
var ViewStorage = {
|
|
14675
|
+
save(key, view) {
|
|
14676
|
+
localStorage.setItem(key, JSON.stringify(view));
|
|
14677
|
+
},
|
|
14678
|
+
load(key) {
|
|
14611
14679
|
try {
|
|
14612
|
-
const
|
|
14613
|
-
|
|
14614
|
-
`${config.domain}_${config.tableName}_${config.stickyViewsKey}_${config.projectId}_${config.userId}`
|
|
14615
|
-
)
|
|
14616
|
-
);
|
|
14617
|
-
return savedView || config.defaultView;
|
|
14680
|
+
const stored = localStorage.getItem(key);
|
|
14681
|
+
return stored ? JSON.parse(stored) : null;
|
|
14618
14682
|
} catch (e2) {
|
|
14619
|
-
return
|
|
14683
|
+
return null;
|
|
14620
14684
|
}
|
|
14685
|
+
},
|
|
14686
|
+
remove(key) {
|
|
14687
|
+
localStorage.removeItem(key);
|
|
14688
|
+
}
|
|
14689
|
+
};
|
|
14690
|
+
|
|
14691
|
+
// src/utils/Hooks/useViewSelection.ts
|
|
14692
|
+
var getUpdatedSearchParams = (currentParams, view) => {
|
|
14693
|
+
const updatedParams = new URLSearchParams(currentParams);
|
|
14694
|
+
if (view.id === "default") {
|
|
14695
|
+
updatedParams.delete("saved-view");
|
|
14696
|
+
} else if (view.id === "temporary") {
|
|
14697
|
+
updatedParams.set("saved-view", "temporary");
|
|
14698
|
+
} else {
|
|
14699
|
+
updatedParams.set("saved-view", view.share_token);
|
|
14700
|
+
}
|
|
14701
|
+
return updatedParams;
|
|
14702
|
+
};
|
|
14703
|
+
var checkIsViewSelected = (selectedView, viewId) => {
|
|
14704
|
+
return selectedView?.share_token === viewId || selectedView?.id === viewId;
|
|
14705
|
+
};
|
|
14706
|
+
var useViewSelection = (config, savedViews, openSharedViewModal) => {
|
|
14707
|
+
const storageKey = `${config.domain}_${config.tableName}_${config.stickyViewsKey}_${config.projectId}_${config.userId}`;
|
|
14708
|
+
const temporaryStorageKey = `${storageKey}_temporary`;
|
|
14709
|
+
const [searchParams, setSearchParams] = (0, import_react_router_dom.useSearchParams)();
|
|
14710
|
+
const [selectedSavedView, setSelectedSavedView] = (0, import_react13.useState)(() => {
|
|
14711
|
+
const stored = ViewStorage.load(storageKey);
|
|
14712
|
+
return stored ?? config.defaultView;
|
|
14621
14713
|
});
|
|
14622
|
-
const [temporaryView, setTemporaryView] = (0,
|
|
14623
|
-
|
|
14624
|
-
|
|
14625
|
-
|
|
14626
|
-
id: "temporary",
|
|
14627
|
-
name: "Temporary View"
|
|
14628
|
-
};
|
|
14629
|
-
setTemporaryView(tempView);
|
|
14630
|
-
return tempView;
|
|
14631
|
-
}, []);
|
|
14632
|
-
const clearTemporaryView = (0, import_react15.useCallback)(() => setTemporaryView(null), []);
|
|
14633
|
-
const updateLocalStorage = (0, import_react15.useCallback)(
|
|
14714
|
+
const [temporaryView, setTemporaryView] = (0, import_react13.useState)(() => {
|
|
14715
|
+
return ViewStorage.load(temporaryStorageKey);
|
|
14716
|
+
});
|
|
14717
|
+
const updateLocalStorage = (0, import_react13.useCallback)(
|
|
14634
14718
|
(view) => {
|
|
14635
14719
|
if (config.stickyViewsKey) {
|
|
14636
|
-
|
|
14637
|
-
`${config.domain}_${config.tableName}_${config.stickyViewsKey}_${config.projectId}_${config.userId}`,
|
|
14638
|
-
JSON.stringify(view)
|
|
14639
|
-
);
|
|
14720
|
+
ViewStorage.save(storageKey, view);
|
|
14640
14721
|
}
|
|
14641
14722
|
},
|
|
14642
|
-
[
|
|
14643
|
-
config.domain,
|
|
14644
|
-
config.tableName,
|
|
14645
|
-
config.stickyViewsKey,
|
|
14646
|
-
config.projectId,
|
|
14647
|
-
config.userId
|
|
14648
|
-
]
|
|
14723
|
+
[config.stickyViewsKey, storageKey]
|
|
14649
14724
|
);
|
|
14650
|
-
const
|
|
14651
|
-
|
|
14652
|
-
|
|
14653
|
-
|
|
14654
|
-
|
|
14655
|
-
|
|
14656
|
-
|
|
14657
|
-
|
|
14658
|
-
openCrossUserModal(viewId);
|
|
14659
|
-
};
|
|
14660
|
-
const { updateUrl } = useUrlSync(
|
|
14661
|
-
selectedSavedView,
|
|
14662
|
-
allViews,
|
|
14663
|
-
config.defaultView,
|
|
14664
|
-
onUrlViewFound,
|
|
14665
|
-
onUrlViewNotFound
|
|
14725
|
+
const updateUrlForView = (0, import_react13.useCallback)(
|
|
14726
|
+
(view) => {
|
|
14727
|
+
setSearchParams(
|
|
14728
|
+
(currentParams) => getUpdatedSearchParams(currentParams, view),
|
|
14729
|
+
{ replace: true }
|
|
14730
|
+
);
|
|
14731
|
+
},
|
|
14732
|
+
[setSearchParams]
|
|
14666
14733
|
);
|
|
14667
|
-
const
|
|
14734
|
+
const baseViews = savedViews ?? [];
|
|
14735
|
+
const allViews = temporaryView ? [...baseViews, temporaryView] : baseViews;
|
|
14736
|
+
const selectView = (0, import_react13.useCallback)(
|
|
14668
14737
|
(view) => {
|
|
14669
|
-
if (view.id !== "temporary" && temporaryView) {
|
|
14670
|
-
clearTemporaryView();
|
|
14671
|
-
}
|
|
14672
14738
|
const viewToSelect = config.onSelect({ item: view });
|
|
14673
14739
|
setSelectedSavedView(viewToSelect);
|
|
14674
14740
|
updateLocalStorage(viewToSelect);
|
|
14675
|
-
|
|
14741
|
+
updateUrlForView(viewToSelect);
|
|
14676
14742
|
return viewToSelect;
|
|
14677
14743
|
},
|
|
14678
|
-
[config,
|
|
14679
|
-
);
|
|
14680
|
-
return {
|
|
14681
|
-
selectedView: selectedSavedView,
|
|
14682
|
-
selectView,
|
|
14683
|
-
updateLocalStorage,
|
|
14684
|
-
temporaryView,
|
|
14685
|
-
createTemporaryView
|
|
14686
|
-
};
|
|
14687
|
-
};
|
|
14688
|
-
|
|
14689
|
-
// src/utils/Hooks/useCrossUserSharing.ts
|
|
14690
|
-
var import_react16 = __toESM(require("react"));
|
|
14691
|
-
var useCrossUserSharing = (queryInput, viewId, selectedSavedView, defaultView, actions, tableName) => {
|
|
14692
|
-
const { data: fetchedView, isError: fetchError } = useFetchSavedViewById(
|
|
14693
|
-
viewId,
|
|
14694
|
-
queryInput,
|
|
14695
|
-
Boolean(viewId)
|
|
14744
|
+
[config, updateLocalStorage, updateUrlForView]
|
|
14696
14745
|
);
|
|
14697
|
-
const
|
|
14698
|
-
|
|
14699
|
-
|
|
14700
|
-
|
|
14701
|
-
|
|
14702
|
-
|
|
14703
|
-
}, [fetchError, viewId, actions, selectedSavedView, defaultView]);
|
|
14704
|
-
const viewSharedViewTemporarily = () => {
|
|
14705
|
-
if (fetchedView) {
|
|
14706
|
-
const tempView = actions.createTemporaryView(fetchedView);
|
|
14707
|
-
actions.selectView(tempView);
|
|
14708
|
-
actions.closeModal();
|
|
14709
|
-
}
|
|
14710
|
-
};
|
|
14711
|
-
const createPersonalCopyOfSharedView = () => {
|
|
14712
|
-
if (fetchedView) {
|
|
14713
|
-
const viewToCreate = {
|
|
14714
|
-
name: fetchedView.name,
|
|
14715
|
-
description: fetchedView.description,
|
|
14716
|
-
table_name: tableName,
|
|
14717
|
-
table_config: fetchedView.table_config,
|
|
14718
|
-
view_level: "personal"
|
|
14746
|
+
const createTemporaryView = (0, import_react13.useCallback)(
|
|
14747
|
+
(fetchedView) => {
|
|
14748
|
+
const tempView = {
|
|
14749
|
+
...fetchedView,
|
|
14750
|
+
id: "temporary",
|
|
14751
|
+
name: "Temporary View"
|
|
14719
14752
|
};
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14725
|
-
|
|
14726
|
-
}
|
|
14727
|
-
};
|
|
14728
|
-
const selectCurrentViewAndCloseModal = () => {
|
|
14729
|
-
actions.selectView(selectedSavedView ?? defaultView);
|
|
14730
|
-
actions.closeModal();
|
|
14731
|
-
};
|
|
14732
|
-
return {
|
|
14733
|
-
fetchedView,
|
|
14734
|
-
viewSharedViewTemporarily,
|
|
14735
|
-
createPersonalCopyOfSharedView,
|
|
14736
|
-
selectCurrentViewAndCloseModal
|
|
14737
|
-
};
|
|
14738
|
-
};
|
|
14739
|
-
|
|
14740
|
-
// src/utils/Hooks/useModalState.ts
|
|
14741
|
-
var import_react17 = require("react");
|
|
14742
|
-
var useModalState = () => {
|
|
14743
|
-
const [activeModal, setActiveModal] = (0, import_react17.useState)(null);
|
|
14744
|
-
const [modalData, setModalData] = (0, import_react17.useState)(null);
|
|
14745
|
-
const openModal = (0, import_react17.useCallback)(
|
|
14746
|
-
(type, data) => {
|
|
14747
|
-
setActiveModal(type);
|
|
14748
|
-
setModalData(data ?? null);
|
|
14749
|
-
},
|
|
14750
|
-
[]
|
|
14753
|
+
ViewStorage.save(temporaryStorageKey, tempView);
|
|
14754
|
+
setTemporaryView(tempView);
|
|
14755
|
+
selectView(tempView);
|
|
14756
|
+
return tempView;
|
|
14757
|
+
},
|
|
14758
|
+
[temporaryStorageKey, selectView]
|
|
14751
14759
|
);
|
|
14752
|
-
const
|
|
14753
|
-
|
|
14754
|
-
|
|
14755
|
-
|
|
14756
|
-
|
|
14757
|
-
|
|
14758
|
-
|
|
14760
|
+
const clearTemporaryView = (0, import_react13.useCallback)(() => {
|
|
14761
|
+
ViewStorage.remove(temporaryStorageKey);
|
|
14762
|
+
setTemporaryView(null);
|
|
14763
|
+
selectView(config.defaultView);
|
|
14764
|
+
}, [temporaryStorageKey, config.defaultView, selectView]);
|
|
14765
|
+
const isViewAlreadySelected = (0, import_react13.useCallback)(
|
|
14766
|
+
(viewId) => checkIsViewSelected(selectedSavedView, viewId),
|
|
14767
|
+
[selectedSavedView]
|
|
14768
|
+
);
|
|
14769
|
+
const handleSavedViewFromUrl = (0, import_react13.useCallback)(
|
|
14770
|
+
(viewId) => {
|
|
14771
|
+
if (isViewAlreadySelected(viewId)) {
|
|
14772
|
+
return;
|
|
14773
|
+
}
|
|
14774
|
+
openSharedViewModal(viewId);
|
|
14759
14775
|
},
|
|
14760
|
-
[
|
|
14776
|
+
[isViewAlreadySelected, openSharedViewModal]
|
|
14761
14777
|
);
|
|
14778
|
+
const handleListViewFromUrl = (0, import_react13.useCallback)(() => {
|
|
14779
|
+
if (config.defaultView.id !== selectedSavedView?.id) {
|
|
14780
|
+
selectView(config.defaultView);
|
|
14781
|
+
}
|
|
14782
|
+
}, [config.defaultView, selectedSavedView, selectView]);
|
|
14783
|
+
(0, import_react13.useEffect)(() => {
|
|
14784
|
+
if (!allViews.length)
|
|
14785
|
+
return;
|
|
14786
|
+
const savedViewId = searchParams.get("saved-view");
|
|
14787
|
+
const viewParamFromConsumer = searchParams.get("view");
|
|
14788
|
+
if (savedViewId) {
|
|
14789
|
+
handleSavedViewFromUrl(savedViewId);
|
|
14790
|
+
return;
|
|
14791
|
+
}
|
|
14792
|
+
if (viewParamFromConsumer === "list") {
|
|
14793
|
+
handleListViewFromUrl();
|
|
14794
|
+
}
|
|
14795
|
+
}, [
|
|
14796
|
+
searchParams,
|
|
14797
|
+
savedViews,
|
|
14798
|
+
temporaryView,
|
|
14799
|
+
handleSavedViewFromUrl,
|
|
14800
|
+
handleListViewFromUrl,
|
|
14801
|
+
allViews.length
|
|
14802
|
+
]);
|
|
14762
14803
|
return {
|
|
14763
|
-
|
|
14764
|
-
|
|
14765
|
-
|
|
14766
|
-
|
|
14767
|
-
|
|
14804
|
+
selectedView: selectedSavedView,
|
|
14805
|
+
selectView,
|
|
14806
|
+
temporaryView,
|
|
14807
|
+
createTemporaryView,
|
|
14808
|
+
clearTemporaryView,
|
|
14809
|
+
allViews
|
|
14768
14810
|
};
|
|
14769
14811
|
};
|
|
14770
14812
|
|
|
@@ -14784,16 +14826,26 @@ var SavedViewsContent = (props) => {
|
|
|
14784
14826
|
};
|
|
14785
14827
|
const { data: savedViews } = useSavedViewsQuery(queryInput);
|
|
14786
14828
|
const { mutate: deleteSavedView } = useDeleteSavedView(queryInput);
|
|
14787
|
-
const
|
|
14788
|
-
const
|
|
14789
|
-
|
|
14829
|
+
const [activeModal, setActiveModal] = (0, import_react14.useState)(null);
|
|
14830
|
+
const [modalData, setModalData] = (0, import_react14.useState)(null);
|
|
14831
|
+
const openModal = (type, data) => {
|
|
14832
|
+
setActiveModal(type);
|
|
14833
|
+
setModalData(data ?? null);
|
|
14834
|
+
};
|
|
14835
|
+
const closeModal = (0, import_react14.useCallback)(() => {
|
|
14836
|
+
setActiveModal(null);
|
|
14837
|
+
setModalData(null);
|
|
14838
|
+
}, []);
|
|
14839
|
+
const isModalOpen = (type) => activeModal === type;
|
|
14840
|
+
const openSharedViewModal = (viewId) => {
|
|
14841
|
+
openModal("sharedView" /* SHARED_VIEW */, { viewId });
|
|
14790
14842
|
};
|
|
14791
14843
|
const {
|
|
14792
14844
|
selectedView,
|
|
14793
14845
|
selectView,
|
|
14794
|
-
|
|
14795
|
-
|
|
14796
|
-
|
|
14846
|
+
createTemporaryView,
|
|
14847
|
+
clearTemporaryView,
|
|
14848
|
+
allViews
|
|
14797
14849
|
} = useViewSelection(
|
|
14798
14850
|
{
|
|
14799
14851
|
domain: props.domain,
|
|
@@ -14805,25 +14857,54 @@ var SavedViewsContent = (props) => {
|
|
|
14805
14857
|
onSelect: props.onSelect
|
|
14806
14858
|
},
|
|
14807
14859
|
savedViews,
|
|
14808
|
-
|
|
14860
|
+
openSharedViewModal
|
|
14809
14861
|
);
|
|
14810
|
-
const {
|
|
14811
|
-
fetchedView,
|
|
14812
|
-
viewSharedViewTemporarily,
|
|
14813
|
-
createPersonalCopyOfSharedView,
|
|
14814
|
-
selectCurrentViewAndCloseModal
|
|
14815
|
-
} = useCrossUserSharing(
|
|
14816
|
-
queryInput,
|
|
14862
|
+
const { data: fetchedView, isError: fetchError } = useFetchSavedViewById(
|
|
14817
14863
|
modalData?.viewId ?? null,
|
|
14818
|
-
|
|
14819
|
-
|
|
14820
|
-
{
|
|
14821
|
-
selectView,
|
|
14822
|
-
createTemporaryView,
|
|
14823
|
-
closeModal
|
|
14824
|
-
},
|
|
14825
|
-
props.tableName
|
|
14864
|
+
queryInput,
|
|
14865
|
+
Boolean(modalData?.viewId)
|
|
14826
14866
|
);
|
|
14867
|
+
const {
|
|
14868
|
+
mutate: createSavedView,
|
|
14869
|
+
isPending: isCreating,
|
|
14870
|
+
error: createError,
|
|
14871
|
+
reset: resetCreateError
|
|
14872
|
+
} = useCreateSavedView(queryInput);
|
|
14873
|
+
(0, import_react14.useEffect)(() => {
|
|
14874
|
+
if (fetchError) {
|
|
14875
|
+
selectView(selectedView ?? props.defaultView);
|
|
14876
|
+
closeModal();
|
|
14877
|
+
}
|
|
14878
|
+
}, [fetchError, selectedView, props.defaultView, selectView, closeModal]);
|
|
14879
|
+
const viewSharedViewTemporarily = () => {
|
|
14880
|
+
if (fetchedView) {
|
|
14881
|
+
createTemporaryView(fetchedView);
|
|
14882
|
+
closeModal();
|
|
14883
|
+
}
|
|
14884
|
+
};
|
|
14885
|
+
const createPersonalCopyOfSharedView = (name, description) => {
|
|
14886
|
+
if (fetchedView) {
|
|
14887
|
+
const viewToCreate = {
|
|
14888
|
+
id: "",
|
|
14889
|
+
name,
|
|
14890
|
+
description,
|
|
14891
|
+
table_name: props.tableName,
|
|
14892
|
+
table_config: fetchedView.table_config,
|
|
14893
|
+
view_level: "personal",
|
|
14894
|
+
share_token: ""
|
|
14895
|
+
};
|
|
14896
|
+
createSavedView(viewToCreate, {
|
|
14897
|
+
onSuccess: (newView) => {
|
|
14898
|
+
selectView(newView);
|
|
14899
|
+
closeModal();
|
|
14900
|
+
}
|
|
14901
|
+
});
|
|
14902
|
+
}
|
|
14903
|
+
};
|
|
14904
|
+
const selectCurrentViewAndCloseModal = () => {
|
|
14905
|
+
selectView(selectedView ?? props.defaultView);
|
|
14906
|
+
closeModal();
|
|
14907
|
+
};
|
|
14827
14908
|
const deleteSelectedView = () => {
|
|
14828
14909
|
if (selectedView) {
|
|
14829
14910
|
deleteSavedView(selectedView, {
|
|
@@ -14836,27 +14917,22 @@ var SavedViewsContent = (props) => {
|
|
|
14836
14917
|
closeModal();
|
|
14837
14918
|
};
|
|
14838
14919
|
const i18n = (0, import_core_react13.useI18nContext)();
|
|
14839
|
-
|
|
14840
|
-
const setSelectedSavedView = (view) => {
|
|
14841
|
-
selectView(view);
|
|
14842
|
-
};
|
|
14843
|
-
const allViews = temporaryView ? [...savedViews ?? [], temporaryView] : savedViews ?? [];
|
|
14844
|
-
return /* @__PURE__ */ import_react18.default.createElement(StyledPanel, { provider: props.provider }, /* @__PURE__ */ import_react18.default.createElement(
|
|
14920
|
+
return /* @__PURE__ */ import_react14.default.createElement(StyledPanel, { provider: props.provider }, /* @__PURE__ */ import_react14.default.createElement(
|
|
14845
14921
|
ExpandedPanel,
|
|
14846
14922
|
{
|
|
14847
14923
|
"data-testid": "saved-view-expanded-panel",
|
|
14848
14924
|
provider: props.provider
|
|
14849
14925
|
},
|
|
14850
|
-
/* @__PURE__ */
|
|
14926
|
+
/* @__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(
|
|
14851
14927
|
import_core_react13.Tooltip,
|
|
14852
14928
|
{
|
|
14853
14929
|
overlay: i18n.t("savedViews.actions.create"),
|
|
14854
14930
|
showDelay: 1e3
|
|
14855
14931
|
},
|
|
14856
|
-
/* @__PURE__ */
|
|
14932
|
+
/* @__PURE__ */ import_react14.default.createElement("span", null, /* @__PURE__ */ import_react14.default.createElement(
|
|
14857
14933
|
import_core_react13.Button,
|
|
14858
14934
|
{
|
|
14859
|
-
icon: /* @__PURE__ */
|
|
14935
|
+
icon: /* @__PURE__ */ import_react14.default.createElement(Plus_default, null),
|
|
14860
14936
|
variant: "secondary",
|
|
14861
14937
|
"data-testid": "expanded-panel-create-button",
|
|
14862
14938
|
onClick: () => openModal("create" /* CREATE */),
|
|
@@ -14865,14 +14941,12 @@ var SavedViewsContent = (props) => {
|
|
|
14865
14941
|
i18n.t("savedViews.actions.create")
|
|
14866
14942
|
))
|
|
14867
14943
|
)),
|
|
14868
|
-
/* @__PURE__ */
|
|
14944
|
+
/* @__PURE__ */ import_react14.default.createElement(import_core_react13.Panel.Body, { style: { display: "flex", flexFlow: "column" } }, /* @__PURE__ */ import_react14.default.createElement(
|
|
14869
14945
|
PanelContent,
|
|
14870
14946
|
{
|
|
14871
|
-
onSelect:
|
|
14947
|
+
onSelect: ({ item }) => selectView(item),
|
|
14872
14948
|
openModal,
|
|
14873
14949
|
onDelete: () => openModal("delete" /* DELETE */),
|
|
14874
|
-
updateLocalStorage,
|
|
14875
|
-
setSelectedSavedView,
|
|
14876
14950
|
queryInput,
|
|
14877
14951
|
selectedSavedView: selectedView,
|
|
14878
14952
|
tableConfig: props.tableConfig,
|
|
@@ -14880,10 +14954,11 @@ var SavedViewsContent = (props) => {
|
|
|
14880
14954
|
stickyViewsKey: props.stickyViewsKey,
|
|
14881
14955
|
savedViews: allViews,
|
|
14882
14956
|
provider: props.provider,
|
|
14883
|
-
userId: props.userId
|
|
14957
|
+
userId: props.userId,
|
|
14958
|
+
onClearTemporary: clearTemporaryView
|
|
14884
14959
|
}
|
|
14885
14960
|
))
|
|
14886
|
-
), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */
|
|
14961
|
+
), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */ import_react14.default.createElement(
|
|
14887
14962
|
SavedViewsFormModal,
|
|
14888
14963
|
{
|
|
14889
14964
|
open: true,
|
|
@@ -14893,87 +14968,107 @@ var SavedViewsContent = (props) => {
|
|
|
14893
14968
|
tableConfig: props.tableConfig,
|
|
14894
14969
|
tableName: props.tableName,
|
|
14895
14970
|
selectedSavedView: selectedView,
|
|
14896
|
-
setSelectedSavedView,
|
|
14897
14971
|
onSelect: selectView,
|
|
14898
14972
|
setOpenEditCreateModal: closeModal,
|
|
14899
14973
|
defaultView: props.defaultView
|
|
14900
14974
|
}
|
|
14901
|
-
), selectedView && isModalOpen("delete" /* DELETE */) && /* @__PURE__ */
|
|
14975
|
+
), selectedView && isModalOpen("delete" /* DELETE */) && /* @__PURE__ */ import_react14.default.createElement(
|
|
14902
14976
|
SavedViewsDeleteConfirmationModalShared,
|
|
14903
14977
|
{
|
|
14904
14978
|
open: true,
|
|
14905
14979
|
onDelete: confirmDeleteAndCloseModal,
|
|
14906
14980
|
onCancel: closeModal
|
|
14907
14981
|
}
|
|
14908
|
-
), fetchedView && isModalOpen("
|
|
14909
|
-
|
|
14982
|
+
), fetchedView && isModalOpen("sharedView" /* SHARED_VIEW */) && /* @__PURE__ */ import_react14.default.createElement(
|
|
14983
|
+
SharedViewFormModal,
|
|
14910
14984
|
{
|
|
14911
14985
|
open: true,
|
|
14912
|
-
|
|
14986
|
+
fetchedView,
|
|
14913
14987
|
onClose: selectCurrentViewAndCloseModal,
|
|
14914
|
-
|
|
14915
|
-
onCreateView: createPersonalCopyOfSharedView
|
|
14988
|
+
onCreateTemporaryView: viewSharedViewTemporarily,
|
|
14989
|
+
onCreateView: createPersonalCopyOfSharedView,
|
|
14990
|
+
createError,
|
|
14991
|
+
isCreating,
|
|
14992
|
+
resetCreateError
|
|
14916
14993
|
}
|
|
14917
14994
|
));
|
|
14918
14995
|
};
|
|
14919
14996
|
var SavedViews = (props) => {
|
|
14920
|
-
return /* @__PURE__ */
|
|
14997
|
+
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 })));
|
|
14921
14998
|
};
|
|
14922
14999
|
|
|
14923
15000
|
// src/SavedViews/components/SavedViews/SmartGrid/SmartGridSavedViews.tsx
|
|
14924
15001
|
var import_toast_alert3 = require("@procore/toast-alert");
|
|
15002
|
+
var generateStickyViewsKey = (domain, tableName, userId, projectId, companyId) => {
|
|
15003
|
+
return `savedView-${domain}-${tableName}-${companyId}-${projectId}-${userId}`;
|
|
15004
|
+
};
|
|
14925
15005
|
var SmartGridSavedViews = (props) => {
|
|
14926
|
-
const { gridApi, projectId, companyId } = props;
|
|
15006
|
+
const { gridApi, userId, projectId, companyId } = props;
|
|
14927
15007
|
const { config: tableConfig, setConfig: setTableConfig } = useSmartGridConfig(gridApi);
|
|
14928
15008
|
const defaultView = useDefaultView({
|
|
14929
15009
|
defaultViewName: props.defaultViewName,
|
|
14930
15010
|
domain: props.domain
|
|
14931
15011
|
});
|
|
14932
|
-
const onSelect = (
|
|
14933
|
-
|
|
14934
|
-
|
|
14935
|
-
|
|
14936
|
-
|
|
14937
|
-
|
|
14938
|
-
|
|
14939
|
-
|
|
14940
|
-
|
|
14941
|
-
|
|
14942
|
-
|
|
14943
|
-
|
|
14944
|
-
|
|
14945
|
-
|
|
14946
|
-
|
|
14947
|
-
|
|
14948
|
-
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
14953
|
-
|
|
14954
|
-
|
|
15012
|
+
const onSelect = (0, import_react15.useCallback)(
|
|
15013
|
+
({ item }) => {
|
|
15014
|
+
if (!gridApi)
|
|
15015
|
+
return item;
|
|
15016
|
+
if (item.id === "default") {
|
|
15017
|
+
gridApi.autoSizeAllColumns();
|
|
15018
|
+
gridApi.resetColumnState();
|
|
15019
|
+
gridApi.setFilterModel(props.defaultViewFilters);
|
|
15020
|
+
gridApi.setGridOption("rowHeight", props.defaultRowHeight);
|
|
15021
|
+
gridApi.refreshCells();
|
|
15022
|
+
return item;
|
|
15023
|
+
}
|
|
15024
|
+
const updatedView = {
|
|
15025
|
+
...item,
|
|
15026
|
+
table_config: customAndConfigSync(
|
|
15027
|
+
item.table_config,
|
|
15028
|
+
tableConfig
|
|
15029
|
+
)
|
|
15030
|
+
};
|
|
15031
|
+
updateTableConfig(updatedView, gridApi, "smart-grid");
|
|
15032
|
+
setTableConfig(updatedView.table_config);
|
|
15033
|
+
return updatedView;
|
|
15034
|
+
},
|
|
15035
|
+
[
|
|
15036
|
+
gridApi,
|
|
15037
|
+
props.defaultViewFilters,
|
|
15038
|
+
props.defaultRowHeight,
|
|
15039
|
+
tableConfig,
|
|
15040
|
+
setTableConfig
|
|
15041
|
+
]
|
|
15042
|
+
);
|
|
15043
|
+
const stickyViewsKey = generateStickyViewsKey(
|
|
15044
|
+
props.domain,
|
|
15045
|
+
props.tableName,
|
|
15046
|
+
userId,
|
|
15047
|
+
projectId,
|
|
15048
|
+
companyId
|
|
15049
|
+
);
|
|
15050
|
+
return /* @__PURE__ */ import_react15.default.createElement(import_toast_alert3.ToastAlertProvider, null, /* @__PURE__ */ import_react15.default.createElement(
|
|
14955
15051
|
SavedViews,
|
|
14956
15052
|
{
|
|
14957
15053
|
onSelect,
|
|
14958
15054
|
domain: props.domain,
|
|
14959
|
-
userId
|
|
15055
|
+
userId,
|
|
14960
15056
|
projectId,
|
|
14961
15057
|
companyId,
|
|
14962
15058
|
provider: "smart-grid",
|
|
14963
15059
|
defaultView,
|
|
14964
15060
|
tableName: props.tableName,
|
|
14965
15061
|
tableConfig,
|
|
14966
|
-
stickyViewsKey
|
|
14967
|
-
enableSavedViews: props.enableSavedViews
|
|
15062
|
+
stickyViewsKey
|
|
14968
15063
|
}
|
|
14969
15064
|
));
|
|
14970
15065
|
};
|
|
14971
15066
|
|
|
14972
15067
|
// src/SavedViews/components/SavedViews/DataTable/DataTableSavedViews.tsx
|
|
14973
|
-
var
|
|
15068
|
+
var import_react17 = __toESM(require("react"));
|
|
14974
15069
|
|
|
14975
15070
|
// src/SavedViews/components/SavedViews/DataTable/DataTableDefaultSavedView.tsx
|
|
14976
|
-
var
|
|
15071
|
+
var import_react16 = require("react");
|
|
14977
15072
|
var import_core_react14 = require("@procore/core-react");
|
|
14978
15073
|
var DEFAULT_COLUMN_STATE = {
|
|
14979
15074
|
hidden: false,
|
|
@@ -15029,7 +15124,7 @@ var useDefaultViewName2 = (domain, defaultViewName) => {
|
|
|
15029
15124
|
};
|
|
15030
15125
|
var useDefaultView2 = (props) => {
|
|
15031
15126
|
const name = useDefaultViewName2(props.domain, props.defaultViewName);
|
|
15032
|
-
const extractedDefaultConfig = (0,
|
|
15127
|
+
const extractedDefaultConfig = (0, import_react16.useMemo)(
|
|
15033
15128
|
() => extractDefaultView(props.columnDefinitions, props.receivedConfigFromTool),
|
|
15034
15129
|
[props.columnDefinitions, props.receivedConfigFromTool]
|
|
15035
15130
|
);
|
|
@@ -15043,58 +15138,63 @@ var useDefaultView2 = (props) => {
|
|
|
15043
15138
|
|
|
15044
15139
|
// src/SavedViews/components/SavedViews/DataTable/DataTableSavedViews.tsx
|
|
15045
15140
|
var import_toast_alert4 = require("@procore/toast-alert");
|
|
15046
|
-
var
|
|
15047
|
-
|
|
15048
|
-
|
|
15141
|
+
var generateStickyViewsKey2 = (domain, tableName, userId, projectId, companyId) => {
|
|
15142
|
+
return `savedView-${domain}-${tableName}-${companyId}-${projectId}-${userId}`;
|
|
15143
|
+
};
|
|
15144
|
+
var DataTableSavedViews = (0, import_react17.forwardRef)((props, ref) => {
|
|
15145
|
+
const { tableApi, userId, projectId, companyId } = props;
|
|
15146
|
+
const [internalTableConfig, setInternalTableConfig] = (0, import_react17.useState)(
|
|
15049
15147
|
props.defaultViewConfig
|
|
15050
15148
|
);
|
|
15051
|
-
(0,
|
|
15149
|
+
(0, import_react17.useImperativeHandle)(ref, () => ({
|
|
15052
15150
|
setTableConfig: (newConfig) => {
|
|
15053
|
-
|
|
15151
|
+
setInternalTableConfig(newConfig);
|
|
15054
15152
|
}
|
|
15055
15153
|
}));
|
|
15056
|
-
const handleConfigChange = (0, import_react21.useCallback)(
|
|
15057
|
-
(newConfig) => {
|
|
15058
|
-
setInternalTableConfig(newConfig);
|
|
15059
|
-
onTableConfigChange(newConfig);
|
|
15060
|
-
},
|
|
15061
|
-
[onTableConfigChange]
|
|
15062
|
-
);
|
|
15063
15154
|
const defaultView = useDefaultView2({
|
|
15064
15155
|
defaultViewName: props.defaultViewName,
|
|
15065
15156
|
receivedConfigFromTool: props.defaultViewConfig,
|
|
15066
15157
|
domain: props.domain,
|
|
15067
15158
|
columnDefinitions: props.columnDefinitions
|
|
15068
15159
|
});
|
|
15069
|
-
const onSelect = (
|
|
15070
|
-
|
|
15071
|
-
|
|
15072
|
-
|
|
15073
|
-
|
|
15074
|
-
|
|
15075
|
-
|
|
15076
|
-
|
|
15077
|
-
|
|
15078
|
-
|
|
15079
|
-
|
|
15080
|
-
|
|
15160
|
+
const onSelect = (0, import_react17.useCallback)(
|
|
15161
|
+
({ item }) => {
|
|
15162
|
+
const isDefaultView = item.id === "default";
|
|
15163
|
+
const updatedView = isDefaultView ? defaultView : {
|
|
15164
|
+
...item,
|
|
15165
|
+
table_config: customAndConfigSync(
|
|
15166
|
+
item.table_config,
|
|
15167
|
+
defaultView.table_config
|
|
15168
|
+
)
|
|
15169
|
+
};
|
|
15170
|
+
updateTableConfig(updatedView, tableApi, "data-table");
|
|
15171
|
+
return updatedView;
|
|
15172
|
+
},
|
|
15173
|
+
[defaultView, tableApi]
|
|
15174
|
+
);
|
|
15081
15175
|
if (!internalTableConfig) {
|
|
15082
15176
|
return null;
|
|
15083
15177
|
}
|
|
15084
|
-
|
|
15178
|
+
const stickyViewsKey = generateStickyViewsKey2(
|
|
15179
|
+
props.domain,
|
|
15180
|
+
props.tableName,
|
|
15181
|
+
userId,
|
|
15182
|
+
projectId,
|
|
15183
|
+
companyId
|
|
15184
|
+
);
|
|
15185
|
+
return /* @__PURE__ */ import_react17.default.createElement(import_toast_alert4.ToastAlertProvider, null, /* @__PURE__ */ import_react17.default.createElement(
|
|
15085
15186
|
SavedViews,
|
|
15086
15187
|
{
|
|
15087
15188
|
onSelect,
|
|
15088
15189
|
domain: props.domain,
|
|
15089
|
-
userId
|
|
15190
|
+
userId,
|
|
15090
15191
|
projectId,
|
|
15091
15192
|
companyId,
|
|
15092
15193
|
provider: "data-table",
|
|
15093
15194
|
defaultView,
|
|
15094
15195
|
tableName: props.tableName,
|
|
15095
15196
|
tableConfig: internalTableConfig,
|
|
15096
|
-
stickyViewsKey
|
|
15097
|
-
enableSavedViews: props.enableSavedViews
|
|
15197
|
+
stickyViewsKey
|
|
15098
15198
|
}
|
|
15099
15199
|
));
|
|
15100
15200
|
});
|