@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.mjs
CHANGED
|
@@ -2017,9 +2017,9 @@ var require_dist = __commonJS({
|
|
|
2017
2017
|
}
|
|
2018
2018
|
});
|
|
2019
2019
|
|
|
2020
|
-
// node_modules/react-is/cjs/react-is.production.min.js
|
|
2020
|
+
// ../../node_modules/styled-components/node_modules/react-is/cjs/react-is.production.min.js
|
|
2021
2021
|
var require_react_is_production_min = __commonJS({
|
|
2022
|
-
"node_modules/react-is/cjs/react-is.production.min.js"(exports) {
|
|
2022
|
+
"../../node_modules/styled-components/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
|
|
2023
2023
|
"use strict";
|
|
2024
2024
|
var b2 = 60103;
|
|
2025
2025
|
var c2 = 60106;
|
|
@@ -2155,9 +2155,9 @@ var require_react_is_production_min = __commonJS({
|
|
|
2155
2155
|
}
|
|
2156
2156
|
});
|
|
2157
2157
|
|
|
2158
|
-
// node_modules/react-is/cjs/react-is.development.js
|
|
2158
|
+
// ../../node_modules/styled-components/node_modules/react-is/cjs/react-is.development.js
|
|
2159
2159
|
var require_react_is_development = __commonJS({
|
|
2160
|
-
"node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
2160
|
+
"../../node_modules/styled-components/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
2161
2161
|
"use strict";
|
|
2162
2162
|
if (process.env.NODE_ENV !== "production") {
|
|
2163
2163
|
(function() {
|
|
@@ -2347,9 +2347,9 @@ var require_react_is_development = __commonJS({
|
|
|
2347
2347
|
}
|
|
2348
2348
|
});
|
|
2349
2349
|
|
|
2350
|
-
// node_modules/react-is/index.js
|
|
2350
|
+
// ../../node_modules/styled-components/node_modules/react-is/index.js
|
|
2351
2351
|
var require_react_is = __commonJS({
|
|
2352
|
-
"node_modules/react-is/index.js"(exports, module) {
|
|
2352
|
+
"../../node_modules/styled-components/node_modules/react-is/index.js"(exports, module) {
|
|
2353
2353
|
"use strict";
|
|
2354
2354
|
if (process.env.NODE_ENV === "production") {
|
|
2355
2355
|
module.exports = require_react_is_production_min();
|
|
@@ -8802,7 +8802,8 @@ var en_default = {
|
|
|
8802
8802
|
viewTemporarily: "View Temporarily",
|
|
8803
8803
|
createView: "Create View",
|
|
8804
8804
|
copyShareLink: "Copy Share Link",
|
|
8805
|
-
linkCopied: "Share link copied to clipboard"
|
|
8805
|
+
linkCopied: "Share link copied to clipboard",
|
|
8806
|
+
clearTemporary: "Remove"
|
|
8806
8807
|
},
|
|
8807
8808
|
modal: {
|
|
8808
8809
|
edit: {
|
|
@@ -8816,8 +8817,7 @@ var en_default = {
|
|
|
8816
8817
|
description: "This view cannot be restored once it has been deleted."
|
|
8817
8818
|
},
|
|
8818
8819
|
copyConfirmation: {
|
|
8819
|
-
|
|
8820
|
-
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."
|
|
8820
|
+
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."
|
|
8821
8821
|
},
|
|
8822
8822
|
fields: {
|
|
8823
8823
|
name: "Name",
|
|
@@ -8865,6 +8865,7 @@ var en_default = {
|
|
|
8865
8865
|
rfi: "All RFIs",
|
|
8866
8866
|
submittal_log: "All Submittals"
|
|
8867
8867
|
},
|
|
8868
|
+
temporaryViewName: "Temporary View",
|
|
8868
8869
|
viewLevel: {
|
|
8869
8870
|
company: "Company Views",
|
|
8870
8871
|
project: "Project Views",
|
|
@@ -9710,7 +9711,7 @@ function __rest(s2, e2) {
|
|
|
9710
9711
|
return t2;
|
|
9711
9712
|
}
|
|
9712
9713
|
|
|
9713
|
-
//
|
|
9714
|
+
// node_modules/@procore/core-icons/dist/Icon.js
|
|
9714
9715
|
import * as React from "react";
|
|
9715
9716
|
function getSize(size) {
|
|
9716
9717
|
if (size === "sm") {
|
|
@@ -9729,7 +9730,7 @@ function Icon(_a) {
|
|
|
9729
9730
|
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;
|
|
9730
9731
|
}
|
|
9731
9732
|
|
|
9732
|
-
//
|
|
9733
|
+
// node_modules/@procore/core-icons/dist/icons/Building.js
|
|
9733
9734
|
import * as React2 from "react";
|
|
9734
9735
|
var Building = React2.forwardRef(function Building2(props, ref) {
|
|
9735
9736
|
return React2.createElement(
|
|
@@ -9745,7 +9746,7 @@ var Building = React2.forwardRef(function Building2(props, ref) {
|
|
|
9745
9746
|
Building.displayName = "Building";
|
|
9746
9747
|
var Building_default = Building;
|
|
9747
9748
|
|
|
9748
|
-
//
|
|
9749
|
+
// node_modules/@procore/core-icons/dist/icons/ChevronDown.js
|
|
9749
9750
|
import * as React3 from "react";
|
|
9750
9751
|
var ChevronDown = React3.forwardRef(function ChevronDown2(props, ref) {
|
|
9751
9752
|
return React3.createElement(
|
|
@@ -9761,7 +9762,7 @@ var ChevronDown = React3.forwardRef(function ChevronDown2(props, ref) {
|
|
|
9761
9762
|
ChevronDown.displayName = "ChevronDown";
|
|
9762
9763
|
var ChevronDown_default = ChevronDown;
|
|
9763
9764
|
|
|
9764
|
-
//
|
|
9765
|
+
// node_modules/@procore/core-icons/dist/icons/ChevronRight.js
|
|
9765
9766
|
import * as React4 from "react";
|
|
9766
9767
|
var ChevronRight = React4.forwardRef(function ChevronRight2(props, ref) {
|
|
9767
9768
|
return React4.createElement(
|
|
@@ -9777,100 +9778,116 @@ var ChevronRight = React4.forwardRef(function ChevronRight2(props, ref) {
|
|
|
9777
9778
|
ChevronRight.displayName = "ChevronRight";
|
|
9778
9779
|
var ChevronRight_default = ChevronRight;
|
|
9779
9780
|
|
|
9780
|
-
//
|
|
9781
|
+
// node_modules/@procore/core-icons/dist/icons/Clear.js
|
|
9781
9782
|
import * as React5 from "react";
|
|
9782
|
-
var
|
|
9783
|
+
var Clear = React5.forwardRef(function Clear2(props, ref) {
|
|
9783
9784
|
return React5.createElement(
|
|
9784
9785
|
Icon,
|
|
9785
|
-
__assign({}, props, { name: "
|
|
9786
|
+
__assign({}, props, { name: "Clear" }),
|
|
9786
9787
|
React5.createElement(
|
|
9787
9788
|
"svg",
|
|
9788
9789
|
{ width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
|
|
9789
|
-
React5.createElement("path", {
|
|
9790
|
-
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" })
|
|
9790
|
+
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" })
|
|
9791
9791
|
)
|
|
9792
9792
|
);
|
|
9793
9793
|
});
|
|
9794
|
-
|
|
9795
|
-
var
|
|
9794
|
+
Clear.displayName = "Clear";
|
|
9795
|
+
var Clear_default = Clear;
|
|
9796
9796
|
|
|
9797
|
-
//
|
|
9797
|
+
// node_modules/@procore/core-icons/dist/icons/Excavator.js
|
|
9798
9798
|
import * as React6 from "react";
|
|
9799
|
-
var
|
|
9799
|
+
var Excavator = React6.forwardRef(function Excavator2(props, ref) {
|
|
9800
9800
|
return React6.createElement(
|
|
9801
9801
|
Icon,
|
|
9802
|
-
__assign({}, props, { name: "
|
|
9802
|
+
__assign({}, props, { name: "Excavator" }),
|
|
9803
9803
|
React6.createElement(
|
|
9804
9804
|
"svg",
|
|
9805
9805
|
{ width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
|
|
9806
|
-
React6.createElement("path", { d: "
|
|
9807
|
-
React6.createElement("path", { d: "
|
|
9808
|
-
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" })
|
|
9806
|
+
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" }),
|
|
9807
|
+
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" })
|
|
9809
9808
|
)
|
|
9810
9809
|
);
|
|
9811
9810
|
});
|
|
9812
|
-
|
|
9813
|
-
var
|
|
9811
|
+
Excavator.displayName = "Excavator";
|
|
9812
|
+
var Excavator_default = Excavator;
|
|
9814
9813
|
|
|
9815
|
-
//
|
|
9814
|
+
// node_modules/@procore/core-icons/dist/icons/ExpandSidebar.js
|
|
9816
9815
|
import * as React7 from "react";
|
|
9817
|
-
var
|
|
9816
|
+
var ExpandSidebar = React7.forwardRef(function ExpandSidebar2(props, ref) {
|
|
9818
9817
|
return React7.createElement(
|
|
9819
9818
|
Icon,
|
|
9820
|
-
__assign({}, props, { name: "
|
|
9819
|
+
__assign({}, props, { name: "ExpandSidebar" }),
|
|
9821
9820
|
React7.createElement(
|
|
9822
9821
|
"svg",
|
|
9823
9822
|
{ width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
|
|
9824
|
-
React7.createElement("path", {
|
|
9823
|
+
React7.createElement("path", { d: "M3 6.5H11V9H3V6.5Z", fill: "currentColor" }),
|
|
9824
|
+
React7.createElement("path", { d: "M3 15H11V17.5H3V15Z", fill: "currentColor" }),
|
|
9825
|
+
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" })
|
|
9825
9826
|
)
|
|
9826
9827
|
);
|
|
9827
9828
|
});
|
|
9828
|
-
|
|
9829
|
-
var
|
|
9829
|
+
ExpandSidebar.displayName = "ExpandSidebar";
|
|
9830
|
+
var ExpandSidebar_default = ExpandSidebar;
|
|
9830
9831
|
|
|
9831
|
-
//
|
|
9832
|
+
// node_modules/@procore/core-icons/dist/icons/Help.js
|
|
9832
9833
|
import * as React8 from "react";
|
|
9833
|
-
var
|
|
9834
|
+
var Help = React8.forwardRef(function Help2(props, ref) {
|
|
9834
9835
|
return React8.createElement(
|
|
9835
9836
|
Icon,
|
|
9836
|
-
__assign({}, props, { name: "
|
|
9837
|
+
__assign({}, props, { name: "Help" }),
|
|
9837
9838
|
React8.createElement(
|
|
9838
9839
|
"svg",
|
|
9839
9840
|
{ width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
|
|
9840
|
-
React8.createElement("path", { d: "
|
|
9841
|
-
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" })
|
|
9841
|
+
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" })
|
|
9842
9842
|
)
|
|
9843
9843
|
);
|
|
9844
9844
|
});
|
|
9845
|
-
|
|
9846
|
-
var
|
|
9845
|
+
Help.displayName = "Help";
|
|
9846
|
+
var Help_default = Help;
|
|
9847
9847
|
|
|
9848
|
-
//
|
|
9848
|
+
// node_modules/@procore/core-icons/dist/icons/Link.js
|
|
9849
9849
|
import * as React9 from "react";
|
|
9850
|
-
var
|
|
9850
|
+
var Link = React9.forwardRef(function Link2(props, ref) {
|
|
9851
9851
|
return React9.createElement(
|
|
9852
9852
|
Icon,
|
|
9853
|
-
__assign({}, props, { name: "
|
|
9853
|
+
__assign({}, props, { name: "Link" }),
|
|
9854
9854
|
React9.createElement(
|
|
9855
9855
|
"svg",
|
|
9856
9856
|
{ width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
|
|
9857
|
-
React9.createElement("path", { d: "
|
|
9857
|
+
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" }),
|
|
9858
|
+
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" })
|
|
9858
9859
|
)
|
|
9859
9860
|
);
|
|
9860
9861
|
});
|
|
9861
|
-
|
|
9862
|
-
var
|
|
9862
|
+
Link.displayName = "Link";
|
|
9863
|
+
var Link_default = Link;
|
|
9863
9864
|
|
|
9864
|
-
//
|
|
9865
|
+
// node_modules/@procore/core-icons/dist/icons/Person.js
|
|
9865
9866
|
import * as React10 from "react";
|
|
9866
|
-
var
|
|
9867
|
+
var Person = React10.forwardRef(function Person2(props, ref) {
|
|
9867
9868
|
return React10.createElement(
|
|
9868
9869
|
Icon,
|
|
9869
|
-
__assign({}, props, { name: "
|
|
9870
|
+
__assign({}, props, { name: "Person" }),
|
|
9870
9871
|
React10.createElement(
|
|
9871
9872
|
"svg",
|
|
9872
9873
|
{ width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
|
|
9873
|
-
React10.createElement("path", { d: "
|
|
9874
|
+
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" })
|
|
9875
|
+
)
|
|
9876
|
+
);
|
|
9877
|
+
});
|
|
9878
|
+
Person.displayName = "Person";
|
|
9879
|
+
var Person_default = Person;
|
|
9880
|
+
|
|
9881
|
+
// node_modules/@procore/core-icons/dist/icons/Plus.js
|
|
9882
|
+
import * as React11 from "react";
|
|
9883
|
+
var Plus = React11.forwardRef(function Plus2(props, ref) {
|
|
9884
|
+
return React11.createElement(
|
|
9885
|
+
Icon,
|
|
9886
|
+
__assign({}, props, { name: "Plus" }),
|
|
9887
|
+
React11.createElement(
|
|
9888
|
+
"svg",
|
|
9889
|
+
{ width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
|
|
9890
|
+
React11.createElement("path", { d: "M13.25 5H10.75V10.75H5V13.25H10.75V19H13.25V13.25H19V10.75H13.25V5Z", fill: "currentColor" })
|
|
9874
9891
|
)
|
|
9875
9892
|
);
|
|
9876
9893
|
});
|
|
@@ -9879,9 +9896,9 @@ var Plus_default = Plus;
|
|
|
9879
9896
|
|
|
9880
9897
|
// src/SavedViews/components/Buttons/SavedViewsButton.tsx
|
|
9881
9898
|
import { Button } from "@procore/core-react";
|
|
9882
|
-
import
|
|
9899
|
+
import React13 from "react";
|
|
9883
9900
|
|
|
9884
|
-
// node_modules/styled-components/dist/styled-components.esm.js
|
|
9901
|
+
// ../../node_modules/styled-components/dist/styled-components.esm.js
|
|
9885
9902
|
var import_react_is = __toESM(require_react_is());
|
|
9886
9903
|
var import_shallowequal = __toESM(require_shallowequal());
|
|
9887
9904
|
import r, { useState as o, useContext as s, useMemo as i, useEffect as a, useRef as c, createElement as u } from "react";
|
|
@@ -10436,7 +10453,7 @@ function memoize(fn) {
|
|
|
10436
10453
|
};
|
|
10437
10454
|
}
|
|
10438
10455
|
|
|
10439
|
-
// ../../node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
|
|
10456
|
+
// ../../node_modules/styled-components/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
|
|
10440
10457
|
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)-.*))$/;
|
|
10441
10458
|
var isPropValid = /* @__PURE__ */ memoize(
|
|
10442
10459
|
function(prop) {
|
|
@@ -10445,7 +10462,7 @@ var isPropValid = /* @__PURE__ */ memoize(
|
|
|
10445
10462
|
/* Z+1 */
|
|
10446
10463
|
);
|
|
10447
10464
|
|
|
10448
|
-
// node_modules/styled-components/dist/styled-components.esm.js
|
|
10465
|
+
// ../../node_modules/styled-components/dist/styled-components.esm.js
|
|
10449
10466
|
var import_hoist_non_react_statics = __toESM(require_hoist_non_react_statics_cjs());
|
|
10450
10467
|
function m() {
|
|
10451
10468
|
return (m = Object.assign || function(e2) {
|
|
@@ -11093,7 +11110,7 @@ var Ue = function() {
|
|
|
11093
11110
|
var styled_components_esm_default = Ye;
|
|
11094
11111
|
|
|
11095
11112
|
// src/SavedViews/components/EnvironmentI18nProvider.tsx
|
|
11096
|
-
import
|
|
11113
|
+
import React12 from "react";
|
|
11097
11114
|
import { I18nContext, useI18n, useI18nContext } from "@procore/core-react";
|
|
11098
11115
|
import { useRequestTranslations } from "@procore/cdn-translations";
|
|
11099
11116
|
var useCDNTranslations = () => {
|
|
@@ -11119,7 +11136,7 @@ var useCDNTranslations = () => {
|
|
|
11119
11136
|
};
|
|
11120
11137
|
var EnvironmentI18nProvider = ({ children }) => {
|
|
11121
11138
|
const i18n = useCDNTranslations();
|
|
11122
|
-
return /* @__PURE__ */
|
|
11139
|
+
return /* @__PURE__ */ React12.createElement(I18nContext.Provider, { value: i18n }, children);
|
|
11123
11140
|
};
|
|
11124
11141
|
|
|
11125
11142
|
// src/SavedViews/components/Buttons/SavedViewsButton.tsx
|
|
@@ -11146,12 +11163,12 @@ var SavedViewsButton = ({
|
|
|
11146
11163
|
isOpen
|
|
11147
11164
|
}) => {
|
|
11148
11165
|
const I18n = useCDNTranslations();
|
|
11149
|
-
return /* @__PURE__ */
|
|
11166
|
+
return /* @__PURE__ */ React13.createElement(Container, null, /* @__PURE__ */ React13.createElement(
|
|
11150
11167
|
StyledButton,
|
|
11151
11168
|
{
|
|
11152
11169
|
variant: "secondary",
|
|
11153
11170
|
onClick: handleClick,
|
|
11154
|
-
icon: /* @__PURE__ */
|
|
11171
|
+
icon: /* @__PURE__ */ React13.createElement(StyledIcon, { left: isOpen }),
|
|
11155
11172
|
"data-testid": "saved-views-button"
|
|
11156
11173
|
},
|
|
11157
11174
|
I18n.t("savedViews.button.title")
|
|
@@ -11159,7 +11176,7 @@ var SavedViewsButton = ({
|
|
|
11159
11176
|
};
|
|
11160
11177
|
|
|
11161
11178
|
// src/SavedViews/components/Buttons/useSavedViewsPanel.tsx
|
|
11162
|
-
import
|
|
11179
|
+
import React14 from "react";
|
|
11163
11180
|
var useSavedViewsPanel = (domain, tableName) => {
|
|
11164
11181
|
const key = (domain2, tableName2) => `savedViewsPanel-${domain2}-${tableName2}`;
|
|
11165
11182
|
const [isOpen, setIsOpen] = useState(
|
|
@@ -11169,7 +11186,7 @@ var useSavedViewsPanel = (domain, tableName) => {
|
|
|
11169
11186
|
setIsOpen(!isOpen);
|
|
11170
11187
|
localStorage.setItem(key(domain, tableName), JSON.stringify(!isOpen));
|
|
11171
11188
|
};
|
|
11172
|
-
const Button7 = () => /* @__PURE__ */
|
|
11189
|
+
const Button7 = () => /* @__PURE__ */ React14.createElement(SavedViewsButton, { handleClick, isOpen });
|
|
11173
11190
|
return { isOpen, SavedViewsButton: Button7 };
|
|
11174
11191
|
};
|
|
11175
11192
|
var useSavedViewsPanel_default = useSavedViewsPanel;
|
|
@@ -11182,7 +11199,7 @@ import {
|
|
|
11182
11199
|
Flex,
|
|
11183
11200
|
useI18nContext as useI18nContext2
|
|
11184
11201
|
} from "@procore/core-react";
|
|
11185
|
-
import * as
|
|
11202
|
+
import * as React15 from "react";
|
|
11186
11203
|
import { useToastAlertContext } from "@procore/toast-alert";
|
|
11187
11204
|
var RowActionsBox = styled_components_esm_default(Flex)`
|
|
11188
11205
|
justify-content: center;
|
|
@@ -11199,7 +11216,7 @@ var Container2 = styled_components_esm_default(Flex)`
|
|
|
11199
11216
|
${({ "aria-selected": selected }) => selected ? "color: hsl(218, 75%, 45%);" : ""}
|
|
11200
11217
|
`;
|
|
11201
11218
|
var SavedViewCollectionMenuItem = (props) => {
|
|
11202
|
-
const onClick =
|
|
11219
|
+
const onClick = React15.useCallback(
|
|
11203
11220
|
(a2) => {
|
|
11204
11221
|
var _a, _b;
|
|
11205
11222
|
if (!props.item) {
|
|
@@ -11228,11 +11245,12 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11228
11245
|
const copyShareLink = async (event) => {
|
|
11229
11246
|
event.stopPropagation();
|
|
11230
11247
|
try {
|
|
11231
|
-
const
|
|
11232
|
-
|
|
11248
|
+
const { origin, pathname } = window.location;
|
|
11249
|
+
const shareUrl = new URL(`${origin}${pathname}`);
|
|
11250
|
+
shareUrl.searchParams.set("saved-view", props.item.share_token);
|
|
11251
|
+
await navigator.clipboard.writeText(shareUrl.toString());
|
|
11233
11252
|
showToast.success(i18n.t("savedViews.actions.linkCopied"));
|
|
11234
11253
|
} catch (error) {
|
|
11235
|
-
console.error("Failed to copy link:", error);
|
|
11236
11254
|
showToast.error(i18n.t("savedViews.errors.copyFailed"));
|
|
11237
11255
|
}
|
|
11238
11256
|
};
|
|
@@ -11246,7 +11264,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11246
11264
|
label: i18n.t("savedViews.actions.delete")
|
|
11247
11265
|
}
|
|
11248
11266
|
];
|
|
11249
|
-
return /* @__PURE__ */
|
|
11267
|
+
return /* @__PURE__ */ React15.createElement(
|
|
11250
11268
|
Container2,
|
|
11251
11269
|
{
|
|
11252
11270
|
"aria-selected": Boolean(props.selected),
|
|
@@ -11257,7 +11275,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11257
11275
|
}),
|
|
11258
11276
|
"data-testid": "saved-view-collection-menu-item"
|
|
11259
11277
|
},
|
|
11260
|
-
/* @__PURE__ */
|
|
11278
|
+
/* @__PURE__ */ React15.createElement(
|
|
11261
11279
|
"span",
|
|
11262
11280
|
{
|
|
11263
11281
|
"data-testid": "saved-view-display-name",
|
|
@@ -11265,7 +11283,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11265
11283
|
},
|
|
11266
11284
|
props.item.name
|
|
11267
11285
|
),
|
|
11268
|
-
/* @__PURE__ */
|
|
11286
|
+
/* @__PURE__ */ React15.createElement(RowActionsBox, null, /* @__PURE__ */ React15.createElement(Box, { justifyContent: "space-between" }, props.item.id !== "default" && props.canUpdate && /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(
|
|
11269
11287
|
Button2,
|
|
11270
11288
|
{
|
|
11271
11289
|
onClick: updateItem,
|
|
@@ -11276,7 +11294,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11276
11294
|
loading: props.isUpdateProcessing
|
|
11277
11295
|
},
|
|
11278
11296
|
i18n.t("savedViews.actions.update")
|
|
11279
|
-
)), props.item.id !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary" && /* @__PURE__ */
|
|
11297
|
+
)), props.item.id !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary" && /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(
|
|
11280
11298
|
Button2,
|
|
11281
11299
|
{
|
|
11282
11300
|
onClick: copyShareLink,
|
|
@@ -11285,8 +11303,23 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
11285
11303
|
"aria-label": i18n.t("savedViews.actions.copyShareLink"),
|
|
11286
11304
|
"data-testid": "copy-share-link-button"
|
|
11287
11305
|
},
|
|
11288
|
-
/* @__PURE__ */
|
|
11289
|
-
))
|
|
11306
|
+
/* @__PURE__ */ React15.createElement(Link_default, { size: "sm" })
|
|
11307
|
+
)), props.item.id === "temporary" && /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(
|
|
11308
|
+
Button2,
|
|
11309
|
+
{
|
|
11310
|
+
onClick: (e2) => {
|
|
11311
|
+
var _a;
|
|
11312
|
+
e2.stopPropagation();
|
|
11313
|
+
(_a = props.onClearTemporary) == null ? void 0 : _a.call(props);
|
|
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(Box, null, props.item.id !== "default" && props.canEditOrDelete && /* @__PURE__ */ React15.createElement("div", { onClick: (e2) => e2.stopPropagation() }, /* @__PURE__ */ React15.createElement(
|
|
11290
11323
|
DropdownFlyout,
|
|
11291
11324
|
{
|
|
11292
11325
|
"data-testid": "saved-view-overflow-button",
|
|
@@ -11319,9 +11352,9 @@ import {
|
|
|
11319
11352
|
useI18nContext as useI18nContext5
|
|
11320
11353
|
} from "@procore/core-react";
|
|
11321
11354
|
import { useToastAlertContext as useToastAlertContext2 } from "@procore/toast-alert";
|
|
11322
|
-
import
|
|
11355
|
+
import React17 from "react";
|
|
11323
11356
|
|
|
11324
|
-
//
|
|
11357
|
+
// node_modules/@procore/core-http/dist/modern/index.js
|
|
11325
11358
|
function getCSRFToken() {
|
|
11326
11359
|
const token = document.cookie.match("(^|;)\\s*csrf_token\\s*=\\s*([^;]+)");
|
|
11327
11360
|
return token ? decodeURIComponent(token.pop() || "") : "";
|
|
@@ -11378,7 +11411,7 @@ var useApiRequest = (props, method, mutationKey) => {
|
|
|
11378
11411
|
mutationFn: async (savedView) => {
|
|
11379
11412
|
let url = "";
|
|
11380
11413
|
if (method === "DELETE" || method === "PUT") {
|
|
11381
|
-
url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedView.
|
|
11414
|
+
url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedView.share_token}?permissions_domain=${domain}`;
|
|
11382
11415
|
} else {
|
|
11383
11416
|
url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views?table_name=${tableName}&permissions_domain=${domain}`;
|
|
11384
11417
|
}
|
|
@@ -11407,7 +11440,9 @@ var useApiRequest = (props, method, mutationKey) => {
|
|
|
11407
11440
|
domain,
|
|
11408
11441
|
tableName
|
|
11409
11442
|
]);
|
|
11410
|
-
const oldView = oldData == null ? void 0 : oldData.find(
|
|
11443
|
+
const oldView = oldData == null ? void 0 : oldData.find(
|
|
11444
|
+
(item) => item.share_token === savedView.share_token
|
|
11445
|
+
);
|
|
11411
11446
|
if ((oldView == null ? void 0 : oldView.name) !== savedView.name) {
|
|
11412
11447
|
queryClient2.invalidateQueries({
|
|
11413
11448
|
queryKey: ["savedViews", domain, tableName]
|
|
@@ -11421,7 +11456,7 @@ var useApiRequest = (props, method, mutationKey) => {
|
|
|
11421
11456
|
if (!oldData)
|
|
11422
11457
|
return [savedView];
|
|
11423
11458
|
return oldData.map(
|
|
11424
|
-
(item) => item.
|
|
11459
|
+
(item) => item.share_token === savedView.share_token ? savedView : item
|
|
11425
11460
|
);
|
|
11426
11461
|
}
|
|
11427
11462
|
);
|
|
@@ -11438,7 +11473,6 @@ var useSavedViewsQuery = (props) => {
|
|
|
11438
11473
|
const { projectId, companyId, domain, tableName } = props;
|
|
11439
11474
|
const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views?table_name=${tableName}&permissions_domain=${domain}`;
|
|
11440
11475
|
return useQuery({
|
|
11441
|
-
enabled: props.enableSavedViews,
|
|
11442
11476
|
queryKey: ["savedViews", domain, tableName],
|
|
11443
11477
|
queryFn: async () => {
|
|
11444
11478
|
const getUrl2 = `${url}&per_page=${PAGE_SIZE}`;
|
|
@@ -11451,7 +11485,6 @@ var useSavedViewsPermissions = (props) => {
|
|
|
11451
11485
|
const { projectId, companyId, domain } = props;
|
|
11452
11486
|
const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/permissions?permissions_domain=${domain}`;
|
|
11453
11487
|
return useQuery({
|
|
11454
|
-
enabled: props.enableSavedViews,
|
|
11455
11488
|
queryKey: ["savedViewsConfig", domain],
|
|
11456
11489
|
queryFn: async () => {
|
|
11457
11490
|
const response = await requestJSON(url);
|
|
@@ -11474,13 +11507,13 @@ var useDeleteSavedView = (props) => useApiRequest(props, "DELETE", [
|
|
|
11474
11507
|
props.domain,
|
|
11475
11508
|
props.tableName
|
|
11476
11509
|
]);
|
|
11477
|
-
var useFetchSavedViewById = (
|
|
11510
|
+
var useFetchSavedViewById = (savedViewToken, queryInput, enabled = true) => {
|
|
11478
11511
|
const { projectId, companyId } = queryInput;
|
|
11479
11512
|
return useQuery({
|
|
11480
|
-
enabled: enabled && Boolean(
|
|
11481
|
-
queryKey: ["savedView",
|
|
11513
|
+
enabled: enabled && Boolean(savedViewToken),
|
|
11514
|
+
queryKey: ["savedView", savedViewToken],
|
|
11482
11515
|
queryFn: async () => {
|
|
11483
|
-
const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${
|
|
11516
|
+
const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedViewToken}`;
|
|
11484
11517
|
const response = await requestJSON(url);
|
|
11485
11518
|
return response.data;
|
|
11486
11519
|
}
|
|
@@ -11559,7 +11592,7 @@ var getColumnIdentifier = (col) => {
|
|
|
11559
11592
|
}
|
|
11560
11593
|
return "";
|
|
11561
11594
|
};
|
|
11562
|
-
var updateTableConfig = (view, tableApi, provider
|
|
11595
|
+
var updateTableConfig = (view, tableApi, provider) => {
|
|
11563
11596
|
if (provider === "smart-grid") {
|
|
11564
11597
|
setSmartGridConfig(
|
|
11565
11598
|
tableApi,
|
|
@@ -11574,9 +11607,6 @@ var updateTableConfig = (view, tableApi, provider, onTableConfigChange) => {
|
|
|
11574
11607
|
dataTableApi == null ? void 0 : dataTableApi.setRowHeight(rowHeight);
|
|
11575
11608
|
}
|
|
11576
11609
|
dataTableApi == null ? void 0 : dataTableApi.setTableConfiguration(tableConfig);
|
|
11577
|
-
if (onTableConfigChange) {
|
|
11578
|
-
onTableConfigChange(tableConfig);
|
|
11579
|
-
}
|
|
11580
11610
|
}
|
|
11581
11611
|
}
|
|
11582
11612
|
};
|
|
@@ -11696,15 +11726,15 @@ import {
|
|
|
11696
11726
|
Typography,
|
|
11697
11727
|
useI18nContext as useI18nContext4
|
|
11698
11728
|
} from "@procore/core-react";
|
|
11699
|
-
import
|
|
11729
|
+
import React16 from "react";
|
|
11700
11730
|
var groupIcon = (group) => {
|
|
11701
11731
|
switch (group) {
|
|
11702
11732
|
case "personal":
|
|
11703
|
-
return /* @__PURE__ */
|
|
11733
|
+
return /* @__PURE__ */ React16.createElement(Person_default, null);
|
|
11704
11734
|
case "project":
|
|
11705
|
-
return /* @__PURE__ */
|
|
11735
|
+
return /* @__PURE__ */ React16.createElement(Excavator_default, null);
|
|
11706
11736
|
case "company":
|
|
11707
|
-
return /* @__PURE__ */
|
|
11737
|
+
return /* @__PURE__ */ React16.createElement(Building_default, null);
|
|
11708
11738
|
}
|
|
11709
11739
|
};
|
|
11710
11740
|
var Header = styled_components_esm_default(Flex2)`
|
|
@@ -11715,7 +11745,7 @@ var Header = styled_components_esm_default(Flex2)`
|
|
|
11715
11745
|
`;
|
|
11716
11746
|
var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
|
|
11717
11747
|
const I18n = useI18nContext4();
|
|
11718
|
-
return /* @__PURE__ */
|
|
11748
|
+
return /* @__PURE__ */ React16.createElement(
|
|
11719
11749
|
Header,
|
|
11720
11750
|
{
|
|
11721
11751
|
alignItems: "center",
|
|
@@ -11724,9 +11754,9 @@ var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
|
|
|
11724
11754
|
style: { cursor: "pointer" },
|
|
11725
11755
|
onClick: () => toggleGroup(group)
|
|
11726
11756
|
},
|
|
11727
|
-
expanded ? /* @__PURE__ */
|
|
11757
|
+
expanded ? /* @__PURE__ */ React16.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ React16.createElement(ChevronRight_default, { size: "sm" }),
|
|
11728
11758
|
groupIcon(group),
|
|
11729
|
-
/* @__PURE__ */
|
|
11759
|
+
/* @__PURE__ */ React16.createElement(Typography, { weight: "semibold" }, I18n.t(`savedViews.viewLevel.${group}`))
|
|
11730
11760
|
);
|
|
11731
11761
|
};
|
|
11732
11762
|
var ViewLevelHeader_default = ViewLevelHeader;
|
|
@@ -11761,21 +11791,20 @@ var Panel2 = styled_components_esm_default(DetailPage.Card)`
|
|
|
11761
11791
|
box-shadow: none;
|
|
11762
11792
|
`;
|
|
11763
11793
|
var PanelContent = (props) => {
|
|
11764
|
-
var _a, _b;
|
|
11794
|
+
var _a, _b, _c;
|
|
11765
11795
|
const { showToast } = useToastAlertContext2();
|
|
11766
11796
|
const I18n = useI18nContext5();
|
|
11767
11797
|
const { mutate: updateSavedView, isPending: isUpdateLoading } = useUpdateSavedView(props.queryInput);
|
|
11768
|
-
const {
|
|
11769
|
-
const
|
|
11770
|
-
|
|
11771
|
-
React16.useEffect(() => {
|
|
11798
|
+
const { error: savedViewsError } = useSavedViewsQuery(props.queryInput);
|
|
11799
|
+
const errorToastRef = React17.useRef(null);
|
|
11800
|
+
React17.useEffect(() => {
|
|
11772
11801
|
if (savedViewsError && savedViewsError !== errorToastRef.current) {
|
|
11773
11802
|
showToast.error(I18n.t("savedViews.errors.fetch"));
|
|
11774
11803
|
errorToastRef.current = savedViewsError;
|
|
11775
11804
|
}
|
|
11776
11805
|
}, [savedViewsError, showToast, I18n]);
|
|
11777
11806
|
const { data: permissions } = useSavedViewsPermissions(props.queryInput);
|
|
11778
|
-
const selectedRowRef = useScrollToRef(savedViews);
|
|
11807
|
+
const selectedRowRef = useScrollToRef(props.savedViews);
|
|
11779
11808
|
const onUpdate = (data) => {
|
|
11780
11809
|
const newSavedView = {
|
|
11781
11810
|
...data,
|
|
@@ -11785,8 +11814,7 @@ var PanelContent = (props) => {
|
|
|
11785
11814
|
updateSavedView(newSavedView, {
|
|
11786
11815
|
onSuccess: () => {
|
|
11787
11816
|
showToast.success(I18n.t("savedViews.update.success"));
|
|
11788
|
-
props.
|
|
11789
|
-
props.setSelectedSavedView(newSavedView);
|
|
11817
|
+
props.onSelect({ item: newSavedView });
|
|
11790
11818
|
},
|
|
11791
11819
|
onError: () => {
|
|
11792
11820
|
showToast.error(I18n.t("savedViews.errors.update"));
|
|
@@ -11796,29 +11824,32 @@ var PanelContent = (props) => {
|
|
|
11796
11824
|
const { groups, toggleGroup } = useGroups();
|
|
11797
11825
|
const isDefaultSelected = ((_a = props.selectedSavedView) == null ? void 0 : _a.id) === "default";
|
|
11798
11826
|
const isTemporarySelected = ((_b = props.selectedSavedView) == null ? void 0 : _b.id) === "temporary";
|
|
11799
|
-
const temporaryView = savedViews == null ? void 0 :
|
|
11800
|
-
|
|
11827
|
+
const temporaryView = (_c = props.savedViews) == null ? void 0 : _c.find(
|
|
11828
|
+
(view) => view.id === "temporary"
|
|
11829
|
+
);
|
|
11830
|
+
return /* @__PURE__ */ React17.createElement(Panel2, { "data-testid": "inner-panel" }, /* @__PURE__ */ React17.createElement(Flex3, { direction: "column", style: { height: "100%", width: "100%" } }, temporaryView && /* @__PURE__ */ React17.createElement(
|
|
11801
11831
|
Row,
|
|
11802
11832
|
{
|
|
11803
11833
|
selected: isTemporarySelected,
|
|
11804
11834
|
onClick: () => props.onSelect({ item: temporaryView }),
|
|
11805
11835
|
ref: isTemporarySelected ? selectedRowRef : null
|
|
11806
11836
|
},
|
|
11807
|
-
/* @__PURE__ */
|
|
11837
|
+
/* @__PURE__ */ React17.createElement(
|
|
11808
11838
|
SavedViewCollectionMenuItem,
|
|
11809
11839
|
{
|
|
11810
11840
|
item: temporaryView,
|
|
11811
|
-
selected: isTemporarySelected
|
|
11841
|
+
selected: isTemporarySelected,
|
|
11842
|
+
onClearTemporary: props.onClearTemporary
|
|
11812
11843
|
}
|
|
11813
11844
|
)
|
|
11814
|
-
), /* @__PURE__ */
|
|
11845
|
+
), /* @__PURE__ */ React17.createElement(
|
|
11815
11846
|
Row,
|
|
11816
11847
|
{
|
|
11817
11848
|
selected: isDefaultSelected,
|
|
11818
11849
|
onClick: () => props.onSelect({ item: props.defaultView }),
|
|
11819
11850
|
ref: isDefaultSelected ? selectedRowRef : null
|
|
11820
11851
|
},
|
|
11821
|
-
/* @__PURE__ */
|
|
11852
|
+
/* @__PURE__ */ React17.createElement(
|
|
11822
11853
|
SavedViewCollectionMenuItem,
|
|
11823
11854
|
{
|
|
11824
11855
|
item: props.defaultView,
|
|
@@ -11827,10 +11858,10 @@ var PanelContent = (props) => {
|
|
|
11827
11858
|
)
|
|
11828
11859
|
), VIEW_LEVELS.map((level) => {
|
|
11829
11860
|
const isExpanded = groups[level];
|
|
11830
|
-
const views = isExpanded && savedViews ? savedViews.filter(
|
|
11861
|
+
const views = isExpanded && props.savedViews ? props.savedViews.filter(
|
|
11831
11862
|
(view) => view.view_level === level && view.id !== "temporary"
|
|
11832
11863
|
) : [];
|
|
11833
|
-
return /* @__PURE__ */
|
|
11864
|
+
return /* @__PURE__ */ React17.createElement(React17.Fragment, { key: level }, /* @__PURE__ */ React17.createElement(
|
|
11834
11865
|
ViewLevelHeader_default,
|
|
11835
11866
|
{
|
|
11836
11867
|
group: level,
|
|
@@ -11847,7 +11878,7 @@ var PanelContent = (props) => {
|
|
|
11847
11878
|
props.provider
|
|
11848
11879
|
);
|
|
11849
11880
|
const canEditOrDelete = isSelected && hasPermissionForViewLevel(view.view_level, permissions);
|
|
11850
|
-
return /* @__PURE__ */
|
|
11881
|
+
return /* @__PURE__ */ React17.createElement(
|
|
11851
11882
|
Row,
|
|
11852
11883
|
{
|
|
11853
11884
|
key: view.id,
|
|
@@ -11858,7 +11889,7 @@ var PanelContent = (props) => {
|
|
|
11858
11889
|
},
|
|
11859
11890
|
ref: isSelected ? selectedRowRef : null
|
|
11860
11891
|
},
|
|
11861
|
-
/* @__PURE__ */
|
|
11892
|
+
/* @__PURE__ */ React17.createElement(
|
|
11862
11893
|
SavedViewCollectionMenuItem,
|
|
11863
11894
|
{
|
|
11864
11895
|
item: view,
|
|
@@ -11879,7 +11910,7 @@ var PanelContent = (props) => {
|
|
|
11879
11910
|
};
|
|
11880
11911
|
|
|
11881
11912
|
// src/SavedViews/components/SavedViews/SmartGrid/SmartGridSavedViews.tsx
|
|
11882
|
-
import React23 from "react";
|
|
11913
|
+
import React23, { useCallback as useCallback4 } from "react";
|
|
11883
11914
|
|
|
11884
11915
|
// src/SavedViews/components/SavedViews/SmartGrid/SmartGridDefaultSavedView.tsx
|
|
11885
11916
|
import { useI18nContext as useI18nContext6 } from "@procore/core-react";
|
|
@@ -11942,12 +11973,12 @@ var useSmartGridConfig = (gridApi) => {
|
|
|
11942
11973
|
import {
|
|
11943
11974
|
Box as Box2,
|
|
11944
11975
|
Button as Button6,
|
|
11945
|
-
Flex as
|
|
11976
|
+
Flex as Flex6,
|
|
11946
11977
|
Panel as Panel3,
|
|
11947
11978
|
Tooltip,
|
|
11948
11979
|
useI18nContext as useI18nContext11
|
|
11949
11980
|
} from "@procore/core-react";
|
|
11950
|
-
import React22 from "react";
|
|
11981
|
+
import React22, { useState as useState5, useEffect as useEffect4, useCallback as useCallback3 } from "react";
|
|
11951
11982
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
11952
11983
|
|
|
11953
11984
|
// src/SavedViews/components/SavedViewsModals/SavedViewsDeleteConfirmationModalShared.tsx
|
|
@@ -11958,14 +11989,14 @@ import {
|
|
|
11958
11989
|
P as P2,
|
|
11959
11990
|
useI18nContext as useI18nContext7
|
|
11960
11991
|
} from "@procore/core-react";
|
|
11961
|
-
import
|
|
11992
|
+
import React18 from "react";
|
|
11962
11993
|
var SavedViewsDeleteConfirmationModalShared = ({
|
|
11963
11994
|
onCancel,
|
|
11964
11995
|
onDelete,
|
|
11965
11996
|
open
|
|
11966
11997
|
}) => {
|
|
11967
11998
|
const i18n = useI18nContext7();
|
|
11968
|
-
return /* @__PURE__ */
|
|
11999
|
+
return /* @__PURE__ */ React18.createElement(
|
|
11969
12000
|
ConfirmModal,
|
|
11970
12001
|
{
|
|
11971
12002
|
"data-testid": "delete-confirmation-modal",
|
|
@@ -11975,13 +12006,13 @@ var SavedViewsDeleteConfirmationModalShared = ({
|
|
|
11975
12006
|
onClose: onCancel,
|
|
11976
12007
|
style: { overflowWrap: "anywhere" }
|
|
11977
12008
|
},
|
|
11978
|
-
/* @__PURE__ */
|
|
11979
|
-
/* @__PURE__ */
|
|
12009
|
+
/* @__PURE__ */ React18.createElement(Modal.Body, null, /* @__PURE__ */ React18.createElement(P2, null, i18n.t("savedViews.modal.delete.description"))),
|
|
12010
|
+
/* @__PURE__ */ React18.createElement(Modal.Footer, null, /* @__PURE__ */ React18.createElement(Modal.FooterButtons, null, /* @__PURE__ */ React18.createElement(Button3, { variant: "secondary", onClick: onCancel }, i18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React18.createElement(Button3, { variant: "primary", onClick: onDelete }, i18n.t("savedViews.actions.delete"))))
|
|
11980
12011
|
);
|
|
11981
12012
|
};
|
|
11982
12013
|
|
|
11983
12014
|
// src/SavedViews/components/SavedViewsModals/SavedViewsFormModal.tsx
|
|
11984
|
-
import
|
|
12015
|
+
import React20 from "react";
|
|
11985
12016
|
|
|
11986
12017
|
// src/SavedViews/components/SavedViewsModals/SavedViewsCreateUpdateModalBase.tsx
|
|
11987
12018
|
import {
|
|
@@ -11997,7 +12028,7 @@ import {
|
|
|
11997
12028
|
Typography as Typography2,
|
|
11998
12029
|
useI18nContext as useI18nContext8
|
|
11999
12030
|
} from "@procore/core-react";
|
|
12000
|
-
import * as
|
|
12031
|
+
import * as React19 from "react";
|
|
12001
12032
|
|
|
12002
12033
|
// ../../node_modules/yup/index.esm.js
|
|
12003
12034
|
var import_property_expr = __toESM(require_property_expr());
|
|
@@ -14340,7 +14371,6 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14340
14371
|
tableName,
|
|
14341
14372
|
defaultView,
|
|
14342
14373
|
selectedSavedView,
|
|
14343
|
-
setSelectedSavedView,
|
|
14344
14374
|
setOpenEditCreateModal,
|
|
14345
14375
|
onSelect
|
|
14346
14376
|
}) => {
|
|
@@ -14378,8 +14408,8 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14378
14408
|
};
|
|
14379
14409
|
updateSavedView(body, {
|
|
14380
14410
|
onSuccess: (updatedSavedView) => {
|
|
14411
|
+
onSelect(updatedSavedView);
|
|
14381
14412
|
setOpenEditCreateModal(false);
|
|
14382
|
-
setSelectedSavedView(updatedSavedView);
|
|
14383
14413
|
}
|
|
14384
14414
|
});
|
|
14385
14415
|
} else {
|
|
@@ -14398,7 +14428,7 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14398
14428
|
}
|
|
14399
14429
|
};
|
|
14400
14430
|
const viewLevelOptions = getViewLevelOptions(permissions, I18n);
|
|
14401
|
-
return /* @__PURE__ */
|
|
14431
|
+
return /* @__PURE__ */ React19.createElement(
|
|
14402
14432
|
Modal2,
|
|
14403
14433
|
{
|
|
14404
14434
|
"aria-label": I18n.t("savedViews.ariaLabels.modal"),
|
|
@@ -14407,14 +14437,14 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14407
14437
|
style: { width: "540px" },
|
|
14408
14438
|
"data-testid": "create-update-modal"
|
|
14409
14439
|
},
|
|
14410
|
-
/* @__PURE__ */
|
|
14440
|
+
/* @__PURE__ */ React19.createElement(ScrollContainer, null, /* @__PURE__ */ React19.createElement(
|
|
14411
14441
|
Modal2.Header,
|
|
14412
14442
|
{
|
|
14413
14443
|
onClose,
|
|
14414
14444
|
style: { borderBottom: `1px solid ${colors3.gray85}` }
|
|
14415
14445
|
},
|
|
14416
|
-
/* @__PURE__ */
|
|
14417
|
-
), /* @__PURE__ */
|
|
14446
|
+
/* @__PURE__ */ React19.createElement(H2, null, header)
|
|
14447
|
+
), /* @__PURE__ */ React19.createElement(
|
|
14418
14448
|
Form,
|
|
14419
14449
|
{
|
|
14420
14450
|
initialValues: {
|
|
@@ -14440,13 +14470,13 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14440
14470
|
onReset: onCancel,
|
|
14441
14471
|
validateOnChange: true
|
|
14442
14472
|
},
|
|
14443
|
-
/* @__PURE__ */
|
|
14473
|
+
/* @__PURE__ */ React19.createElement(Form.Form, { name: header }, /* @__PURE__ */ React19.createElement(
|
|
14444
14474
|
Modal2.Body,
|
|
14445
14475
|
{
|
|
14446
14476
|
style: { paddingTop: 0, paddingBottom: 0, marginTop: spacing3.lg }
|
|
14447
14477
|
},
|
|
14448
|
-
errors && /* @__PURE__ */
|
|
14449
|
-
/* @__PURE__ */
|
|
14478
|
+
errors && /* @__PURE__ */ React19.createElement(ErrorBanner, { style: { marginBottom: spacing3.xl } }, /* @__PURE__ */ React19.createElement(Banner.Content, null, /* @__PURE__ */ React19.createElement(Banner.Title, null, I18n.t("savedViews.modal.errors.title", { mode })), /* @__PURE__ */ React19.createElement(Banner.Body, null, (errors == null ? void 0 : errors.form) || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
|
|
14479
|
+
/* @__PURE__ */ React19.createElement(Form.Row, null, /* @__PURE__ */ React19.createElement(
|
|
14450
14480
|
Form.Text,
|
|
14451
14481
|
{
|
|
14452
14482
|
name: "name",
|
|
@@ -14457,12 +14487,12 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14457
14487
|
onChange: () => resetMutations()
|
|
14458
14488
|
}
|
|
14459
14489
|
)),
|
|
14460
|
-
/* @__PURE__ */
|
|
14490
|
+
/* @__PURE__ */ React19.createElement(
|
|
14461
14491
|
Form.Row,
|
|
14462
14492
|
{
|
|
14463
14493
|
style: { marginTop: (errors == null ? void 0 : errors.name) ? spacing3.xl : spacing3.none }
|
|
14464
14494
|
},
|
|
14465
|
-
/* @__PURE__ */
|
|
14495
|
+
/* @__PURE__ */ React19.createElement(
|
|
14466
14496
|
Form.TextArea,
|
|
14467
14497
|
{
|
|
14468
14498
|
name: "description",
|
|
@@ -14473,7 +14503,7 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14473
14503
|
}
|
|
14474
14504
|
)
|
|
14475
14505
|
),
|
|
14476
|
-
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */
|
|
14506
|
+
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React19.createElement(Form.Row, null, /* @__PURE__ */ React19.createElement(
|
|
14477
14507
|
Form.Select,
|
|
14478
14508
|
{
|
|
14479
14509
|
name: "view_level",
|
|
@@ -14483,8 +14513,8 @@ var SavedViewsCreateUpdateModalBase = ({
|
|
|
14483
14513
|
onSearch: false,
|
|
14484
14514
|
onClear: false
|
|
14485
14515
|
}
|
|
14486
|
-
)) : /* @__PURE__ */
|
|
14487
|
-
), /* @__PURE__ */
|
|
14516
|
+
)) : /* @__PURE__ */ React19.createElement(React19.Fragment, null)
|
|
14517
|
+
), /* @__PURE__ */ React19.createElement(Modal2.Footer, { style: { borderTop: `1px solid ${colors3.gray85}` } }, /* @__PURE__ */ React19.createElement(Flex4, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React19.createElement(Typography2, { color: "gray45", italic: true }, /* @__PURE__ */ React19.createElement(Typography2, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React19.createElement(Modal2.FooterButtons, null, /* @__PURE__ */ React19.createElement(Button4, { type: "reset", variant: "tertiary", disabled: isLoading }, I18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React19.createElement(
|
|
14488
14518
|
Button4,
|
|
14489
14519
|
{
|
|
14490
14520
|
"data-testid": "create-update-modal-button",
|
|
@@ -14509,13 +14539,12 @@ var SavedViewsFormModal = ({
|
|
|
14509
14539
|
tableName,
|
|
14510
14540
|
queryInput,
|
|
14511
14541
|
selectedSavedView,
|
|
14512
|
-
setSelectedSavedView,
|
|
14513
14542
|
setOpenEditCreateModal,
|
|
14514
14543
|
onSelect,
|
|
14515
14544
|
defaultView
|
|
14516
14545
|
}) => {
|
|
14517
14546
|
const i18n = useI18nContext9();
|
|
14518
|
-
return /* @__PURE__ */
|
|
14547
|
+
return /* @__PURE__ */ React20.createElement(
|
|
14519
14548
|
SavedViewsCreateUpdateModalBase,
|
|
14520
14549
|
{
|
|
14521
14550
|
open,
|
|
@@ -14528,7 +14557,6 @@ var SavedViewsFormModal = ({
|
|
|
14528
14557
|
tableConfig,
|
|
14529
14558
|
tableName,
|
|
14530
14559
|
selectedSavedView,
|
|
14531
|
-
setSelectedSavedView,
|
|
14532
14560
|
setOpenEditCreateModal,
|
|
14533
14561
|
onSelect,
|
|
14534
14562
|
defaultView
|
|
@@ -14536,269 +14564,301 @@ var SavedViewsFormModal = ({
|
|
|
14536
14564
|
);
|
|
14537
14565
|
};
|
|
14538
14566
|
|
|
14539
|
-
// src/SavedViews/components/SavedViewsModals/
|
|
14540
|
-
import {
|
|
14541
|
-
|
|
14542
|
-
|
|
14543
|
-
|
|
14544
|
-
|
|
14545
|
-
|
|
14567
|
+
// src/SavedViews/components/SavedViewsModals/SharedViewFormModal.tsx
|
|
14568
|
+
import {
|
|
14569
|
+
Banner as Banner2,
|
|
14570
|
+
Button as Button5,
|
|
14571
|
+
colors as colors4,
|
|
14572
|
+
ErrorBanner as ErrorBanner2,
|
|
14573
|
+
Flex as Flex5,
|
|
14574
|
+
Form as Form2,
|
|
14575
|
+
Modal as Modal3,
|
|
14576
|
+
P as P3,
|
|
14577
|
+
spacing as spacing4,
|
|
14578
|
+
Typography as Typography3,
|
|
14579
|
+
useI18nContext as useI18nContext10
|
|
14580
|
+
} from "@procore/core-react";
|
|
14581
|
+
import * as React21 from "react";
|
|
14582
|
+
var SharedViewFormModal = ({
|
|
14583
|
+
open,
|
|
14584
|
+
fetchedView,
|
|
14585
|
+
onClose,
|
|
14586
|
+
onCreateTemporaryView,
|
|
14587
|
+
onCreateView,
|
|
14588
|
+
createError,
|
|
14589
|
+
isCreating,
|
|
14590
|
+
resetCreateError
|
|
14591
|
+
}) => {
|
|
14592
|
+
const I18n = useI18nContext10();
|
|
14593
|
+
const NAME_MAX_LENGTH = 150;
|
|
14594
|
+
const errors = extractMessage(createError, I18n);
|
|
14595
|
+
const handleNameChange = () => {
|
|
14596
|
+
if (resetCreateError) {
|
|
14597
|
+
resetCreateError();
|
|
14598
|
+
}
|
|
14546
14599
|
};
|
|
14547
|
-
const
|
|
14548
|
-
onCreateView
|
|
14600
|
+
const handleOnSubmit = (data) => {
|
|
14601
|
+
onCreateView(data.name, data.description);
|
|
14549
14602
|
};
|
|
14550
|
-
return /* @__PURE__ */
|
|
14603
|
+
return /* @__PURE__ */ React21.createElement(
|
|
14551
14604
|
Modal3,
|
|
14552
14605
|
{
|
|
14553
|
-
"data-testid": "
|
|
14606
|
+
"data-testid": "shared-view-form-modal",
|
|
14554
14607
|
open,
|
|
14555
|
-
onClickOverlay: onClose
|
|
14556
|
-
|
|
14557
|
-
|
|
14558
|
-
|
|
14559
|
-
|
|
14560
|
-
/* @__PURE__ */ React20.createElement(Modal3.Body, null, /* @__PURE__ */ React20.createElement(P3, null, i18n.t("savedViews.modal.copyConfirmation.description"))),
|
|
14561
|
-
/* @__PURE__ */ React20.createElement(Modal3.Footer, null, /* @__PURE__ */ React20.createElement(Modal3.FooterButtons, null, /* @__PURE__ */ React20.createElement(
|
|
14562
|
-
Button5,
|
|
14608
|
+
onClickOverlay: onClose,
|
|
14609
|
+
style: { width: "540px" }
|
|
14610
|
+
},
|
|
14611
|
+
/* @__PURE__ */ React21.createElement(
|
|
14612
|
+
Modal3.Header,
|
|
14563
14613
|
{
|
|
14564
|
-
|
|
14565
|
-
|
|
14566
|
-
|
|
14614
|
+
onClose,
|
|
14615
|
+
style: {
|
|
14616
|
+
paddingTop: spacing4.lg,
|
|
14617
|
+
paddingBottom: spacing4.xs,
|
|
14618
|
+
paddingLeft: spacing4.xl,
|
|
14619
|
+
paddingRight: spacing4.xl
|
|
14620
|
+
}
|
|
14621
|
+
},
|
|
14622
|
+
I18n.t("savedViews.modal.create.title")
|
|
14623
|
+
),
|
|
14624
|
+
/* @__PURE__ */ React21.createElement(
|
|
14625
|
+
P3,
|
|
14626
|
+
{
|
|
14627
|
+
style: {
|
|
14628
|
+
paddingLeft: spacing4.xl,
|
|
14629
|
+
paddingRight: spacing4.xl,
|
|
14630
|
+
paddingBottom: spacing4.lg,
|
|
14631
|
+
paddingTop: spacing4.none,
|
|
14632
|
+
margin: 0,
|
|
14633
|
+
color: colors4.gray45,
|
|
14634
|
+
whiteSpace: "pre-line"
|
|
14635
|
+
}
|
|
14567
14636
|
},
|
|
14568
|
-
|
|
14569
|
-
),
|
|
14570
|
-
|
|
14637
|
+
I18n.t("savedViews.modal.copyConfirmation.description")
|
|
14638
|
+
),
|
|
14639
|
+
/* @__PURE__ */ React21.createElement(
|
|
14640
|
+
Form2,
|
|
14571
14641
|
{
|
|
14572
|
-
|
|
14573
|
-
|
|
14574
|
-
|
|
14642
|
+
initialValues: {
|
|
14643
|
+
name: fetchedView.name,
|
|
14644
|
+
description: fetchedView.description ?? ""
|
|
14645
|
+
},
|
|
14646
|
+
view: "create",
|
|
14647
|
+
validationSchema: create$3().shape({
|
|
14648
|
+
name: create$6().trim().max(
|
|
14649
|
+
NAME_MAX_LENGTH,
|
|
14650
|
+
I18n.t("savedViews.modal.errors.maxLengthName", {
|
|
14651
|
+
maxLength: NAME_MAX_LENGTH
|
|
14652
|
+
})
|
|
14653
|
+
).required(I18n.t("savedViews.modal.errors.required"))
|
|
14654
|
+
}),
|
|
14655
|
+
onSubmit: handleOnSubmit,
|
|
14656
|
+
validateOnChange: true
|
|
14575
14657
|
},
|
|
14576
|
-
|
|
14577
|
-
|
|
14658
|
+
/* @__PURE__ */ React21.createElement(Form2.Form, { name: "share-view-form" }, /* @__PURE__ */ React21.createElement(
|
|
14659
|
+
Modal3.Body,
|
|
14660
|
+
{
|
|
14661
|
+
style: {
|
|
14662
|
+
paddingTop: spacing4.lg,
|
|
14663
|
+
paddingBottom: 0,
|
|
14664
|
+
borderTop: `1px solid ${colors4.gray85}`
|
|
14665
|
+
}
|
|
14666
|
+
},
|
|
14667
|
+
errors && /* @__PURE__ */ React21.createElement(ErrorBanner2, { style: { marginBottom: spacing4.xl } }, /* @__PURE__ */ React21.createElement(Banner2.Content, null, /* @__PURE__ */ React21.createElement(Banner2.Title, null, I18n.t("savedViews.modal.errors.title", {
|
|
14668
|
+
mode: "create"
|
|
14669
|
+
})), /* @__PURE__ */ React21.createElement(Banner2.Body, null, (errors == null ? void 0 : errors.form) || I18n.t("savedViews.modal.errors.description.create")))),
|
|
14670
|
+
/* @__PURE__ */ React21.createElement(Form2.Row, null, /* @__PURE__ */ React21.createElement(
|
|
14671
|
+
Form2.Text,
|
|
14672
|
+
{
|
|
14673
|
+
name: "name",
|
|
14674
|
+
error: errors == null ? void 0 : errors.name,
|
|
14675
|
+
placeholder: I18n.t("savedViews.modal.fields.name"),
|
|
14676
|
+
label: I18n.t("savedViews.modal.fields.name"),
|
|
14677
|
+
colWidth: 12,
|
|
14678
|
+
onChange: handleNameChange
|
|
14679
|
+
}
|
|
14680
|
+
)),
|
|
14681
|
+
/* @__PURE__ */ React21.createElement(
|
|
14682
|
+
Form2.Row,
|
|
14683
|
+
{
|
|
14684
|
+
style: { marginTop: (errors == null ? void 0 : errors.name) ? spacing4.xl : spacing4.none }
|
|
14685
|
+
},
|
|
14686
|
+
/* @__PURE__ */ React21.createElement(
|
|
14687
|
+
Form2.TextArea,
|
|
14688
|
+
{
|
|
14689
|
+
name: "description",
|
|
14690
|
+
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
14691
|
+
label: I18n.t("savedViews.modal.fields.description"),
|
|
14692
|
+
colWidth: 12,
|
|
14693
|
+
resize: "vertical"
|
|
14694
|
+
}
|
|
14695
|
+
)
|
|
14696
|
+
)
|
|
14697
|
+
), /* @__PURE__ */ React21.createElement(Modal3.Footer, { style: { borderTop: `1px solid ${colors4.gray85}` } }, /* @__PURE__ */ React21.createElement(Flex5, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React21.createElement(Typography3, { color: "gray45", italic: true }, /* @__PURE__ */ React21.createElement(Typography3, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React21.createElement(Modal3.FooterButtons, null, /* @__PURE__ */ React21.createElement(
|
|
14698
|
+
Button5,
|
|
14699
|
+
{
|
|
14700
|
+
variant: "secondary",
|
|
14701
|
+
onClick: onCreateTemporaryView,
|
|
14702
|
+
"data-testid": "view-temporarily-button",
|
|
14703
|
+
disabled: isCreating
|
|
14704
|
+
},
|
|
14705
|
+
I18n.t("savedViews.actions.viewTemporarily")
|
|
14706
|
+
), /* @__PURE__ */ React21.createElement(
|
|
14707
|
+
Button5,
|
|
14708
|
+
{
|
|
14709
|
+
type: "submit",
|
|
14710
|
+
variant: "primary",
|
|
14711
|
+
"data-testid": "create-view-button",
|
|
14712
|
+
disabled: isCreating,
|
|
14713
|
+
loading: isCreating
|
|
14714
|
+
},
|
|
14715
|
+
I18n.t("savedViews.actions.create")
|
|
14716
|
+
)))))
|
|
14717
|
+
)
|
|
14578
14718
|
);
|
|
14579
14719
|
};
|
|
14580
14720
|
|
|
14581
14721
|
// src/utils/Hooks/useViewSelection.ts
|
|
14582
|
-
import { useState as useState4, useCallback as useCallback2 } from "react";
|
|
14583
|
-
|
|
14584
|
-
// src/utils/Hooks/useUrlSync.ts
|
|
14585
|
-
import { useEffect as useEffect3 } from "react";
|
|
14722
|
+
import { useState as useState4, useCallback as useCallback2, useEffect as useEffect3 } from "react";
|
|
14586
14723
|
import { useSearchParams } from "react-router-dom";
|
|
14587
|
-
|
|
14588
|
-
|
|
14589
|
-
|
|
14590
|
-
|
|
14591
|
-
|
|
14592
|
-
|
|
14593
|
-
|
|
14594
|
-
|
|
14595
|
-
|
|
14596
|
-
|
|
14597
|
-
|
|
14598
|
-
|
|
14599
|
-
onViewFound(viewInUserViews);
|
|
14600
|
-
}
|
|
14601
|
-
} else {
|
|
14602
|
-
onViewNotFound(savedViewId);
|
|
14603
|
-
}
|
|
14604
|
-
};
|
|
14605
|
-
const applyListView = (viewParam) => {
|
|
14606
|
-
if (viewParam === "list" && defaultView.id !== (selectedView == null ? void 0 : selectedView.id)) {
|
|
14607
|
-
onViewFound(defaultView);
|
|
14608
|
-
}
|
|
14609
|
-
};
|
|
14610
|
-
useEffect3(() => {
|
|
14611
|
-
if (!availableViews.length)
|
|
14612
|
-
return;
|
|
14613
|
-
const savedViewId = searchParams.get("saved-view");
|
|
14614
|
-
const viewParamFromConsumer = searchParams.get("view");
|
|
14615
|
-
if (savedViewId) {
|
|
14616
|
-
applySavedViewFromUrl(savedViewId);
|
|
14617
|
-
return;
|
|
14618
|
-
}
|
|
14619
|
-
if (viewParamFromConsumer) {
|
|
14620
|
-
applyListView(viewParamFromConsumer);
|
|
14724
|
+
|
|
14725
|
+
// src/utils/viewStorage.ts
|
|
14726
|
+
var ViewStorage = {
|
|
14727
|
+
save(key, view) {
|
|
14728
|
+
localStorage.setItem(key, JSON.stringify(view));
|
|
14729
|
+
},
|
|
14730
|
+
load(key) {
|
|
14731
|
+
try {
|
|
14732
|
+
const stored = localStorage.getItem(key);
|
|
14733
|
+
return stored ? JSON.parse(stored) : null;
|
|
14734
|
+
} catch (e2) {
|
|
14735
|
+
return null;
|
|
14621
14736
|
}
|
|
14622
|
-
},
|
|
14623
|
-
|
|
14624
|
-
|
|
14625
|
-
|
|
14626
|
-
selectedView,
|
|
14627
|
-
onViewFound,
|
|
14628
|
-
onViewNotFound
|
|
14629
|
-
]);
|
|
14630
|
-
const updateUrl = (view) => {
|
|
14631
|
-
setSearchParams(
|
|
14632
|
-
(currentParams) => {
|
|
14633
|
-
const updatedParams = new URLSearchParams(currentParams);
|
|
14634
|
-
if (view.id === "default") {
|
|
14635
|
-
updatedParams.delete("saved-view");
|
|
14636
|
-
} else {
|
|
14637
|
-
updatedParams.set("saved-view", view.id);
|
|
14638
|
-
}
|
|
14639
|
-
return updatedParams;
|
|
14640
|
-
},
|
|
14641
|
-
{ replace: true }
|
|
14642
|
-
);
|
|
14643
|
-
};
|
|
14644
|
-
return { updateUrl };
|
|
14737
|
+
},
|
|
14738
|
+
remove(key) {
|
|
14739
|
+
localStorage.removeItem(key);
|
|
14740
|
+
}
|
|
14645
14741
|
};
|
|
14646
14742
|
|
|
14647
14743
|
// src/utils/Hooks/useViewSelection.ts
|
|
14648
|
-
var
|
|
14744
|
+
var getUpdatedSearchParams = (currentParams, view) => {
|
|
14745
|
+
const updatedParams = new URLSearchParams(currentParams);
|
|
14746
|
+
if (view.id === "default") {
|
|
14747
|
+
updatedParams.delete("saved-view");
|
|
14748
|
+
} else if (view.id === "temporary") {
|
|
14749
|
+
updatedParams.set("saved-view", "temporary");
|
|
14750
|
+
} else {
|
|
14751
|
+
updatedParams.set("saved-view", view.share_token);
|
|
14752
|
+
}
|
|
14753
|
+
return updatedParams;
|
|
14754
|
+
};
|
|
14755
|
+
var checkIsViewSelected = (selectedView, viewId) => {
|
|
14756
|
+
return (selectedView == null ? void 0 : selectedView.share_token) === viewId || (selectedView == null ? void 0 : selectedView.id) === viewId;
|
|
14757
|
+
};
|
|
14758
|
+
var useViewSelection = (config, savedViews, openSharedViewModal) => {
|
|
14759
|
+
const storageKey = `${config.domain}_${config.tableName}_${config.stickyViewsKey}_${config.projectId}_${config.userId}`;
|
|
14760
|
+
const temporaryStorageKey = `${storageKey}_temporary`;
|
|
14761
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
14649
14762
|
const [selectedSavedView, setSelectedSavedView] = useState4(() => {
|
|
14650
|
-
|
|
14651
|
-
|
|
14652
|
-
|
|
14653
|
-
|
|
14654
|
-
|
|
14655
|
-
);
|
|
14656
|
-
return savedView || config.defaultView;
|
|
14657
|
-
} catch (e2) {
|
|
14658
|
-
return config.defaultView;
|
|
14659
|
-
}
|
|
14763
|
+
const stored = ViewStorage.load(storageKey);
|
|
14764
|
+
return stored ?? config.defaultView;
|
|
14765
|
+
});
|
|
14766
|
+
const [temporaryView, setTemporaryView] = useState4(() => {
|
|
14767
|
+
return ViewStorage.load(temporaryStorageKey);
|
|
14660
14768
|
});
|
|
14661
|
-
const [temporaryView, setTemporaryView] = useState4(null);
|
|
14662
|
-
const createTemporaryView = useCallback2((fetchedView) => {
|
|
14663
|
-
const tempView = {
|
|
14664
|
-
...fetchedView,
|
|
14665
|
-
id: "temporary",
|
|
14666
|
-
name: "Temporary View"
|
|
14667
|
-
};
|
|
14668
|
-
setTemporaryView(tempView);
|
|
14669
|
-
return tempView;
|
|
14670
|
-
}, []);
|
|
14671
|
-
const clearTemporaryView = useCallback2(() => setTemporaryView(null), []);
|
|
14672
14769
|
const updateLocalStorage = useCallback2(
|
|
14673
14770
|
(view) => {
|
|
14674
14771
|
if (config.stickyViewsKey) {
|
|
14675
|
-
|
|
14676
|
-
`${config.domain}_${config.tableName}_${config.stickyViewsKey}_${config.projectId}_${config.userId}`,
|
|
14677
|
-
JSON.stringify(view)
|
|
14678
|
-
);
|
|
14772
|
+
ViewStorage.save(storageKey, view);
|
|
14679
14773
|
}
|
|
14680
14774
|
},
|
|
14681
|
-
[
|
|
14682
|
-
config.domain,
|
|
14683
|
-
config.tableName,
|
|
14684
|
-
config.stickyViewsKey,
|
|
14685
|
-
config.projectId,
|
|
14686
|
-
config.userId
|
|
14687
|
-
]
|
|
14775
|
+
[config.stickyViewsKey, storageKey]
|
|
14688
14776
|
);
|
|
14689
|
-
const
|
|
14690
|
-
|
|
14691
|
-
|
|
14692
|
-
|
|
14693
|
-
|
|
14694
|
-
|
|
14695
|
-
|
|
14696
|
-
|
|
14697
|
-
openCrossUserModal(viewId);
|
|
14698
|
-
};
|
|
14699
|
-
const { updateUrl } = useUrlSync(
|
|
14700
|
-
selectedSavedView,
|
|
14701
|
-
allViews,
|
|
14702
|
-
config.defaultView,
|
|
14703
|
-
onUrlViewFound,
|
|
14704
|
-
onUrlViewNotFound
|
|
14777
|
+
const updateUrlForView = useCallback2(
|
|
14778
|
+
(view) => {
|
|
14779
|
+
setSearchParams(
|
|
14780
|
+
(currentParams) => getUpdatedSearchParams(currentParams, view),
|
|
14781
|
+
{ replace: true }
|
|
14782
|
+
);
|
|
14783
|
+
},
|
|
14784
|
+
[setSearchParams]
|
|
14705
14785
|
);
|
|
14786
|
+
const baseViews = savedViews ?? [];
|
|
14787
|
+
const allViews = temporaryView ? [...baseViews, temporaryView] : baseViews;
|
|
14706
14788
|
const selectView = useCallback2(
|
|
14707
14789
|
(view) => {
|
|
14708
|
-
if (view.id !== "temporary" && temporaryView) {
|
|
14709
|
-
clearTemporaryView();
|
|
14710
|
-
}
|
|
14711
14790
|
const viewToSelect = config.onSelect({ item: view });
|
|
14712
14791
|
setSelectedSavedView(viewToSelect);
|
|
14713
14792
|
updateLocalStorage(viewToSelect);
|
|
14714
|
-
|
|
14793
|
+
updateUrlForView(viewToSelect);
|
|
14715
14794
|
return viewToSelect;
|
|
14716
14795
|
},
|
|
14717
|
-
[config,
|
|
14796
|
+
[config, updateLocalStorage, updateUrlForView]
|
|
14718
14797
|
);
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
|
|
14722
|
-
|
|
14723
|
-
|
|
14724
|
-
|
|
14725
|
-
};
|
|
14726
|
-
};
|
|
14727
|
-
|
|
14728
|
-
// src/utils/Hooks/useCrossUserSharing.ts
|
|
14729
|
-
import React21 from "react";
|
|
14730
|
-
var useCrossUserSharing = (queryInput, viewId, selectedSavedView, defaultView, actions, tableName) => {
|
|
14731
|
-
const { data: fetchedView, isError: fetchError } = useFetchSavedViewById(
|
|
14732
|
-
viewId,
|
|
14733
|
-
queryInput,
|
|
14734
|
-
Boolean(viewId)
|
|
14735
|
-
);
|
|
14736
|
-
const { mutate: createSavedView } = useCreateSavedView(queryInput);
|
|
14737
|
-
React21.useEffect(() => {
|
|
14738
|
-
if (fetchError && viewId) {
|
|
14739
|
-
actions.selectView(selectedSavedView ?? defaultView);
|
|
14740
|
-
actions.closeModal();
|
|
14741
|
-
}
|
|
14742
|
-
}, [fetchError, viewId, actions, selectedSavedView, defaultView]);
|
|
14743
|
-
const viewSharedViewTemporarily = () => {
|
|
14744
|
-
if (fetchedView) {
|
|
14745
|
-
const tempView = actions.createTemporaryView(fetchedView);
|
|
14746
|
-
actions.selectView(tempView);
|
|
14747
|
-
actions.closeModal();
|
|
14748
|
-
}
|
|
14749
|
-
};
|
|
14750
|
-
const createPersonalCopyOfSharedView = () => {
|
|
14751
|
-
if (fetchedView) {
|
|
14752
|
-
const viewToCreate = {
|
|
14753
|
-
name: fetchedView.name,
|
|
14754
|
-
description: fetchedView.description,
|
|
14755
|
-
table_name: tableName,
|
|
14756
|
-
table_config: fetchedView.table_config,
|
|
14757
|
-
view_level: "personal"
|
|
14798
|
+
const createTemporaryView = useCallback2(
|
|
14799
|
+
(fetchedView) => {
|
|
14800
|
+
const tempView = {
|
|
14801
|
+
...fetchedView,
|
|
14802
|
+
id: "temporary",
|
|
14803
|
+
name: "Temporary View"
|
|
14758
14804
|
};
|
|
14759
|
-
|
|
14760
|
-
|
|
14761
|
-
|
|
14762
|
-
|
|
14763
|
-
}
|
|
14764
|
-
});
|
|
14765
|
-
}
|
|
14766
|
-
};
|
|
14767
|
-
return {
|
|
14768
|
-
fetchedView,
|
|
14769
|
-
viewSharedViewTemporarily,
|
|
14770
|
-
createPersonalCopyOfSharedView
|
|
14771
|
-
};
|
|
14772
|
-
};
|
|
14773
|
-
|
|
14774
|
-
// src/utils/Hooks/useModalState.ts
|
|
14775
|
-
import { useState as useState5, useCallback as useCallback3 } from "react";
|
|
14776
|
-
var useModalState = () => {
|
|
14777
|
-
const [activeModal, setActiveModal] = useState5(null);
|
|
14778
|
-
const [modalData, setModalData] = useState5(null);
|
|
14779
|
-
const openModal = useCallback3(
|
|
14780
|
-
(type, data) => {
|
|
14781
|
-
setActiveModal(type);
|
|
14782
|
-
setModalData(data ?? null);
|
|
14805
|
+
ViewStorage.save(temporaryStorageKey, tempView);
|
|
14806
|
+
setTemporaryView(tempView);
|
|
14807
|
+
selectView(tempView);
|
|
14808
|
+
return tempView;
|
|
14783
14809
|
},
|
|
14784
|
-
[]
|
|
14810
|
+
[temporaryStorageKey, selectView]
|
|
14785
14811
|
);
|
|
14786
|
-
const
|
|
14787
|
-
|
|
14788
|
-
|
|
14789
|
-
|
|
14790
|
-
|
|
14791
|
-
|
|
14792
|
-
|
|
14812
|
+
const clearTemporaryView = useCallback2(() => {
|
|
14813
|
+
ViewStorage.remove(temporaryStorageKey);
|
|
14814
|
+
setTemporaryView(null);
|
|
14815
|
+
selectView(config.defaultView);
|
|
14816
|
+
}, [temporaryStorageKey, config.defaultView, selectView]);
|
|
14817
|
+
const isViewAlreadySelected = useCallback2(
|
|
14818
|
+
(viewId) => checkIsViewSelected(selectedSavedView, viewId),
|
|
14819
|
+
[selectedSavedView]
|
|
14820
|
+
);
|
|
14821
|
+
const handleSavedViewFromUrl = useCallback2(
|
|
14822
|
+
(viewId) => {
|
|
14823
|
+
if (isViewAlreadySelected(viewId)) {
|
|
14824
|
+
return;
|
|
14825
|
+
}
|
|
14826
|
+
openSharedViewModal(viewId);
|
|
14793
14827
|
},
|
|
14794
|
-
[
|
|
14828
|
+
[isViewAlreadySelected, openSharedViewModal]
|
|
14795
14829
|
);
|
|
14830
|
+
const handleListViewFromUrl = useCallback2(() => {
|
|
14831
|
+
if (config.defaultView.id !== (selectedSavedView == null ? void 0 : selectedSavedView.id)) {
|
|
14832
|
+
selectView(config.defaultView);
|
|
14833
|
+
}
|
|
14834
|
+
}, [config.defaultView, selectedSavedView, selectView]);
|
|
14835
|
+
useEffect3(() => {
|
|
14836
|
+
if (!allViews.length)
|
|
14837
|
+
return;
|
|
14838
|
+
const savedViewId = searchParams.get("saved-view");
|
|
14839
|
+
const viewParamFromConsumer = searchParams.get("view");
|
|
14840
|
+
if (savedViewId) {
|
|
14841
|
+
handleSavedViewFromUrl(savedViewId);
|
|
14842
|
+
return;
|
|
14843
|
+
}
|
|
14844
|
+
if (viewParamFromConsumer === "list") {
|
|
14845
|
+
handleListViewFromUrl();
|
|
14846
|
+
}
|
|
14847
|
+
}, [
|
|
14848
|
+
searchParams,
|
|
14849
|
+
savedViews,
|
|
14850
|
+
temporaryView,
|
|
14851
|
+
handleSavedViewFromUrl,
|
|
14852
|
+
handleListViewFromUrl,
|
|
14853
|
+
allViews.length
|
|
14854
|
+
]);
|
|
14796
14855
|
return {
|
|
14797
|
-
|
|
14798
|
-
|
|
14799
|
-
|
|
14800
|
-
|
|
14801
|
-
|
|
14856
|
+
selectedView: selectedSavedView,
|
|
14857
|
+
selectView,
|
|
14858
|
+
temporaryView,
|
|
14859
|
+
createTemporaryView,
|
|
14860
|
+
clearTemporaryView,
|
|
14861
|
+
allViews
|
|
14802
14862
|
};
|
|
14803
14863
|
};
|
|
14804
14864
|
|
|
@@ -14818,16 +14878,26 @@ var SavedViewsContent = (props) => {
|
|
|
14818
14878
|
};
|
|
14819
14879
|
const { data: savedViews } = useSavedViewsQuery(queryInput);
|
|
14820
14880
|
const { mutate: deleteSavedView } = useDeleteSavedView(queryInput);
|
|
14821
|
-
const
|
|
14822
|
-
const
|
|
14823
|
-
|
|
14881
|
+
const [activeModal, setActiveModal] = useState5(null);
|
|
14882
|
+
const [modalData, setModalData] = useState5(null);
|
|
14883
|
+
const openModal = (type, data) => {
|
|
14884
|
+
setActiveModal(type);
|
|
14885
|
+
setModalData(data ?? null);
|
|
14886
|
+
};
|
|
14887
|
+
const closeModal = useCallback3(() => {
|
|
14888
|
+
setActiveModal(null);
|
|
14889
|
+
setModalData(null);
|
|
14890
|
+
}, []);
|
|
14891
|
+
const isModalOpen = (type) => activeModal === type;
|
|
14892
|
+
const openSharedViewModal = (viewId) => {
|
|
14893
|
+
openModal("sharedView" /* SHARED_VIEW */, { viewId });
|
|
14824
14894
|
};
|
|
14825
14895
|
const {
|
|
14826
14896
|
selectedView,
|
|
14827
14897
|
selectView,
|
|
14828
|
-
|
|
14829
|
-
|
|
14830
|
-
|
|
14898
|
+
createTemporaryView,
|
|
14899
|
+
clearTemporaryView,
|
|
14900
|
+
allViews
|
|
14831
14901
|
} = useViewSelection(
|
|
14832
14902
|
{
|
|
14833
14903
|
domain: props.domain,
|
|
@@ -14839,24 +14909,54 @@ var SavedViewsContent = (props) => {
|
|
|
14839
14909
|
onSelect: props.onSelect
|
|
14840
14910
|
},
|
|
14841
14911
|
savedViews,
|
|
14842
|
-
|
|
14912
|
+
openSharedViewModal
|
|
14843
14913
|
);
|
|
14844
|
-
const {
|
|
14845
|
-
fetchedView,
|
|
14846
|
-
viewSharedViewTemporarily,
|
|
14847
|
-
createPersonalCopyOfSharedView
|
|
14848
|
-
} = useCrossUserSharing(
|
|
14849
|
-
queryInput,
|
|
14914
|
+
const { data: fetchedView, isError: fetchError } = useFetchSavedViewById(
|
|
14850
14915
|
(modalData == null ? void 0 : modalData.viewId) ?? null,
|
|
14851
|
-
|
|
14852
|
-
|
|
14853
|
-
{
|
|
14854
|
-
selectView,
|
|
14855
|
-
createTemporaryView,
|
|
14856
|
-
closeModal
|
|
14857
|
-
},
|
|
14858
|
-
props.tableName
|
|
14916
|
+
queryInput,
|
|
14917
|
+
Boolean(modalData == null ? void 0 : modalData.viewId)
|
|
14859
14918
|
);
|
|
14919
|
+
const {
|
|
14920
|
+
mutate: createSavedView,
|
|
14921
|
+
isPending: isCreating,
|
|
14922
|
+
error: createError,
|
|
14923
|
+
reset: resetCreateError
|
|
14924
|
+
} = useCreateSavedView(queryInput);
|
|
14925
|
+
useEffect4(() => {
|
|
14926
|
+
if (fetchError) {
|
|
14927
|
+
selectView(selectedView ?? props.defaultView);
|
|
14928
|
+
closeModal();
|
|
14929
|
+
}
|
|
14930
|
+
}, [fetchError, selectedView, props.defaultView, selectView, closeModal]);
|
|
14931
|
+
const viewSharedViewTemporarily = () => {
|
|
14932
|
+
if (fetchedView) {
|
|
14933
|
+
createTemporaryView(fetchedView);
|
|
14934
|
+
closeModal();
|
|
14935
|
+
}
|
|
14936
|
+
};
|
|
14937
|
+
const createPersonalCopyOfSharedView = (name, description) => {
|
|
14938
|
+
if (fetchedView) {
|
|
14939
|
+
const viewToCreate = {
|
|
14940
|
+
id: "",
|
|
14941
|
+
name,
|
|
14942
|
+
description,
|
|
14943
|
+
table_name: props.tableName,
|
|
14944
|
+
table_config: fetchedView.table_config,
|
|
14945
|
+
view_level: "personal",
|
|
14946
|
+
share_token: ""
|
|
14947
|
+
};
|
|
14948
|
+
createSavedView(viewToCreate, {
|
|
14949
|
+
onSuccess: (newView) => {
|
|
14950
|
+
selectView(newView);
|
|
14951
|
+
closeModal();
|
|
14952
|
+
}
|
|
14953
|
+
});
|
|
14954
|
+
}
|
|
14955
|
+
};
|
|
14956
|
+
const selectCurrentViewAndCloseModal = () => {
|
|
14957
|
+
selectView(selectedView ?? props.defaultView);
|
|
14958
|
+
closeModal();
|
|
14959
|
+
};
|
|
14860
14960
|
const deleteSelectedView = () => {
|
|
14861
14961
|
if (selectedView) {
|
|
14862
14962
|
deleteSavedView(selectedView, {
|
|
@@ -14869,18 +14969,13 @@ var SavedViewsContent = (props) => {
|
|
|
14869
14969
|
closeModal();
|
|
14870
14970
|
};
|
|
14871
14971
|
const i18n = useI18nContext11();
|
|
14872
|
-
const selectSavedViewFromList = ({ item }) => selectView(item);
|
|
14873
|
-
const setSelectedSavedView = (view) => {
|
|
14874
|
-
selectView(view);
|
|
14875
|
-
};
|
|
14876
|
-
const allViews = temporaryView ? [...savedViews ?? [], temporaryView] : savedViews ?? [];
|
|
14877
14972
|
return /* @__PURE__ */ React22.createElement(StyledPanel, { provider: props.provider }, /* @__PURE__ */ React22.createElement(
|
|
14878
14973
|
ExpandedPanel,
|
|
14879
14974
|
{
|
|
14880
14975
|
"data-testid": "saved-view-expanded-panel",
|
|
14881
14976
|
provider: props.provider
|
|
14882
14977
|
},
|
|
14883
|
-
/* @__PURE__ */ React22.createElement(Panel3.Header, { id: "saved-views-collections-panel-header" }, /* @__PURE__ */ React22.createElement(Panel3.Title, null, /* @__PURE__ */ React22.createElement(
|
|
14978
|
+
/* @__PURE__ */ React22.createElement(Panel3.Header, { id: "saved-views-collections-panel-header" }, /* @__PURE__ */ React22.createElement(Panel3.Title, null, /* @__PURE__ */ React22.createElement(Flex6, { alignItems: "center" }, /* @__PURE__ */ React22.createElement(Box2, { paddingRight: "sm" }, i18n.t("savedViews.title")), /* @__PURE__ */ React22.createElement(Tooltip, { showDelay: 200, overlay: i18n.t("savedViews.tooltip") }, /* @__PURE__ */ React22.createElement(Help_default, { size: "sm" })))), /* @__PURE__ */ React22.createElement(
|
|
14884
14979
|
Tooltip,
|
|
14885
14980
|
{
|
|
14886
14981
|
overlay: i18n.t("savedViews.actions.create"),
|
|
@@ -14901,11 +14996,9 @@ var SavedViewsContent = (props) => {
|
|
|
14901
14996
|
/* @__PURE__ */ React22.createElement(Panel3.Body, { style: { display: "flex", flexFlow: "column" } }, /* @__PURE__ */ React22.createElement(
|
|
14902
14997
|
PanelContent,
|
|
14903
14998
|
{
|
|
14904
|
-
onSelect:
|
|
14999
|
+
onSelect: ({ item }) => selectView(item),
|
|
14905
15000
|
openModal,
|
|
14906
15001
|
onDelete: () => openModal("delete" /* DELETE */),
|
|
14907
|
-
updateLocalStorage,
|
|
14908
|
-
setSelectedSavedView,
|
|
14909
15002
|
queryInput,
|
|
14910
15003
|
selectedSavedView: selectedView,
|
|
14911
15004
|
tableConfig: props.tableConfig,
|
|
@@ -14913,7 +15006,8 @@ var SavedViewsContent = (props) => {
|
|
|
14913
15006
|
stickyViewsKey: props.stickyViewsKey,
|
|
14914
15007
|
savedViews: allViews,
|
|
14915
15008
|
provider: props.provider,
|
|
14916
|
-
userId: props.userId
|
|
15009
|
+
userId: props.userId,
|
|
15010
|
+
onClearTemporary: clearTemporaryView
|
|
14917
15011
|
}
|
|
14918
15012
|
))
|
|
14919
15013
|
), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */ React22.createElement(
|
|
@@ -14926,7 +15020,6 @@ var SavedViewsContent = (props) => {
|
|
|
14926
15020
|
tableConfig: props.tableConfig,
|
|
14927
15021
|
tableName: props.tableName,
|
|
14928
15022
|
selectedSavedView: selectedView,
|
|
14929
|
-
setSelectedSavedView,
|
|
14930
15023
|
onSelect: selectView,
|
|
14931
15024
|
setOpenEditCreateModal: closeModal,
|
|
14932
15025
|
defaultView: props.defaultView
|
|
@@ -14938,14 +15031,17 @@ var SavedViewsContent = (props) => {
|
|
|
14938
15031
|
onDelete: confirmDeleteAndCloseModal,
|
|
14939
15032
|
onCancel: closeModal
|
|
14940
15033
|
}
|
|
14941
|
-
), fetchedView && isModalOpen("
|
|
14942
|
-
|
|
15034
|
+
), fetchedView && isModalOpen("sharedView" /* SHARED_VIEW */) && /* @__PURE__ */ React22.createElement(
|
|
15035
|
+
SharedViewFormModal,
|
|
14943
15036
|
{
|
|
14944
15037
|
open: true,
|
|
14945
|
-
|
|
14946
|
-
onClose:
|
|
14947
|
-
|
|
14948
|
-
onCreateView: createPersonalCopyOfSharedView
|
|
15038
|
+
fetchedView,
|
|
15039
|
+
onClose: selectCurrentViewAndCloseModal,
|
|
15040
|
+
onCreateTemporaryView: viewSharedViewTemporarily,
|
|
15041
|
+
onCreateView: createPersonalCopyOfSharedView,
|
|
15042
|
+
createError,
|
|
15043
|
+
isCreating,
|
|
15044
|
+
resetCreateError
|
|
14949
15045
|
}
|
|
14950
15046
|
));
|
|
14951
15047
|
};
|
|
@@ -14955,59 +15051,77 @@ var SavedViews = (props) => {
|
|
|
14955
15051
|
|
|
14956
15052
|
// src/SavedViews/components/SavedViews/SmartGrid/SmartGridSavedViews.tsx
|
|
14957
15053
|
import { ToastAlertProvider } from "@procore/toast-alert";
|
|
15054
|
+
var generateStickyViewsKey = (domain, tableName, userId, projectId, companyId) => {
|
|
15055
|
+
return `savedView-${domain}-${tableName}-${companyId}-${projectId}-${userId}`;
|
|
15056
|
+
};
|
|
14958
15057
|
var SmartGridSavedViews = (props) => {
|
|
14959
|
-
const { gridApi, projectId, companyId } = props;
|
|
15058
|
+
const { gridApi, userId, projectId, companyId } = props;
|
|
14960
15059
|
const { config: tableConfig, setConfig: setTableConfig } = useSmartGridConfig(gridApi);
|
|
14961
15060
|
const defaultView = useDefaultView({
|
|
14962
15061
|
defaultViewName: props.defaultViewName,
|
|
14963
15062
|
domain: props.domain
|
|
14964
15063
|
});
|
|
14965
|
-
const onSelect = (
|
|
14966
|
-
|
|
14967
|
-
|
|
14968
|
-
|
|
14969
|
-
|
|
14970
|
-
|
|
14971
|
-
|
|
14972
|
-
|
|
14973
|
-
|
|
14974
|
-
|
|
14975
|
-
|
|
14976
|
-
|
|
14977
|
-
|
|
14978
|
-
|
|
14979
|
-
|
|
14980
|
-
|
|
14981
|
-
|
|
14982
|
-
|
|
14983
|
-
|
|
14984
|
-
|
|
14985
|
-
|
|
14986
|
-
|
|
15064
|
+
const onSelect = useCallback4(
|
|
15065
|
+
({ item }) => {
|
|
15066
|
+
if (!gridApi)
|
|
15067
|
+
return item;
|
|
15068
|
+
if (item.id === "default") {
|
|
15069
|
+
gridApi.autoSizeAllColumns();
|
|
15070
|
+
gridApi.resetColumnState();
|
|
15071
|
+
gridApi.setFilterModel(props.defaultViewFilters);
|
|
15072
|
+
gridApi.setGridOption("rowHeight", props.defaultRowHeight);
|
|
15073
|
+
gridApi.refreshCells();
|
|
15074
|
+
return item;
|
|
15075
|
+
}
|
|
15076
|
+
const updatedView = {
|
|
15077
|
+
...item,
|
|
15078
|
+
table_config: customAndConfigSync(
|
|
15079
|
+
item.table_config,
|
|
15080
|
+
tableConfig
|
|
15081
|
+
)
|
|
15082
|
+
};
|
|
15083
|
+
updateTableConfig(updatedView, gridApi, "smart-grid");
|
|
15084
|
+
setTableConfig(updatedView.table_config);
|
|
15085
|
+
return updatedView;
|
|
15086
|
+
},
|
|
15087
|
+
[
|
|
15088
|
+
gridApi,
|
|
15089
|
+
props.defaultViewFilters,
|
|
15090
|
+
props.defaultRowHeight,
|
|
15091
|
+
tableConfig,
|
|
15092
|
+
setTableConfig
|
|
15093
|
+
]
|
|
15094
|
+
);
|
|
15095
|
+
const stickyViewsKey = generateStickyViewsKey(
|
|
15096
|
+
props.domain,
|
|
15097
|
+
props.tableName,
|
|
15098
|
+
userId,
|
|
15099
|
+
projectId,
|
|
15100
|
+
companyId
|
|
15101
|
+
);
|
|
14987
15102
|
return /* @__PURE__ */ React23.createElement(ToastAlertProvider, null, /* @__PURE__ */ React23.createElement(
|
|
14988
15103
|
SavedViews,
|
|
14989
15104
|
{
|
|
14990
15105
|
onSelect,
|
|
14991
15106
|
domain: props.domain,
|
|
14992
|
-
userId
|
|
15107
|
+
userId,
|
|
14993
15108
|
projectId,
|
|
14994
15109
|
companyId,
|
|
14995
15110
|
provider: "smart-grid",
|
|
14996
15111
|
defaultView,
|
|
14997
15112
|
tableName: props.tableName,
|
|
14998
15113
|
tableConfig,
|
|
14999
|
-
stickyViewsKey
|
|
15000
|
-
enableSavedViews: props.enableSavedViews
|
|
15114
|
+
stickyViewsKey
|
|
15001
15115
|
}
|
|
15002
15116
|
));
|
|
15003
15117
|
};
|
|
15004
15118
|
|
|
15005
15119
|
// src/SavedViews/components/SavedViews/DataTable/DataTableSavedViews.tsx
|
|
15006
15120
|
import React24, {
|
|
15007
|
-
forwardRef as
|
|
15121
|
+
forwardRef as forwardRef11,
|
|
15008
15122
|
useImperativeHandle,
|
|
15009
15123
|
useState as useState6,
|
|
15010
|
-
useCallback as
|
|
15124
|
+
useCallback as useCallback5
|
|
15011
15125
|
} from "react";
|
|
15012
15126
|
|
|
15013
15127
|
// src/SavedViews/components/SavedViews/DataTable/DataTableDefaultSavedView.tsx
|
|
@@ -15082,58 +15196,63 @@ var useDefaultView2 = (props) => {
|
|
|
15082
15196
|
|
|
15083
15197
|
// src/SavedViews/components/SavedViews/DataTable/DataTableSavedViews.tsx
|
|
15084
15198
|
import { ToastAlertProvider as ToastAlertProvider2 } from "@procore/toast-alert";
|
|
15085
|
-
var
|
|
15086
|
-
|
|
15199
|
+
var generateStickyViewsKey2 = (domain, tableName, userId, projectId, companyId) => {
|
|
15200
|
+
return `savedView-${domain}-${tableName}-${companyId}-${projectId}-${userId}`;
|
|
15201
|
+
};
|
|
15202
|
+
var DataTableSavedViews = forwardRef11((props, ref) => {
|
|
15203
|
+
const { tableApi, userId, projectId, companyId } = props;
|
|
15087
15204
|
const [internalTableConfig, setInternalTableConfig] = useState6(
|
|
15088
15205
|
props.defaultViewConfig
|
|
15089
15206
|
);
|
|
15090
15207
|
useImperativeHandle(ref, () => ({
|
|
15091
15208
|
setTableConfig: (newConfig) => {
|
|
15092
|
-
|
|
15209
|
+
setInternalTableConfig(newConfig);
|
|
15093
15210
|
}
|
|
15094
15211
|
}));
|
|
15095
|
-
const handleConfigChange = useCallback4(
|
|
15096
|
-
(newConfig) => {
|
|
15097
|
-
setInternalTableConfig(newConfig);
|
|
15098
|
-
onTableConfigChange(newConfig);
|
|
15099
|
-
},
|
|
15100
|
-
[onTableConfigChange]
|
|
15101
|
-
);
|
|
15102
15212
|
const defaultView = useDefaultView2({
|
|
15103
15213
|
defaultViewName: props.defaultViewName,
|
|
15104
15214
|
receivedConfigFromTool: props.defaultViewConfig,
|
|
15105
15215
|
domain: props.domain,
|
|
15106
15216
|
columnDefinitions: props.columnDefinitions
|
|
15107
15217
|
});
|
|
15108
|
-
const onSelect = (
|
|
15109
|
-
|
|
15110
|
-
|
|
15111
|
-
|
|
15112
|
-
|
|
15113
|
-
|
|
15114
|
-
|
|
15115
|
-
|
|
15116
|
-
|
|
15117
|
-
|
|
15118
|
-
|
|
15119
|
-
|
|
15218
|
+
const onSelect = useCallback5(
|
|
15219
|
+
({ item }) => {
|
|
15220
|
+
const isDefaultView = item.id === "default";
|
|
15221
|
+
const updatedView = isDefaultView ? defaultView : {
|
|
15222
|
+
...item,
|
|
15223
|
+
table_config: customAndConfigSync(
|
|
15224
|
+
item.table_config,
|
|
15225
|
+
defaultView.table_config
|
|
15226
|
+
)
|
|
15227
|
+
};
|
|
15228
|
+
updateTableConfig(updatedView, tableApi, "data-table");
|
|
15229
|
+
return updatedView;
|
|
15230
|
+
},
|
|
15231
|
+
[defaultView, tableApi]
|
|
15232
|
+
);
|
|
15120
15233
|
if (!internalTableConfig) {
|
|
15121
15234
|
return null;
|
|
15122
15235
|
}
|
|
15236
|
+
const stickyViewsKey = generateStickyViewsKey2(
|
|
15237
|
+
props.domain,
|
|
15238
|
+
props.tableName,
|
|
15239
|
+
userId,
|
|
15240
|
+
projectId,
|
|
15241
|
+
companyId
|
|
15242
|
+
);
|
|
15123
15243
|
return /* @__PURE__ */ React24.createElement(ToastAlertProvider2, null, /* @__PURE__ */ React24.createElement(
|
|
15124
15244
|
SavedViews,
|
|
15125
15245
|
{
|
|
15126
15246
|
onSelect,
|
|
15127
15247
|
domain: props.domain,
|
|
15128
|
-
userId
|
|
15248
|
+
userId,
|
|
15129
15249
|
projectId,
|
|
15130
15250
|
companyId,
|
|
15131
15251
|
provider: "data-table",
|
|
15132
15252
|
defaultView,
|
|
15133
15253
|
tableName: props.tableName,
|
|
15134
15254
|
tableConfig: internalTableConfig,
|
|
15135
|
-
stickyViewsKey
|
|
15136
|
-
enableSavedViews: props.enableSavedViews
|
|
15255
|
+
stickyViewsKey
|
|
15137
15256
|
}
|
|
15138
15257
|
));
|
|
15139
15258
|
});
|