@procore/saved-views 1.0.1-estimatingFork.5 → 1.0.1-estimatingFork.6.1
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/dist/legacy/index.d.mts +4 -1
- package/dist/legacy/index.d.ts +4 -1
- package/dist/legacy/index.js +281 -202
- package/dist/legacy/index.mjs +306 -228
- package/dist/modern/index.d.mts +4 -1
- package/dist/modern/index.d.ts +4 -1
- package/dist/modern/index.js +280 -202
- package/dist/modern/index.mjs +305 -228
- package/package.json +3 -2
package/dist/modern/index.js
CHANGED
|
@@ -109,7 +109,7 @@ var require_react_is_production_min = __commonJS({
|
|
|
109
109
|
var E2 = n2;
|
|
110
110
|
var F2 = c2;
|
|
111
111
|
var G2 = f2;
|
|
112
|
-
var
|
|
112
|
+
var H2 = e2;
|
|
113
113
|
var I = l2;
|
|
114
114
|
exports.ContextConsumer = h;
|
|
115
115
|
exports.ContextProvider = z2;
|
|
@@ -120,7 +120,7 @@ var require_react_is_production_min = __commonJS({
|
|
|
120
120
|
exports.Memo = E2;
|
|
121
121
|
exports.Portal = F2;
|
|
122
122
|
exports.Profiler = G2;
|
|
123
|
-
exports.StrictMode =
|
|
123
|
+
exports.StrictMode = H2;
|
|
124
124
|
exports.Suspense = I;
|
|
125
125
|
exports.isAsyncMode = function() {
|
|
126
126
|
return false;
|
|
@@ -7881,7 +7881,7 @@ function __rest(s2, e2) {
|
|
|
7881
7881
|
return t2;
|
|
7882
7882
|
}
|
|
7883
7883
|
|
|
7884
|
-
//
|
|
7884
|
+
// node_modules/@procore/core-icons/dist/Icon.js
|
|
7885
7885
|
var React = __toESM(require("react"));
|
|
7886
7886
|
function getSize(size) {
|
|
7887
7887
|
if (size === "sm") {
|
|
@@ -7900,7 +7900,7 @@ function Icon(_a) {
|
|
|
7900
7900
|
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;
|
|
7901
7901
|
}
|
|
7902
7902
|
|
|
7903
|
-
//
|
|
7903
|
+
// node_modules/@procore/core-icons/dist/icons/Building.js
|
|
7904
7904
|
var React2 = __toESM(require("react"));
|
|
7905
7905
|
var Building = React2.forwardRef(function Building2(props, ref) {
|
|
7906
7906
|
return React2.createElement(
|
|
@@ -7916,7 +7916,7 @@ var Building = React2.forwardRef(function Building2(props, ref) {
|
|
|
7916
7916
|
Building.displayName = "Building";
|
|
7917
7917
|
var Building_default = Building;
|
|
7918
7918
|
|
|
7919
|
-
//
|
|
7919
|
+
// node_modules/@procore/core-icons/dist/icons/ChevronDown.js
|
|
7920
7920
|
var React3 = __toESM(require("react"));
|
|
7921
7921
|
var ChevronDown = React3.forwardRef(function ChevronDown2(props, ref) {
|
|
7922
7922
|
return React3.createElement(
|
|
@@ -7932,7 +7932,7 @@ var ChevronDown = React3.forwardRef(function ChevronDown2(props, ref) {
|
|
|
7932
7932
|
ChevronDown.displayName = "ChevronDown";
|
|
7933
7933
|
var ChevronDown_default = ChevronDown;
|
|
7934
7934
|
|
|
7935
|
-
//
|
|
7935
|
+
// node_modules/@procore/core-icons/dist/icons/ChevronRight.js
|
|
7936
7936
|
var React4 = __toESM(require("react"));
|
|
7937
7937
|
var ChevronRight = React4.forwardRef(function ChevronRight2(props, ref) {
|
|
7938
7938
|
return React4.createElement(
|
|
@@ -7948,7 +7948,7 @@ var ChevronRight = React4.forwardRef(function ChevronRight2(props, ref) {
|
|
|
7948
7948
|
ChevronRight.displayName = "ChevronRight";
|
|
7949
7949
|
var ChevronRight_default = ChevronRight;
|
|
7950
7950
|
|
|
7951
|
-
//
|
|
7951
|
+
// node_modules/@procore/core-icons/dist/icons/Clear.js
|
|
7952
7952
|
var React5 = __toESM(require("react"));
|
|
7953
7953
|
var Clear = React5.forwardRef(function Clear2(props, ref) {
|
|
7954
7954
|
return React5.createElement(
|
|
@@ -7964,7 +7964,7 @@ var Clear = React5.forwardRef(function Clear2(props, ref) {
|
|
|
7964
7964
|
Clear.displayName = "Clear";
|
|
7965
7965
|
var Clear_default = Clear;
|
|
7966
7966
|
|
|
7967
|
-
//
|
|
7967
|
+
// node_modules/@procore/core-icons/dist/icons/Excavator.js
|
|
7968
7968
|
var React6 = __toESM(require("react"));
|
|
7969
7969
|
var Excavator = React6.forwardRef(function Excavator2(props, ref) {
|
|
7970
7970
|
return React6.createElement(
|
|
@@ -7981,7 +7981,7 @@ var Excavator = React6.forwardRef(function Excavator2(props, ref) {
|
|
|
7981
7981
|
Excavator.displayName = "Excavator";
|
|
7982
7982
|
var Excavator_default = Excavator;
|
|
7983
7983
|
|
|
7984
|
-
//
|
|
7984
|
+
// node_modules/@procore/core-icons/dist/icons/ExpandSidebar.js
|
|
7985
7985
|
var React7 = __toESM(require("react"));
|
|
7986
7986
|
var ExpandSidebar = React7.forwardRef(function ExpandSidebar2(props, ref) {
|
|
7987
7987
|
return React7.createElement(
|
|
@@ -7999,7 +7999,7 @@ var ExpandSidebar = React7.forwardRef(function ExpandSidebar2(props, ref) {
|
|
|
7999
7999
|
ExpandSidebar.displayName = "ExpandSidebar";
|
|
8000
8000
|
var ExpandSidebar_default = ExpandSidebar;
|
|
8001
8001
|
|
|
8002
|
-
//
|
|
8002
|
+
// node_modules/@procore/core-icons/dist/icons/Help.js
|
|
8003
8003
|
var React8 = __toESM(require("react"));
|
|
8004
8004
|
var Help = React8.forwardRef(function Help2(props, ref) {
|
|
8005
8005
|
return React8.createElement(
|
|
@@ -8015,7 +8015,7 @@ var Help = React8.forwardRef(function Help2(props, ref) {
|
|
|
8015
8015
|
Help.displayName = "Help";
|
|
8016
8016
|
var Help_default = Help;
|
|
8017
8017
|
|
|
8018
|
-
//
|
|
8018
|
+
// node_modules/@procore/core-icons/dist/icons/Link.js
|
|
8019
8019
|
var React9 = __toESM(require("react"));
|
|
8020
8020
|
var Link = React9.forwardRef(function Link2(props, ref) {
|
|
8021
8021
|
return React9.createElement(
|
|
@@ -8032,7 +8032,7 @@ var Link = React9.forwardRef(function Link2(props, ref) {
|
|
|
8032
8032
|
Link.displayName = "Link";
|
|
8033
8033
|
var Link_default = Link;
|
|
8034
8034
|
|
|
8035
|
-
//
|
|
8035
|
+
// node_modules/@procore/core-icons/dist/icons/Person.js
|
|
8036
8036
|
var React10 = __toESM(require("react"));
|
|
8037
8037
|
var Person = React10.forwardRef(function Person2(props, ref) {
|
|
8038
8038
|
return React10.createElement(
|
|
@@ -8048,7 +8048,7 @@ var Person = React10.forwardRef(function Person2(props, ref) {
|
|
|
8048
8048
|
Person.displayName = "Person";
|
|
8049
8049
|
var Person_default = Person;
|
|
8050
8050
|
|
|
8051
|
-
//
|
|
8051
|
+
// node_modules/@procore/core-icons/dist/icons/Plus.js
|
|
8052
8052
|
var React11 = __toESM(require("react"));
|
|
8053
8053
|
var Plus = React11.forwardRef(function Plus2(props, ref) {
|
|
8054
8054
|
return React11.createElement(
|
|
@@ -8161,7 +8161,7 @@ function stylis_min(W2) {
|
|
|
8161
8161
|
}
|
|
8162
8162
|
k2 = M2(c2, r2, k2, g2, a2 + 1);
|
|
8163
8163
|
t2 = k2.length;
|
|
8164
|
-
0 < A2 && (r2 = X2(O2, f2, I), C2 =
|
|
8164
|
+
0 < A2 && (r2 = X2(O2, f2, I), C2 = H2(3, k2, r2, c2, D2, z2, t2, g2, a2, h), f2 = r2.join(""), void 0 !== C2 && 0 === (t2 = (k2 = C2.trim()).length) && (g2 = 0, k2 = ""));
|
|
8165
8165
|
if (0 < t2)
|
|
8166
8166
|
switch (g2) {
|
|
8167
8167
|
case 115:
|
|
@@ -8194,7 +8194,7 @@ function stylis_min(W2) {
|
|
|
8194
8194
|
case 59:
|
|
8195
8195
|
f2 = (0 < r2 ? f2.replace(N, "") : f2).trim();
|
|
8196
8196
|
if (1 < (t2 = f2.length))
|
|
8197
|
-
switch (0 === u2 && (q2 = f2.charCodeAt(0), 45 === q2 || 96 < q2 && 123 > q2) && (t2 = (f2 = f2.replace(" ", ":")).length), 0 < A2 && void 0 !== (C2 =
|
|
8197
|
+
switch (0 === u2 && (q2 = f2.charCodeAt(0), 45 === q2 || 96 < q2 && 123 > q2) && (t2 = (f2 = f2.replace(" ", ":")).length), 0 < A2 && void 0 !== (C2 = H2(1, f2, c2, d, D2, z2, p.length, h, a2, h)) && 0 === (t2 = (f2 = C2.trim()).length) && (f2 = "\0\0"), q2 = f2.charCodeAt(0), g2 = f2.charCodeAt(1), q2) {
|
|
8198
8198
|
case 0:
|
|
8199
8199
|
break;
|
|
8200
8200
|
case 64:
|
|
@@ -8214,7 +8214,7 @@ function stylis_min(W2) {
|
|
|
8214
8214
|
case 13:
|
|
8215
8215
|
case 10:
|
|
8216
8216
|
47 === b2 ? b2 = 0 : 0 === 1 + q2 && 107 !== h && 0 < f2.length && (r2 = 1, f2 += "\0");
|
|
8217
|
-
0 < A2 * Y2 &&
|
|
8217
|
+
0 < A2 * Y2 && H2(0, f2, c2, d, D2, z2, p.length, h, a2, h);
|
|
8218
8218
|
z2 = 1;
|
|
8219
8219
|
D2++;
|
|
8220
8220
|
break;
|
|
@@ -8323,7 +8323,7 @@ function stylis_min(W2) {
|
|
|
8323
8323
|
t2 = p.length;
|
|
8324
8324
|
if (0 < t2) {
|
|
8325
8325
|
r2 = c2;
|
|
8326
|
-
if (0 < A2 && (C2 =
|
|
8326
|
+
if (0 < A2 && (C2 = H2(2, p, r2, d, D2, z2, t2, h, a2, h), void 0 !== C2 && 0 === (p = C2).length))
|
|
8327
8327
|
return G3 + p + F3;
|
|
8328
8328
|
p = r2.join(",") + "{" + p + "}";
|
|
8329
8329
|
if (0 !== w2 * E2) {
|
|
@@ -8500,7 +8500,7 @@ function stylis_min(W2) {
|
|
|
8500
8500
|
var e2 = P4(c2, c2.charCodeAt(0), c2.charCodeAt(1), c2.charCodeAt(2));
|
|
8501
8501
|
return e2 !== c2 + ";" ? e2.replace(oa, " or ($1)").substring(4) : "(" + c2 + ")";
|
|
8502
8502
|
}
|
|
8503
|
-
function
|
|
8503
|
+
function H2(d, c2, e2, h, a2, m2, b2, v2, n2, q2) {
|
|
8504
8504
|
for (var g2 = 0, x2 = c2, w3; g2 < A2; ++g2) {
|
|
8505
8505
|
switch (w3 = S2[g2].call(B2, d, x2, e2, h, a2, m2, b2, v2, n2, q2)) {
|
|
8506
8506
|
case void 0:
|
|
@@ -8544,11 +8544,11 @@ function stylis_min(W2) {
|
|
|
8544
8544
|
V2 = e2;
|
|
8545
8545
|
e2 = [V2];
|
|
8546
8546
|
if (0 < A2) {
|
|
8547
|
-
var h =
|
|
8547
|
+
var h = H2(-1, c2, e2, e2, D2, z2, 0, 0, 0, 0);
|
|
8548
8548
|
void 0 !== h && "string" === typeof h && (c2 = h);
|
|
8549
8549
|
}
|
|
8550
8550
|
var a2 = M2(O2, e2, c2, 0, 0);
|
|
8551
|
-
0 < A2 && (h =
|
|
8551
|
+
0 < A2 && (h = H2(-2, a2, e2, e2, D2, z2, a2.length, 0, 0, 0), void 0 !== h && (a2 = h));
|
|
8552
8552
|
V2 = "";
|
|
8553
8553
|
E2 = 0;
|
|
8554
8554
|
z2 = D2 = 1;
|
|
@@ -9356,8 +9356,8 @@ var useSavedViewsPanel = (domain, tableName) => {
|
|
|
9356
9356
|
setIsOpen(!isOpen);
|
|
9357
9357
|
localStorage.setItem(key(domain, tableName), JSON.stringify(!isOpen));
|
|
9358
9358
|
};
|
|
9359
|
-
const
|
|
9360
|
-
return { isOpen, SavedViewsButton:
|
|
9359
|
+
const Button8 = () => /* @__PURE__ */ import_react5.default.createElement(SavedViewsButton, { handleClick, isOpen });
|
|
9360
|
+
return { isOpen, SavedViewsButton: Button8 };
|
|
9361
9361
|
};
|
|
9362
9362
|
var useSavedViewsPanel_default = useSavedViewsPanel;
|
|
9363
9363
|
|
|
@@ -9431,6 +9431,17 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9431
9431
|
label: i18n.t("savedViews.actions.delete")
|
|
9432
9432
|
}
|
|
9433
9433
|
];
|
|
9434
|
+
const preventEventBubbleToNotTriggerViewSelectEvent = React15.useCallback(
|
|
9435
|
+
(e2) => {
|
|
9436
|
+
e2.stopPropagation();
|
|
9437
|
+
},
|
|
9438
|
+
[]
|
|
9439
|
+
);
|
|
9440
|
+
const hasUpdateButton = props.item.view_level !== "default" && props.canUpdate;
|
|
9441
|
+
const hasCopyShareLinkButton = props.enableSharingViews !== false && props.item.view_level !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary";
|
|
9442
|
+
const hasClearTemporaryButton = props.item.id === "temporary";
|
|
9443
|
+
const hasOverflowMenu = props.item.view_level !== "default" && props.canEditOrDelete;
|
|
9444
|
+
const hasActions = hasUpdateButton || hasCopyShareLinkButton || hasClearTemporaryButton || hasOverflowMenu;
|
|
9434
9445
|
return /* @__PURE__ */ React15.createElement(
|
|
9435
9446
|
Container2,
|
|
9436
9447
|
{
|
|
@@ -9440,7 +9451,8 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9440
9451
|
"aria-label": i18n.t("savedViews.ariaLabels.menuItem", {
|
|
9441
9452
|
name: props.item.name
|
|
9442
9453
|
}),
|
|
9443
|
-
"data-testid": "saved-view-collection-menu-item"
|
|
9454
|
+
"data-testid": "saved-view-collection-menu-item",
|
|
9455
|
+
onKeyDown: preventEventBubbleToNotTriggerViewSelectEvent
|
|
9444
9456
|
},
|
|
9445
9457
|
/* @__PURE__ */ React15.createElement(
|
|
9446
9458
|
"span",
|
|
@@ -9450,7 +9462,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9450
9462
|
},
|
|
9451
9463
|
props.item.name
|
|
9452
9464
|
),
|
|
9453
|
-
/* @__PURE__ */ React15.createElement(RowActionsBox, null, /* @__PURE__ */ React15.createElement(import_core_react3.Box, { justifyContent: "space-between" },
|
|
9465
|
+
hasActions && /* @__PURE__ */ React15.createElement(RowActionsBox, null, /* @__PURE__ */ React15.createElement(import_core_react3.Box, { justifyContent: "space-between" }, hasUpdateButton && /* @__PURE__ */ React15.createElement(
|
|
9454
9466
|
import_core_react3.Button,
|
|
9455
9467
|
{
|
|
9456
9468
|
onClick: updateItem,
|
|
@@ -9461,7 +9473,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9461
9473
|
loading: props.isUpdateProcessing
|
|
9462
9474
|
},
|
|
9463
9475
|
i18n.t("savedViews.actions.update")
|
|
9464
|
-
)
|
|
9476
|
+
), hasCopyShareLinkButton && /* @__PURE__ */ React15.createElement(
|
|
9465
9477
|
import_core_react3.Button,
|
|
9466
9478
|
{
|
|
9467
9479
|
onClick: copyShareLink,
|
|
@@ -9471,7 +9483,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9471
9483
|
"data-testid": "copy-share-link-button"
|
|
9472
9484
|
},
|
|
9473
9485
|
/* @__PURE__ */ React15.createElement(IconWrapper, null, /* @__PURE__ */ React15.createElement(Link_default, { size: "sm" }))
|
|
9474
|
-
)
|
|
9486
|
+
), hasClearTemporaryButton && /* @__PURE__ */ React15.createElement(
|
|
9475
9487
|
import_core_react3.Button,
|
|
9476
9488
|
{
|
|
9477
9489
|
onClick: (e2) => {
|
|
@@ -9485,7 +9497,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9485
9497
|
"data-testid": "clear-temporary-view-button"
|
|
9486
9498
|
},
|
|
9487
9499
|
/* @__PURE__ */ React15.createElement(IconWrapper, null, /* @__PURE__ */ React15.createElement(Clear_default, { size: "sm" }))
|
|
9488
|
-
))
|
|
9500
|
+
)), /* @__PURE__ */ React15.createElement(import_core_react3.Box, null, hasOverflowMenu && /* @__PURE__ */ React15.createElement(
|
|
9489
9501
|
import_core_react3.DropdownFlyout,
|
|
9490
9502
|
{
|
|
9491
9503
|
"data-testid": "saved-view-overflow-button",
|
|
@@ -9496,7 +9508,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9496
9508
|
variant: "tertiary",
|
|
9497
9509
|
disabled: props.isUpdateProcessing
|
|
9498
9510
|
}
|
|
9499
|
-
)))
|
|
9511
|
+
)))
|
|
9500
9512
|
);
|
|
9501
9513
|
};
|
|
9502
9514
|
|
|
@@ -9536,7 +9548,7 @@ var import_react9 = __toESM(require("react"));
|
|
|
9536
9548
|
|
|
9537
9549
|
// src/components/panels/PanelContent.styles.ts
|
|
9538
9550
|
var import_core_react5 = require("@procore/core-react");
|
|
9539
|
-
var Row = styled_components_esm_default(import_core_react5.
|
|
9551
|
+
var Row = styled_components_esm_default(import_core_react5.MenuImperative.Item)`
|
|
9540
9552
|
width: 100%;
|
|
9541
9553
|
padding-left: 35px;
|
|
9542
9554
|
padding-right: 4px;
|
|
@@ -9808,31 +9820,40 @@ var groupIcon = (group) => {
|
|
|
9808
9820
|
return /* @__PURE__ */ import_react8.default.createElement(Building_default, null);
|
|
9809
9821
|
}
|
|
9810
9822
|
};
|
|
9811
|
-
var
|
|
9812
|
-
width: 100%;
|
|
9823
|
+
var StyledButton2 = styled_components_esm_default(import_core_react6.Button)`
|
|
9813
9824
|
&:hover {
|
|
9814
9825
|
background-color: ${import_core_react6.colors.gray98};
|
|
9815
9826
|
}
|
|
9816
9827
|
`;
|
|
9817
9828
|
var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
|
|
9818
9829
|
const I18n = (0, import_core_react6.useI18nContext)();
|
|
9819
|
-
return /* @__PURE__ */ import_react8.default.createElement(
|
|
9820
|
-
|
|
9830
|
+
return /* @__PURE__ */ import_react8.default.createElement(import_core_react6.Box, { style: { width: "100%" } }, /* @__PURE__ */ import_react8.default.createElement(
|
|
9831
|
+
StyledButton2,
|
|
9821
9832
|
{
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
|
|
9833
|
+
block: true,
|
|
9834
|
+
style: {
|
|
9835
|
+
justifyContent: "start",
|
|
9836
|
+
height: "40px"
|
|
9837
|
+
},
|
|
9838
|
+
variant: "tertiary",
|
|
9839
|
+
size: "sm",
|
|
9840
|
+
onClick: () => toggleGroup(group),
|
|
9841
|
+
"aria-controls": `saved-views-collections-${group}`,
|
|
9842
|
+
"aria-expanded": expanded,
|
|
9843
|
+
icon: expanded ? /* @__PURE__ */ import_react8.default.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ import_react8.default.createElement(ChevronRight_default, { size: "sm" })
|
|
9827
9844
|
},
|
|
9828
|
-
expanded ? /* @__PURE__ */ import_react8.default.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ import_react8.default.createElement(ChevronRight_default, { size: "sm" }),
|
|
9829
9845
|
groupIcon(group),
|
|
9830
9846
|
/* @__PURE__ */ import_react8.default.createElement(import_core_react6.Typography, { weight: "semibold" }, I18n.t(`savedViews.viewLevel.${group}`))
|
|
9831
|
-
);
|
|
9847
|
+
));
|
|
9832
9848
|
};
|
|
9833
9849
|
var ViewLevelHeader_default = ViewLevelHeader;
|
|
9834
9850
|
|
|
9835
9851
|
// src/components/panels/PanelContent.tsx
|
|
9852
|
+
var StyledMenuImperative = styled_components_esm_default(import_core_react7.MenuImperative)`
|
|
9853
|
+
div[role='listbox'] {
|
|
9854
|
+
padding: 0;
|
|
9855
|
+
}
|
|
9856
|
+
`;
|
|
9836
9857
|
var PanelContent = (props) => {
|
|
9837
9858
|
const { queryInput, selectedSavedView, tableConfig } = props;
|
|
9838
9859
|
const { showToast } = (0, import_toast_alert2.useToastAlertContext)();
|
|
@@ -9875,42 +9896,54 @@ var PanelContent = (props) => {
|
|
|
9875
9896
|
}
|
|
9876
9897
|
});
|
|
9877
9898
|
};
|
|
9878
|
-
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(
|
|
9879
|
-
|
|
9899
|
+
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 || presetViews) && /* @__PURE__ */ import_react9.default.createElement(
|
|
9900
|
+
StyledMenuImperative,
|
|
9880
9901
|
{
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
|
|
9902
|
+
role: "listbox",
|
|
9903
|
+
onSelect: (selection) => {
|
|
9904
|
+
if (selectedSavedView?.id !== selection.item.id) {
|
|
9905
|
+
props.onSelect({ item: selection.item });
|
|
9906
|
+
}
|
|
9907
|
+
}
|
|
9884
9908
|
},
|
|
9885
|
-
/* @__PURE__ */ import_react9.default.createElement(
|
|
9886
|
-
|
|
9909
|
+
/* @__PURE__ */ import_react9.default.createElement(import_core_react7.MenuImperative.Options, null, temporaryView && /* @__PURE__ */ import_react9.default.createElement(
|
|
9910
|
+
Row,
|
|
9887
9911
|
{
|
|
9912
|
+
key: temporaryView.id,
|
|
9888
9913
|
item: temporaryView,
|
|
9889
9914
|
selected: isTemporarySelected,
|
|
9890
|
-
|
|
9891
|
-
enableSharingViews: false
|
|
9892
|
-
}
|
|
9893
|
-
)
|
|
9894
|
-
), presetViews.map((presetView) => {
|
|
9895
|
-
const isSelected = selectedSavedView?.id === presetView.id;
|
|
9896
|
-
return /* @__PURE__ */ import_react9.default.createElement(
|
|
9897
|
-
Row,
|
|
9898
|
-
{
|
|
9899
|
-
key: presetView.id,
|
|
9900
|
-
selected: isSelected,
|
|
9901
|
-
onClick: () => props.onSelect({ item: presetView }),
|
|
9902
|
-
ref: isSelected ? selectedRowRef : null
|
|
9915
|
+
ref: isTemporarySelected ? selectedRowRef : null
|
|
9903
9916
|
},
|
|
9904
9917
|
/* @__PURE__ */ import_react9.default.createElement(
|
|
9905
9918
|
SavedViewCollectionMenuItem,
|
|
9906
9919
|
{
|
|
9907
|
-
item:
|
|
9908
|
-
selected:
|
|
9909
|
-
|
|
9920
|
+
item: temporaryView,
|
|
9921
|
+
selected: isTemporarySelected,
|
|
9922
|
+
onClearTemporary: props.onClearTemporary,
|
|
9923
|
+
enableSharingViews: props.enableSharingViews
|
|
9910
9924
|
}
|
|
9911
9925
|
)
|
|
9912
|
-
)
|
|
9913
|
-
|
|
9926
|
+
), presetViews.map((presetView) => {
|
|
9927
|
+
const isSelected = selectedSavedView?.id === presetView.id;
|
|
9928
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
9929
|
+
Row,
|
|
9930
|
+
{
|
|
9931
|
+
key: presetView.id,
|
|
9932
|
+
item: presetView,
|
|
9933
|
+
selected: isSelected,
|
|
9934
|
+
ref: isSelected ? selectedRowRef : null
|
|
9935
|
+
},
|
|
9936
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
9937
|
+
SavedViewCollectionMenuItem,
|
|
9938
|
+
{
|
|
9939
|
+
item: presetView,
|
|
9940
|
+
selected: isSelected,
|
|
9941
|
+
enableSharingViews: props.enableSharingViews
|
|
9942
|
+
}
|
|
9943
|
+
)
|
|
9944
|
+
);
|
|
9945
|
+
}))
|
|
9946
|
+
), viewLevels.map((level) => {
|
|
9914
9947
|
const isExpanded = groups[level];
|
|
9915
9948
|
const views = isExpanded && savedViews ? savedViews.filter(
|
|
9916
9949
|
(view) => view.view_level === level && view.id !== "temporary"
|
|
@@ -9922,49 +9955,61 @@ var PanelContent = (props) => {
|
|
|
9922
9955
|
toggleGroup,
|
|
9923
9956
|
expanded: isExpanded
|
|
9924
9957
|
}
|
|
9925
|
-
), views.
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
9930
|
-
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
9958
|
+
), isExpanded && views.length > 0 && /* @__PURE__ */ import_react9.default.createElement(
|
|
9959
|
+
StyledMenuImperative,
|
|
9960
|
+
{
|
|
9961
|
+
id: `saved-views-collections-${level}`,
|
|
9962
|
+
role: "listbox",
|
|
9963
|
+
onSelect: (selection) => {
|
|
9964
|
+
if (selectedSavedView?.id !== selection.item.id) {
|
|
9965
|
+
props.onSelect({ item: selection.item });
|
|
9966
|
+
}
|
|
9967
|
+
}
|
|
9968
|
+
},
|
|
9969
|
+
/* @__PURE__ */ import_react9.default.createElement(import_core_react7.MenuImperative.Options, null, views.map((view) => {
|
|
9970
|
+
const isSelected = selectedSavedView?.id === view.id;
|
|
9971
|
+
const canUpdate = isSelected && hasPermissionForViewLevel(
|
|
9972
|
+
view.view_level,
|
|
9973
|
+
permissions
|
|
9974
|
+
) && !isEqual(
|
|
9975
|
+
view.table_config,
|
|
9976
|
+
tableConfig,
|
|
9977
|
+
props.defaultView.table_config,
|
|
9978
|
+
props.provider
|
|
9979
|
+
);
|
|
9980
|
+
const canEditOrDelete = isSelected && hasPermissionForViewLevel(view.view_level, permissions);
|
|
9981
|
+
return /* @__PURE__ */ import_react9.default.createElement(
|
|
9982
|
+
Row,
|
|
9947
9983
|
{
|
|
9948
|
-
item: view,
|
|
9949
9984
|
key: view.id,
|
|
9985
|
+
item: view,
|
|
9950
9986
|
selected: isSelected,
|
|
9951
|
-
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
|
|
9957
|
-
|
|
9958
|
-
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
|
|
9987
|
+
ref: isSelected ? selectedRowRef : null
|
|
9988
|
+
},
|
|
9989
|
+
/* @__PURE__ */ import_react9.default.createElement(
|
|
9990
|
+
SavedViewCollectionMenuItem,
|
|
9991
|
+
{
|
|
9992
|
+
item: view,
|
|
9993
|
+
key: view.id,
|
|
9994
|
+
selected: isSelected,
|
|
9995
|
+
canUpdate,
|
|
9996
|
+
canEditOrDelete,
|
|
9997
|
+
onUpdate: (data) => onUpdate(data),
|
|
9998
|
+
isUpdateProcessing: isUpdateLoading,
|
|
9999
|
+
onEdit: () => props.openModal("update" /* UPDATE */),
|
|
10000
|
+
onDelete: props.onDelete,
|
|
10001
|
+
permissions,
|
|
10002
|
+
enableSharingViews: props.enableSharingViews
|
|
10003
|
+
}
|
|
10004
|
+
)
|
|
10005
|
+
);
|
|
10006
|
+
}))
|
|
10007
|
+
));
|
|
9963
10008
|
})));
|
|
9964
10009
|
};
|
|
9965
10010
|
|
|
9966
10011
|
// src/components/saved-views/SavedViews.tsx
|
|
9967
|
-
var
|
|
10012
|
+
var import_core_react15 = require("@procore/core-react");
|
|
9968
10013
|
var import_react13 = __toESM(require("react"));
|
|
9969
10014
|
var import_react_query3 = require("@tanstack/react-query");
|
|
9970
10015
|
var import_toast_alert3 = require("@procore/toast-alert");
|
|
@@ -9997,8 +10042,8 @@ var SavedViewsDeleteConfirmationModalShared = ({
|
|
|
9997
10042
|
var import_react11 = __toESM(require("react"));
|
|
9998
10043
|
|
|
9999
10044
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
10000
|
-
var
|
|
10001
|
-
var
|
|
10045
|
+
var import_core_react10 = require("@procore/core-react");
|
|
10046
|
+
var React20 = __toESM(require("react"));
|
|
10002
10047
|
var yup = __toESM(require("yup"));
|
|
10003
10048
|
|
|
10004
10049
|
// src/components/modals/form-modal/FormModalBaseUtils.ts
|
|
@@ -10035,8 +10080,38 @@ function extractMessage(error, I18n) {
|
|
|
10035
10080
|
return { form: I18n.t("savedViews.modal.errors.unknown") };
|
|
10036
10081
|
}
|
|
10037
10082
|
|
|
10083
|
+
// src/components/modals/form-modal/NameInputField.tsx
|
|
10084
|
+
var import_core_react9 = require("@procore/core-react");
|
|
10085
|
+
var React19 = __toESM(require("react"));
|
|
10086
|
+
var NAME_INPUT_ID = "saved-view-form-name-input";
|
|
10087
|
+
var NameInputField = ({
|
|
10088
|
+
error,
|
|
10089
|
+
onResetMutations
|
|
10090
|
+
}) => {
|
|
10091
|
+
const I18n = (0, import_core_react9.useI18nContext)();
|
|
10092
|
+
const label = I18n.t("savedViews.modal.fields.name");
|
|
10093
|
+
const { errors: formErrors, submitCount } = (0, import_core_react9.useFormContext)();
|
|
10094
|
+
React19.useEffect(() => {
|
|
10095
|
+
if (submitCount > 0 && formErrors?.name) {
|
|
10096
|
+
document.getElementById(NAME_INPUT_ID)?.focus();
|
|
10097
|
+
}
|
|
10098
|
+
}, [formErrors?.name, submitCount]);
|
|
10099
|
+
return /* @__PURE__ */ React19.createElement(
|
|
10100
|
+
import_core_react9.Form.Text,
|
|
10101
|
+
{
|
|
10102
|
+
id: NAME_INPUT_ID,
|
|
10103
|
+
name: "name",
|
|
10104
|
+
error,
|
|
10105
|
+
placeholder: label,
|
|
10106
|
+
label,
|
|
10107
|
+
colWidth: 12,
|
|
10108
|
+
onChange: onResetMutations
|
|
10109
|
+
}
|
|
10110
|
+
);
|
|
10111
|
+
};
|
|
10112
|
+
|
|
10038
10113
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
10039
|
-
var { useEffect:
|
|
10114
|
+
var { useEffect: useEffect3, useRef: useRef2 } = React20;
|
|
10040
10115
|
var ScrollContainer = styled_components_esm_default("div")`
|
|
10041
10116
|
overflow: auto;
|
|
10042
10117
|
`;
|
|
@@ -10056,10 +10131,10 @@ var FormModalBase = ({
|
|
|
10056
10131
|
onSelect,
|
|
10057
10132
|
backend
|
|
10058
10133
|
}) => {
|
|
10059
|
-
const I18n = (0,
|
|
10134
|
+
const I18n = (0, import_core_react10.useI18nContext)();
|
|
10060
10135
|
const NAME_MAX_LENGTH = 150;
|
|
10061
10136
|
const originalBodyWidth = useRef2("");
|
|
10062
|
-
|
|
10137
|
+
useEffect3(() => {
|
|
10063
10138
|
if (open) {
|
|
10064
10139
|
originalBodyWidth.current = document.body.style.width || "";
|
|
10065
10140
|
document.body.style.width = "100%";
|
|
@@ -10130,24 +10205,17 @@ var FormModalBase = ({
|
|
|
10130
10205
|
I18n,
|
|
10131
10206
|
isProjectLevelTool
|
|
10132
10207
|
);
|
|
10133
|
-
return /* @__PURE__ */
|
|
10134
|
-
|
|
10208
|
+
return /* @__PURE__ */ React20.createElement(
|
|
10209
|
+
import_core_react10.Modal,
|
|
10135
10210
|
{
|
|
10136
|
-
"
|
|
10137
|
-
|
|
10211
|
+
howToClose: ["x", "scrim"],
|
|
10212
|
+
onClose,
|
|
10138
10213
|
open,
|
|
10139
|
-
|
|
10214
|
+
width: "md",
|
|
10140
10215
|
"data-testid": "create-update-modal"
|
|
10141
10216
|
},
|
|
10142
|
-
/* @__PURE__ */
|
|
10143
|
-
|
|
10144
|
-
{
|
|
10145
|
-
onClose,
|
|
10146
|
-
style: { borderBottom: `1px solid ${import_core_react9.colors.gray85}` }
|
|
10147
|
-
},
|
|
10148
|
-
/* @__PURE__ */ React19.createElement(import_core_react9.H2, null, header)
|
|
10149
|
-
), /* @__PURE__ */ React19.createElement(
|
|
10150
|
-
import_core_react9.Form,
|
|
10217
|
+
/* @__PURE__ */ React20.createElement(ScrollContainer, null, /* @__PURE__ */ React20.createElement(import_core_react10.Modal.Header, { style: { borderBottom: `1px solid ${import_core_react10.colors.gray85}` } }, /* @__PURE__ */ React20.createElement(import_core_react10.Modal.Heading, null, header)), /* @__PURE__ */ React20.createElement(
|
|
10218
|
+
import_core_react10.Form,
|
|
10151
10219
|
{
|
|
10152
10220
|
initialValues: {
|
|
10153
10221
|
name: initialName,
|
|
@@ -10172,30 +10240,26 @@ var FormModalBase = ({
|
|
|
10172
10240
|
onReset: onCancel,
|
|
10173
10241
|
validateOnChange: true
|
|
10174
10242
|
},
|
|
10175
|
-
/* @__PURE__ */
|
|
10176
|
-
|
|
10243
|
+
/* @__PURE__ */ React20.createElement(import_core_react10.Form.Form, { name: header }, /* @__PURE__ */ React20.createElement(
|
|
10244
|
+
import_core_react10.Modal.Body,
|
|
10177
10245
|
{
|
|
10178
|
-
style: { paddingTop: 0, paddingBottom: 0, marginTop:
|
|
10246
|
+
style: { paddingTop: 0, paddingBottom: 0, marginTop: import_core_react10.spacing.lg }
|
|
10179
10247
|
},
|
|
10180
|
-
errors && /* @__PURE__ */
|
|
10181
|
-
/* @__PURE__ */
|
|
10182
|
-
|
|
10248
|
+
errors && /* @__PURE__ */ React20.createElement(import_core_react10.ErrorBanner, { style: { marginBottom: import_core_react10.spacing.xl } }, /* @__PURE__ */ React20.createElement(import_core_react10.Banner.Content, null, /* @__PURE__ */ React20.createElement(import_core_react10.Banner.Title, null, I18n.t("savedViews.modal.errors.title", { mode })), /* @__PURE__ */ React20.createElement(import_core_react10.Banner.Body, null, errors?.form || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
|
|
10249
|
+
/* @__PURE__ */ React20.createElement(import_core_react10.Form.Row, null, /* @__PURE__ */ React20.createElement(
|
|
10250
|
+
NameInputField,
|
|
10183
10251
|
{
|
|
10184
|
-
name: "name",
|
|
10185
10252
|
error: errors?.name,
|
|
10186
|
-
|
|
10187
|
-
label: I18n.t("savedViews.modal.fields.name"),
|
|
10188
|
-
colWidth: 12,
|
|
10189
|
-
onChange: () => resetMutations()
|
|
10253
|
+
onResetMutations: resetMutations
|
|
10190
10254
|
}
|
|
10191
10255
|
)),
|
|
10192
|
-
/* @__PURE__ */
|
|
10193
|
-
|
|
10256
|
+
/* @__PURE__ */ React20.createElement(
|
|
10257
|
+
import_core_react10.Form.Row,
|
|
10194
10258
|
{
|
|
10195
|
-
style: { marginTop: errors?.name ?
|
|
10259
|
+
style: { marginTop: errors?.name ? import_core_react10.spacing.xl : import_core_react10.spacing.none }
|
|
10196
10260
|
},
|
|
10197
|
-
/* @__PURE__ */
|
|
10198
|
-
|
|
10261
|
+
/* @__PURE__ */ React20.createElement(
|
|
10262
|
+
import_core_react10.Form.TextArea,
|
|
10199
10263
|
{
|
|
10200
10264
|
name: "description",
|
|
10201
10265
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10205,8 +10269,8 @@ var FormModalBase = ({
|
|
|
10205
10269
|
}
|
|
10206
10270
|
)
|
|
10207
10271
|
),
|
|
10208
|
-
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */
|
|
10209
|
-
|
|
10272
|
+
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React20.createElement(import_core_react10.Form.Row, null, /* @__PURE__ */ React20.createElement(
|
|
10273
|
+
import_core_react10.Form.Select,
|
|
10210
10274
|
{
|
|
10211
10275
|
name: "view_level",
|
|
10212
10276
|
qa: { label: "view-level" },
|
|
@@ -10216,9 +10280,9 @@ var FormModalBase = ({
|
|
|
10216
10280
|
onSearch: false,
|
|
10217
10281
|
onClear: false
|
|
10218
10282
|
}
|
|
10219
|
-
)) : /* @__PURE__ */
|
|
10220
|
-
), /* @__PURE__ */
|
|
10221
|
-
|
|
10283
|
+
)) : /* @__PURE__ */ React20.createElement(React20.Fragment, null)
|
|
10284
|
+
), /* @__PURE__ */ React20.createElement(import_core_react10.Modal.Footer, { style: { borderTop: `1px solid ${import_core_react10.colors.gray85}` } }, /* @__PURE__ */ React20.createElement(import_core_react10.Flex, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React20.createElement(import_core_react10.Typography, { color: "gray45", italic: true }, /* @__PURE__ */ React20.createElement(import_core_react10.Typography, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React20.createElement(import_core_react10.Modal.FooterButtons, null, /* @__PURE__ */ React20.createElement(import_core_react10.Button, { type: "reset", variant: "tertiary", disabled: isLoading }, I18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React20.createElement(
|
|
10285
|
+
import_core_react10.Button,
|
|
10222
10286
|
{
|
|
10223
10287
|
"data-testid": "create-update-modal-button",
|
|
10224
10288
|
type: "submit",
|
|
@@ -10233,7 +10297,7 @@ var FormModalBase = ({
|
|
|
10233
10297
|
};
|
|
10234
10298
|
|
|
10235
10299
|
// src/components/modals/form-modal/FormModal.tsx
|
|
10236
|
-
var
|
|
10300
|
+
var import_core_react11 = require("@procore/core-react");
|
|
10237
10301
|
var FormModal = ({
|
|
10238
10302
|
open,
|
|
10239
10303
|
mode,
|
|
@@ -10247,7 +10311,7 @@ var FormModal = ({
|
|
|
10247
10311
|
defaultView,
|
|
10248
10312
|
backend
|
|
10249
10313
|
}) => {
|
|
10250
|
-
const i18n = (0,
|
|
10314
|
+
const i18n = (0, import_core_react11.useI18nContext)();
|
|
10251
10315
|
return /* @__PURE__ */ import_react11.default.createElement(
|
|
10252
10316
|
FormModalBase,
|
|
10253
10317
|
{
|
|
@@ -10270,8 +10334,8 @@ var FormModal = ({
|
|
|
10270
10334
|
};
|
|
10271
10335
|
|
|
10272
10336
|
// src/components/modals/form-modal/SharedViewFormModal.tsx
|
|
10273
|
-
var
|
|
10274
|
-
var
|
|
10337
|
+
var import_core_react12 = require("@procore/core-react");
|
|
10338
|
+
var React22 = __toESM(require("react"));
|
|
10275
10339
|
var yup2 = __toESM(require("yup"));
|
|
10276
10340
|
var SharedViewFormModal = ({
|
|
10277
10341
|
open,
|
|
@@ -10283,7 +10347,7 @@ var SharedViewFormModal = ({
|
|
|
10283
10347
|
isCreating,
|
|
10284
10348
|
resetCreateError
|
|
10285
10349
|
}) => {
|
|
10286
|
-
const I18n = (0,
|
|
10350
|
+
const I18n = (0, import_core_react12.useI18nContext)();
|
|
10287
10351
|
const NAME_MAX_LENGTH = 150;
|
|
10288
10352
|
const errors = extractMessage(createError, I18n);
|
|
10289
10353
|
const handleNameChange = () => {
|
|
@@ -10294,44 +10358,45 @@ var SharedViewFormModal = ({
|
|
|
10294
10358
|
const handleOnSubmit = (data) => {
|
|
10295
10359
|
onCreateView(data.name, data.description);
|
|
10296
10360
|
};
|
|
10297
|
-
return /* @__PURE__ */
|
|
10298
|
-
|
|
10361
|
+
return /* @__PURE__ */ React22.createElement(
|
|
10362
|
+
import_core_react12.Modal,
|
|
10299
10363
|
{
|
|
10300
10364
|
"data-testid": "shared-view-form-modal",
|
|
10301
10365
|
open,
|
|
10302
|
-
|
|
10366
|
+
howToClose: ["x", "scrim"],
|
|
10367
|
+
onClose,
|
|
10303
10368
|
style: { width: "540px" }
|
|
10304
10369
|
},
|
|
10305
|
-
/* @__PURE__ */
|
|
10306
|
-
|
|
10370
|
+
/* @__PURE__ */ React22.createElement(
|
|
10371
|
+
import_core_react12.Modal.Header,
|
|
10307
10372
|
{
|
|
10308
10373
|
onClose,
|
|
10309
10374
|
style: {
|
|
10310
|
-
paddingTop:
|
|
10311
|
-
paddingBottom:
|
|
10312
|
-
paddingLeft:
|
|
10313
|
-
paddingRight:
|
|
10375
|
+
paddingTop: import_core_react12.spacing.lg,
|
|
10376
|
+
paddingBottom: import_core_react12.spacing.xs,
|
|
10377
|
+
paddingLeft: import_core_react12.spacing.xl,
|
|
10378
|
+
paddingRight: import_core_react12.spacing.xl
|
|
10314
10379
|
}
|
|
10315
10380
|
},
|
|
10316
|
-
I18n.t("savedViews.modal.create.title")
|
|
10381
|
+
/* @__PURE__ */ React22.createElement(import_core_react12.Modal.Heading, null, I18n.t("savedViews.modal.create.title"))
|
|
10317
10382
|
),
|
|
10318
|
-
/* @__PURE__ */
|
|
10319
|
-
|
|
10383
|
+
/* @__PURE__ */ React22.createElement(
|
|
10384
|
+
import_core_react12.P,
|
|
10320
10385
|
{
|
|
10321
10386
|
style: {
|
|
10322
|
-
paddingLeft:
|
|
10323
|
-
paddingRight:
|
|
10324
|
-
paddingBottom:
|
|
10325
|
-
paddingTop:
|
|
10387
|
+
paddingLeft: import_core_react12.spacing.xl,
|
|
10388
|
+
paddingRight: import_core_react12.spacing.xl,
|
|
10389
|
+
paddingBottom: import_core_react12.spacing.lg,
|
|
10390
|
+
paddingTop: import_core_react12.spacing.none,
|
|
10326
10391
|
margin: 0,
|
|
10327
|
-
color:
|
|
10392
|
+
color: import_core_react12.colors.gray45,
|
|
10328
10393
|
whiteSpace: "pre-line"
|
|
10329
10394
|
}
|
|
10330
10395
|
},
|
|
10331
10396
|
I18n.t("savedViews.modal.copyConfirmation.description")
|
|
10332
10397
|
),
|
|
10333
|
-
/* @__PURE__ */
|
|
10334
|
-
|
|
10398
|
+
/* @__PURE__ */ React22.createElement(
|
|
10399
|
+
import_core_react12.Form,
|
|
10335
10400
|
{
|
|
10336
10401
|
initialValues: {
|
|
10337
10402
|
name: fetchedView.name,
|
|
@@ -10349,36 +10414,32 @@ var SharedViewFormModal = ({
|
|
|
10349
10414
|
onSubmit: handleOnSubmit,
|
|
10350
10415
|
validateOnChange: true
|
|
10351
10416
|
},
|
|
10352
|
-
/* @__PURE__ */
|
|
10353
|
-
|
|
10417
|
+
/* @__PURE__ */ React22.createElement(import_core_react12.Form.Form, { name: "share-view-form" }, /* @__PURE__ */ React22.createElement(
|
|
10418
|
+
import_core_react12.Modal.Body,
|
|
10354
10419
|
{
|
|
10355
10420
|
style: {
|
|
10356
|
-
paddingTop:
|
|
10421
|
+
paddingTop: import_core_react12.spacing.lg,
|
|
10357
10422
|
paddingBottom: 0,
|
|
10358
|
-
borderTop: `1px solid ${
|
|
10423
|
+
borderTop: `1px solid ${import_core_react12.colors.gray85}`
|
|
10359
10424
|
}
|
|
10360
10425
|
},
|
|
10361
|
-
errors && /* @__PURE__ */
|
|
10426
|
+
errors && /* @__PURE__ */ React22.createElement(import_core_react12.ErrorBanner, { style: { marginBottom: import_core_react12.spacing.xl } }, /* @__PURE__ */ React22.createElement(import_core_react12.Banner.Content, null, /* @__PURE__ */ React22.createElement(import_core_react12.Banner.Title, null, I18n.t("savedViews.modal.errors.title", {
|
|
10362
10427
|
mode: "create"
|
|
10363
|
-
})), /* @__PURE__ */
|
|
10364
|
-
/* @__PURE__ */
|
|
10365
|
-
|
|
10428
|
+
})), /* @__PURE__ */ React22.createElement(import_core_react12.Banner.Body, null, errors?.form || I18n.t("savedViews.modal.errors.description.create")))),
|
|
10429
|
+
/* @__PURE__ */ React22.createElement(import_core_react12.Form.Row, null, /* @__PURE__ */ React22.createElement(
|
|
10430
|
+
NameInputField,
|
|
10366
10431
|
{
|
|
10367
|
-
name: "name",
|
|
10368
10432
|
error: errors?.name,
|
|
10369
|
-
|
|
10370
|
-
label: I18n.t("savedViews.modal.fields.name"),
|
|
10371
|
-
colWidth: 12,
|
|
10372
|
-
onChange: handleNameChange
|
|
10433
|
+
onResetMutations: handleNameChange
|
|
10373
10434
|
}
|
|
10374
10435
|
)),
|
|
10375
|
-
/* @__PURE__ */
|
|
10376
|
-
|
|
10436
|
+
/* @__PURE__ */ React22.createElement(
|
|
10437
|
+
import_core_react12.Form.Row,
|
|
10377
10438
|
{
|
|
10378
|
-
style: { marginTop: errors?.name ?
|
|
10439
|
+
style: { marginTop: errors?.name ? import_core_react12.spacing.xl : import_core_react12.spacing.none }
|
|
10379
10440
|
},
|
|
10380
|
-
/* @__PURE__ */
|
|
10381
|
-
|
|
10441
|
+
/* @__PURE__ */ React22.createElement(
|
|
10442
|
+
import_core_react12.Form.TextArea,
|
|
10382
10443
|
{
|
|
10383
10444
|
name: "description",
|
|
10384
10445
|
placeholder: I18n.t("savedViews.modal.fields.description"),
|
|
@@ -10388,8 +10449,8 @@ var SharedViewFormModal = ({
|
|
|
10388
10449
|
}
|
|
10389
10450
|
)
|
|
10390
10451
|
)
|
|
10391
|
-
), /* @__PURE__ */
|
|
10392
|
-
|
|
10452
|
+
), /* @__PURE__ */ React22.createElement(import_core_react12.Modal.Footer, { style: { borderTop: `1px solid ${import_core_react12.colors.gray85}` } }, /* @__PURE__ */ React22.createElement(import_core_react12.Flex, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React22.createElement(import_core_react12.Typography, { color: "gray45", italic: true }, /* @__PURE__ */ React22.createElement(import_core_react12.Typography, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React22.createElement(import_core_react12.Modal.FooterButtons, null, /* @__PURE__ */ React22.createElement(
|
|
10453
|
+
import_core_react12.Button,
|
|
10393
10454
|
{
|
|
10394
10455
|
variant: "secondary",
|
|
10395
10456
|
onClick: onCreateTemporaryView,
|
|
@@ -10397,8 +10458,8 @@ var SharedViewFormModal = ({
|
|
|
10397
10458
|
disabled: isCreating
|
|
10398
10459
|
},
|
|
10399
10460
|
I18n.t("savedViews.actions.viewTemporarily")
|
|
10400
|
-
), /* @__PURE__ */
|
|
10401
|
-
|
|
10461
|
+
), /* @__PURE__ */ React22.createElement(
|
|
10462
|
+
import_core_react12.Button,
|
|
10402
10463
|
{
|
|
10403
10464
|
type: "submit",
|
|
10404
10465
|
variant: "primary",
|
|
@@ -10415,7 +10476,7 @@ var SharedViewFormModal = ({
|
|
|
10415
10476
|
// src/utils/hooks/useViewSelection.ts
|
|
10416
10477
|
var import_react12 = require("react");
|
|
10417
10478
|
var import_react_router_dom = require("react-router-dom");
|
|
10418
|
-
var
|
|
10479
|
+
var import_core_react13 = require("@procore/core-react");
|
|
10419
10480
|
|
|
10420
10481
|
// src/utils/viewStorage.ts
|
|
10421
10482
|
var ViewStorage = {
|
|
@@ -10478,7 +10539,7 @@ var restoreUrlParameter = (currentParam, previousParam, setSearchParams) => {
|
|
|
10478
10539
|
}
|
|
10479
10540
|
};
|
|
10480
10541
|
var useViewSelection = (config, savedViews, presetViews, openSharedViewModal) => {
|
|
10481
|
-
const I18n = (0,
|
|
10542
|
+
const I18n = (0, import_core_react13.useI18nContext)();
|
|
10482
10543
|
const projectIdSegment = config.projectId ?? "company";
|
|
10483
10544
|
const storageKey = `savedView_${config.domain}_${config.tableName}_${config.companyId}_${projectIdSegment}_${config.userId}`;
|
|
10484
10545
|
const temporaryStorageKey = `${storageKey}-temporary`;
|
|
@@ -10585,7 +10646,7 @@ var import_react_query2 = require("@tanstack/react-query");
|
|
|
10585
10646
|
// src/utils/api/queriesHandler.ts
|
|
10586
10647
|
var import_core_http = require("@procore/core-http");
|
|
10587
10648
|
var import_react_query = require("@tanstack/react-query");
|
|
10588
|
-
var
|
|
10649
|
+
var import_core_react14 = require("@procore/core-react");
|
|
10589
10650
|
var getBasePath = (companyId, projectId) => {
|
|
10590
10651
|
if (projectId) {
|
|
10591
10652
|
return `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views`;
|
|
@@ -10595,7 +10656,7 @@ var getBasePath = (companyId, projectId) => {
|
|
|
10595
10656
|
var useApiRequest = (props, method, mutationKey) => {
|
|
10596
10657
|
const { projectId, companyId, domain, tableName } = props;
|
|
10597
10658
|
const queryClient2 = (0, import_react_query.useQueryClient)();
|
|
10598
|
-
const { locale } = (0,
|
|
10659
|
+
const { locale } = (0, import_core_react14.useI18nContext)();
|
|
10599
10660
|
const basePath = getBasePath(companyId, projectId);
|
|
10600
10661
|
const queryKey = ["savedViews", domain, tableName, companyId, projectId];
|
|
10601
10662
|
return (0, import_react_query.useMutation)({
|
|
@@ -10742,7 +10803,7 @@ var SavedViewsContent = (props) => {
|
|
|
10742
10803
|
const { data: savedViews } = backend.useSavedViewsQuery(queryInput);
|
|
10743
10804
|
const { mutate: deleteSavedView } = backend.useDeleteSavedView(queryInput);
|
|
10744
10805
|
const { showToast } = (0, import_toast_alert3.useToastAlertContext)();
|
|
10745
|
-
const i18n = (0,
|
|
10806
|
+
const i18n = (0, import_core_react15.useI18nContext)();
|
|
10746
10807
|
const [activeModal, setActiveModal] = (0, import_react13.useState)(null);
|
|
10747
10808
|
const [modalData, setModalData] = (0, import_react13.useState)(null);
|
|
10748
10809
|
const openModal = (type, data) => {
|
|
@@ -10842,14 +10903,28 @@ var SavedViewsContent = (props) => {
|
|
|
10842
10903
|
"data-testid": "saved-view-expanded-panel",
|
|
10843
10904
|
provider: props.provider
|
|
10844
10905
|
},
|
|
10845
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10846
|
-
|
|
10906
|
+
/* @__PURE__ */ import_react13.default.createElement(import_core_react15.Panel.Header, { id: "saved-views-collections-panel-header" }, /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Panel.Title, null, /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Flex, { alignItems: "center" }, /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Box, { paddingRight: "sm" }, i18n.t("savedViews.title")), /* @__PURE__ */ import_react13.default.createElement(
|
|
10907
|
+
import_core_react15.Tooltip,
|
|
10908
|
+
{
|
|
10909
|
+
showDelay: 200,
|
|
10910
|
+
overlay: /* @__PURE__ */ import_react13.default.createElement(import_core_react15.Tooltip.Content, null, i18n.t("savedViews.tooltip"))
|
|
10911
|
+
},
|
|
10912
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
10913
|
+
Help_default,
|
|
10914
|
+
{
|
|
10915
|
+
tabIndex: 0,
|
|
10916
|
+
size: "sm",
|
|
10917
|
+
"aria-label": i18n.t("savedViews.tooltip")
|
|
10918
|
+
}
|
|
10919
|
+
)
|
|
10920
|
+
))), /* @__PURE__ */ import_react13.default.createElement(
|
|
10921
|
+
import_core_react15.Tooltip,
|
|
10847
10922
|
{
|
|
10848
10923
|
overlay: i18n.t("savedViews.actions.create"),
|
|
10849
10924
|
showDelay: 1e3
|
|
10850
10925
|
},
|
|
10851
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10852
|
-
|
|
10926
|
+
/* @__PURE__ */ import_react13.default.createElement(
|
|
10927
|
+
import_core_react15.Button,
|
|
10853
10928
|
{
|
|
10854
10929
|
icon: /* @__PURE__ */ import_react13.default.createElement(Plus_default, null),
|
|
10855
10930
|
variant: "secondary",
|
|
@@ -10858,9 +10933,9 @@ var SavedViewsContent = (props) => {
|
|
|
10858
10933
|
"aria-label": i18n.t("savedViews.actions.create")
|
|
10859
10934
|
},
|
|
10860
10935
|
i18n.t("savedViews.actions.create")
|
|
10861
|
-
)
|
|
10936
|
+
)
|
|
10862
10937
|
)),
|
|
10863
|
-
/* @__PURE__ */ import_react13.default.createElement(
|
|
10938
|
+
/* @__PURE__ */ import_react13.default.createElement(import_core_react15.Panel.Body, { style: { display: "flex", flexFlow: "column" } }, /* @__PURE__ */ import_react13.default.createElement(
|
|
10864
10939
|
PanelContent,
|
|
10865
10940
|
{
|
|
10866
10941
|
onSelect: ({ item }) => selectView(item),
|
|
@@ -10873,9 +10948,10 @@ var SavedViewsContent = (props) => {
|
|
|
10873
10948
|
presetViews: props.presetViews,
|
|
10874
10949
|
savedViews: allViews,
|
|
10875
10950
|
provider: props.provider,
|
|
10876
|
-
userId: props.userId
|
|
10951
|
+
userId: props.userId,
|
|
10877
10952
|
onClearTemporary: clearTemporaryView,
|
|
10878
|
-
backend
|
|
10953
|
+
backend,
|
|
10954
|
+
enableSharingViews: props.enableSharingViews
|
|
10879
10955
|
}
|
|
10880
10956
|
))
|
|
10881
10957
|
), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */ import_react13.default.createElement(
|
|
@@ -11096,7 +11172,8 @@ var SmartGridSavedViews = (props) => {
|
|
|
11096
11172
|
presetViews,
|
|
11097
11173
|
tableName: props.tableName,
|
|
11098
11174
|
tableConfig,
|
|
11099
|
-
backend: props.backend
|
|
11175
|
+
backend: props.backend,
|
|
11176
|
+
enableSharingViews: props.enableSharingViews
|
|
11100
11177
|
}
|
|
11101
11178
|
);
|
|
11102
11179
|
};
|
|
@@ -11209,7 +11286,8 @@ var DataTableSavedViews = (0, import_react18.forwardRef)((props, ref) => {
|
|
|
11209
11286
|
defaultView,
|
|
11210
11287
|
presetViews,
|
|
11211
11288
|
tableName: props.tableName,
|
|
11212
|
-
tableConfig: internalTableConfig
|
|
11289
|
+
tableConfig: internalTableConfig,
|
|
11290
|
+
enableSharingViews: props.enableSharingViews
|
|
11213
11291
|
}
|
|
11214
11292
|
);
|
|
11215
11293
|
});
|