@procore/saved-views 6.0.2 → 6.2.0
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 +13 -2
- package/dist/legacy/adapters/hub-data-loader.d.mts +22 -0
- package/dist/legacy/adapters/hub-data-loader.d.ts +22 -0
- package/dist/legacy/adapters/hub-data-loader.js +273 -0
- package/dist/legacy/adapters/hub-data-loader.mjs +273 -0
- package/dist/legacy/chunk-6DZX6EAA.mjs +37 -0
- package/dist/legacy/chunk-QGM4M3NI.js +37 -0
- package/dist/legacy/index.d.mts +22 -3
- package/dist/legacy/index.d.ts +22 -3
- package/dist/legacy/index.js +755 -487
- package/dist/legacy/index.mjs +493 -268
- package/dist/legacy/transport/default.d.mts +15 -0
- package/dist/legacy/transport/default.d.ts +15 -0
- package/dist/legacy/transport/default.js +104 -0
- package/dist/legacy/transport/default.mjs +104 -0
- package/dist/legacy/types-BWhJ-on3.d.mts +109 -0
- package/dist/legacy/types-BWhJ-on3.d.ts +109 -0
- package/dist/modern/adapters/hub-data-loader.d.mts +22 -0
- package/dist/modern/adapters/hub-data-loader.d.ts +22 -0
- package/dist/modern/adapters/hub-data-loader.js +270 -0
- package/dist/modern/adapters/hub-data-loader.mjs +270 -0
- package/dist/modern/chunk-6DZX6EAA.mjs +37 -0
- package/dist/modern/chunk-QGM4M3NI.js +37 -0
- package/dist/modern/index.d.mts +22 -3
- package/dist/modern/index.d.ts +22 -3
- package/dist/modern/index.js +807 -540
- package/dist/modern/index.mjs +492 -268
- package/dist/modern/transport/default.d.mts +15 -0
- package/dist/modern/transport/default.d.ts +15 -0
- package/dist/modern/transport/default.js +104 -0
- package/dist/modern/transport/default.mjs +104 -0
- package/dist/modern/types-BWhJ-on3.d.mts +109 -0
- package/dist/modern/types-BWhJ-on3.d.ts +109 -0
- package/package.json +35 -2
package/dist/legacy/index.mjs
CHANGED
|
@@ -1,34 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
|
|
8
|
-
get: (a2, b2) => (typeof require !== "undefined" ? require : a2)[b2]
|
|
9
|
-
}) : x2)(function(x2) {
|
|
10
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
-
throw Error('Dynamic require of "' + x2 + '" is not supported');
|
|
12
|
-
});
|
|
13
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
-
};
|
|
16
|
-
var __copyProps = (to, from2, except, desc) => {
|
|
17
|
-
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
|
|
18
|
-
for (let key of __getOwnPropNames(from2))
|
|
19
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
-
__defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
-
mod
|
|
31
|
-
));
|
|
1
|
+
import {
|
|
2
|
+
__commonJS,
|
|
3
|
+
__require,
|
|
4
|
+
__toESM
|
|
5
|
+
} from "./chunk-6DZX6EAA.mjs";
|
|
32
6
|
|
|
33
7
|
// node_modules/lodash/lodash.js
|
|
34
8
|
var require_lodash = __commonJS({
|
|
@@ -738,7 +712,7 @@ var require_lodash = __commonJS({
|
|
|
738
712
|
var reIsNative = RegExp2(
|
|
739
713
|
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
740
714
|
);
|
|
741
|
-
var
|
|
715
|
+
var Buffer = moduleExports ? context.Buffer : undefined2, Symbol2 = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined2, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined2, symIterator = Symbol2 ? Symbol2.iterator : undefined2, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined2;
|
|
742
716
|
var defineProperty = (function() {
|
|
743
717
|
try {
|
|
744
718
|
var func = getNative(Object2, "defineProperty");
|
|
@@ -748,7 +722,7 @@ var require_lodash = __commonJS({
|
|
|
748
722
|
}
|
|
749
723
|
})();
|
|
750
724
|
var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
|
|
751
|
-
var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer =
|
|
725
|
+
var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined2, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
|
|
752
726
|
var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
|
|
753
727
|
var metaMap = WeakMap2 && new WeakMap2();
|
|
754
728
|
var realNames = {};
|
|
@@ -2060,7 +2034,7 @@ var require_lodash = __commonJS({
|
|
|
2060
2034
|
}
|
|
2061
2035
|
function cloneArrayBuffer(arrayBuffer) {
|
|
2062
2036
|
var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
2063
|
-
new
|
|
2037
|
+
new Uint8Array(result2).set(new Uint8Array(arrayBuffer));
|
|
2064
2038
|
return result2;
|
|
2065
2039
|
}
|
|
2066
2040
|
function cloneDataView(dataView, isDeep) {
|
|
@@ -2664,7 +2638,7 @@ var require_lodash = __commonJS({
|
|
|
2664
2638
|
object3 = object3.buffer;
|
|
2665
2639
|
other = other.buffer;
|
|
2666
2640
|
case arrayBufferTag:
|
|
2667
|
-
if (object3.byteLength != other.byteLength || !equalFunc(new
|
|
2641
|
+
if (object3.byteLength != other.byteLength || !equalFunc(new Uint8Array(object3), new Uint8Array(other))) {
|
|
2668
2642
|
return false;
|
|
2669
2643
|
}
|
|
2670
2644
|
return true;
|
|
@@ -5543,7 +5517,15 @@ var de_DE_default = {
|
|
|
5543
5517
|
title: "Gespeicherte Ansichten",
|
|
5544
5518
|
tooltip: "Erstellen und speichern Sie ein benutzerdefiniertes Tabellenlayout, um schnell zu Ihrer bevorzugten Ansicht zur\xFCckzukehren.",
|
|
5545
5519
|
button: {
|
|
5546
|
-
title: "Ansichten"
|
|
5520
|
+
title: "Ansichten",
|
|
5521
|
+
titleWithView: "Ansicht: {{name}} ({{type}})",
|
|
5522
|
+
viewLevel: {
|
|
5523
|
+
company: "Unternehmen",
|
|
5524
|
+
project: "Projekt",
|
|
5525
|
+
personal: "Pers\xF6nlich",
|
|
5526
|
+
default: "Standard",
|
|
5527
|
+
temporary: "Vor\xFCbergehend"
|
|
5528
|
+
}
|
|
5547
5529
|
},
|
|
5548
5530
|
actions: {
|
|
5549
5531
|
update: "Aktualisieren",
|
|
@@ -5638,7 +5620,15 @@ var en_AU_default = {
|
|
|
5638
5620
|
title: "Saved views",
|
|
5639
5621
|
tooltip: "Create and save any custom table layout to quickly return to your preferred view.",
|
|
5640
5622
|
button: {
|
|
5641
|
-
title: "Views"
|
|
5623
|
+
title: "Views",
|
|
5624
|
+
titleWithView: "View: {{name}} ({{type}})",
|
|
5625
|
+
viewLevel: {
|
|
5626
|
+
company: "Company",
|
|
5627
|
+
project: "Project",
|
|
5628
|
+
personal: "Personal",
|
|
5629
|
+
default: "Default",
|
|
5630
|
+
temporary: "Temporary"
|
|
5631
|
+
}
|
|
5642
5632
|
},
|
|
5643
5633
|
actions: {
|
|
5644
5634
|
update: "Update",
|
|
@@ -5733,7 +5723,15 @@ var en_CA_default = {
|
|
|
5733
5723
|
title: "Saved views",
|
|
5734
5724
|
tooltip: "Create and save any custom table layout to quickly return to your preferred view.",
|
|
5735
5725
|
button: {
|
|
5736
|
-
title: "Views"
|
|
5726
|
+
title: "Views",
|
|
5727
|
+
titleWithView: "View: {{name}} ({{type}})",
|
|
5728
|
+
viewLevel: {
|
|
5729
|
+
company: "Company",
|
|
5730
|
+
project: "Project",
|
|
5731
|
+
personal: "Personal",
|
|
5732
|
+
default: "Default",
|
|
5733
|
+
temporary: "Temporary"
|
|
5734
|
+
}
|
|
5737
5735
|
},
|
|
5738
5736
|
actions: {
|
|
5739
5737
|
update: "Update",
|
|
@@ -5828,7 +5826,15 @@ var en_GB_default = {
|
|
|
5828
5826
|
title: "Saved views",
|
|
5829
5827
|
tooltip: "Create and save any custom table layout to quickly return to your preferred view.",
|
|
5830
5828
|
button: {
|
|
5831
|
-
title: "Views"
|
|
5829
|
+
title: "Views",
|
|
5830
|
+
titleWithView: "View: {{name}} ({{type}})",
|
|
5831
|
+
viewLevel: {
|
|
5832
|
+
company: "Company",
|
|
5833
|
+
project: "Project",
|
|
5834
|
+
personal: "Personal",
|
|
5835
|
+
default: "Default",
|
|
5836
|
+
temporary: "Temporary"
|
|
5837
|
+
}
|
|
5832
5838
|
},
|
|
5833
5839
|
actions: {
|
|
5834
5840
|
update: "Update",
|
|
@@ -5923,7 +5929,15 @@ var en_default = {
|
|
|
5923
5929
|
title: "Saved Views",
|
|
5924
5930
|
tooltip: "Create and save any custom table layout to quickly return to your preferred view.",
|
|
5925
5931
|
button: {
|
|
5926
|
-
title: "Views"
|
|
5932
|
+
title: "Views",
|
|
5933
|
+
titleWithView: "View: {{name}} ({{type}})",
|
|
5934
|
+
viewLevel: {
|
|
5935
|
+
company: "Company",
|
|
5936
|
+
project: "Project",
|
|
5937
|
+
personal: "Personal",
|
|
5938
|
+
default: "Default",
|
|
5939
|
+
temporary: "Temporary"
|
|
5940
|
+
}
|
|
5927
5941
|
},
|
|
5928
5942
|
actions: {
|
|
5929
5943
|
update: "Update",
|
|
@@ -6018,7 +6032,15 @@ var es_ES_default = {
|
|
|
6018
6032
|
title: "Vistas guardadas",
|
|
6019
6033
|
tooltip: "Cree y guarde un dise\xF1o de tabla personalizado para volver r\xE1pidamente a su vista preferida.",
|
|
6020
6034
|
button: {
|
|
6021
|
-
title: "Vistas"
|
|
6035
|
+
title: "Vistas",
|
|
6036
|
+
titleWithView: "Ver: {{name}} ({{type}})",
|
|
6037
|
+
viewLevel: {
|
|
6038
|
+
company: "Empresa",
|
|
6039
|
+
project: "Proyecto",
|
|
6040
|
+
personal: "Personal",
|
|
6041
|
+
default: "Predeterminado",
|
|
6042
|
+
temporary: "Temporal"
|
|
6043
|
+
}
|
|
6022
6044
|
},
|
|
6023
6045
|
actions: {
|
|
6024
6046
|
update: "Actualizar",
|
|
@@ -6050,7 +6072,7 @@ var es_ES_default = {
|
|
|
6050
6072
|
fields: {
|
|
6051
6073
|
name: "Nombre",
|
|
6052
6074
|
description: "Descripci\xF3n",
|
|
6053
|
-
viewLevel: "
|
|
6075
|
+
viewLevel: "Nivel de vista",
|
|
6054
6076
|
viewLevels: {
|
|
6055
6077
|
company: "Vista de la empresa",
|
|
6056
6078
|
project: "Vista del proyecto",
|
|
@@ -6100,7 +6122,7 @@ var es_ES_default = {
|
|
|
6100
6122
|
temporaryViewName: "Vista temporal",
|
|
6101
6123
|
viewLevel: {
|
|
6102
6124
|
company: "Vistas de la empresa",
|
|
6103
|
-
project: "Vistas
|
|
6125
|
+
project: "Vistas del proyecto",
|
|
6104
6126
|
personal: "Vistas personales"
|
|
6105
6127
|
}
|
|
6106
6128
|
}
|
|
@@ -6113,7 +6135,15 @@ var es_default = {
|
|
|
6113
6135
|
title: "Vistas guardadas",
|
|
6114
6136
|
tooltip: "Cree y guarde cualquier dise\xF1o de tabla personalizado para volver r\xE1pidamente a su vista preferida.",
|
|
6115
6137
|
button: {
|
|
6116
|
-
title: "Vistas"
|
|
6138
|
+
title: "Vistas",
|
|
6139
|
+
titleWithView: "Vista: {{name}} ({{type}})",
|
|
6140
|
+
viewLevel: {
|
|
6141
|
+
company: "Compa\xF1\xEDa",
|
|
6142
|
+
project: "Proyecto",
|
|
6143
|
+
personal: "Personal",
|
|
6144
|
+
default: "Predeterminado",
|
|
6145
|
+
temporary: "Temporal"
|
|
6146
|
+
}
|
|
6117
6147
|
},
|
|
6118
6148
|
actions: {
|
|
6119
6149
|
update: "Actualizar",
|
|
@@ -6208,7 +6238,15 @@ var fr_CA_default = {
|
|
|
6208
6238
|
title: "Affichages sauvegard\xE9s",
|
|
6209
6239
|
tooltip: "Cr\xE9ez et sauvegardez n'importe quelle disposition de tableau personnalis\xE9e pour revenir rapidement \xE0 votre affichage pr\xE9f\xE9r\xE9.",
|
|
6210
6240
|
button: {
|
|
6211
|
-
title: "Affichages"
|
|
6241
|
+
title: "Affichages",
|
|
6242
|
+
titleWithView: "Affichage\xA0: {{name}} ({{type}})",
|
|
6243
|
+
viewLevel: {
|
|
6244
|
+
company: "Entreprise",
|
|
6245
|
+
project: "Projet",
|
|
6246
|
+
personal: "Personnel",
|
|
6247
|
+
default: "Par d\xE9faut",
|
|
6248
|
+
temporary: "Temporaire"
|
|
6249
|
+
}
|
|
6212
6250
|
},
|
|
6213
6251
|
actions: {
|
|
6214
6252
|
update: "Mettre \xE0 jour",
|
|
@@ -6235,7 +6273,7 @@ var fr_CA_default = {
|
|
|
6235
6273
|
description: "Cet affichage ne peut pas \xEAtre restaur\xE9 une fois qu'il a \xE9t\xE9 supprim\xE9."
|
|
6236
6274
|
},
|
|
6237
6275
|
copyConfirmation: {
|
|
6238
|
-
description: "Vous avez coll\xE9 un lien vers
|
|
6276
|
+
description: "Vous avez coll\xE9 un lien vers un affichage sauvegard\xE9 qui n'existe pas encore pour vous.\nVous pouvez le cr\xE9er comme affichage personnel sauvegard\xE9 ou simplement le consulter\ntemporairement."
|
|
6239
6277
|
},
|
|
6240
6278
|
fields: {
|
|
6241
6279
|
name: "Nom",
|
|
@@ -6250,9 +6288,9 @@ var fr_CA_default = {
|
|
|
6250
6288
|
errors: {
|
|
6251
6289
|
maxLengthName: "Ne peut pas contenir plus de {{maxLength}}\xA0caract\xE8res.",
|
|
6252
6290
|
required: "Ne peut pas \xEAtre vide.",
|
|
6253
|
-
duplicateName: "Un affichage
|
|
6291
|
+
duplicateName: "Un affichage sauvegard\xE9 portant ce nom existe d\xE9j\xE0. Veuillez renommer et r\xE9essayer.",
|
|
6254
6292
|
unknown: "Une erreur s'est produite. Veuillez r\xE9essayer.",
|
|
6255
|
-
title: "D\xE9sol\xE9, nous n'avons pas pu {{mode}} cet affichage
|
|
6293
|
+
title: "D\xE9sol\xE9, nous n'avons pas pu {{mode}} cet affichage sauvegard\xE9",
|
|
6256
6294
|
description: {
|
|
6257
6295
|
create: "Veuillez corriger les erreurs ci-dessous et r\xE9essayer de le cr\xE9er",
|
|
6258
6296
|
update: "Veuillez corriger les erreurs ci-dessous et r\xE9essayer de le mettre \xE0 jour"
|
|
@@ -6263,8 +6301,8 @@ var fr_CA_default = {
|
|
|
6263
6301
|
}
|
|
6264
6302
|
},
|
|
6265
6303
|
ariaLabels: {
|
|
6266
|
-
menuItem: "
|
|
6267
|
-
modal: "Modal pour cr\xE9er/mettre \xE0 jour les affichages
|
|
6304
|
+
menuItem: "Item du menu Affichages sauvegard\xE9s {{name}}",
|
|
6305
|
+
modal: "Modal pour cr\xE9er/mettre \xE0 jour les affichages sauvegard\xE9s"
|
|
6268
6306
|
},
|
|
6269
6307
|
update: {
|
|
6270
6308
|
success: "L'affichage sauvegard\xE9 a bien \xE9t\xE9 mis \xE0 jour."
|
|
@@ -6276,12 +6314,12 @@ var fr_CA_default = {
|
|
|
6276
6314
|
success: "Le lien a \xE9t\xE9 cr\xE9\xE9 et copi\xE9 dans le presse-papiers."
|
|
6277
6315
|
},
|
|
6278
6316
|
errors: {
|
|
6279
|
-
fetch: "D\xE9sol\xE9, les affichages
|
|
6280
|
-
create: "D\xE9sol\xE9, l'affichage
|
|
6281
|
-
update: "D\xE9sol\xE9, l'affichage
|
|
6282
|
-
delete: "D\xE9sol\xE9, l'affichage
|
|
6317
|
+
fetch: "D\xE9sol\xE9, les affichages sauvegard\xE9s n'ont pas pu \xEAtre r\xE9cup\xE9r\xE9s. Veuillez r\xE9essayer.",
|
|
6318
|
+
create: "D\xE9sol\xE9, l'affichage sauvegard\xE9 n'a pas pu \xEAtre cr\xE9\xE9. Veuillez r\xE9essayer.",
|
|
6319
|
+
update: "D\xE9sol\xE9, l'affichage sauvegard\xE9 n'a pas pu \xEAtre mis \xE0 jour. Veuillez r\xE9essayer.",
|
|
6320
|
+
delete: "D\xE9sol\xE9, l'affichage sauvegard\xE9 n'a pas pu \xEAtre supprim\xE9. Veuillez r\xE9essayer.",
|
|
6283
6321
|
copyFailed: "Impossible de copier le lien de partage dans le presse-papiers.",
|
|
6284
|
-
notFound: "D\xE9sol\xE9, l'affichage
|
|
6322
|
+
notFound: "D\xE9sol\xE9, l'affichage sauvegard\xE9 est introuvable. Veuillez r\xE9essayer."
|
|
6285
6323
|
},
|
|
6286
6324
|
defaultViewTitle: {
|
|
6287
6325
|
rfi: "Toutes les QRT",
|
|
@@ -6303,7 +6341,15 @@ var fr_FR_default = {
|
|
|
6303
6341
|
title: "Vues enregistr\xE9es",
|
|
6304
6342
|
tooltip: "Cr\xE9ez et enregistrez n'importe quelle disposition de tableau personnalis\xE9e pour revenir rapidement \xE0 votre vue pr\xE9f\xE9r\xE9e.",
|
|
6305
6343
|
button: {
|
|
6306
|
-
title: "Vues"
|
|
6344
|
+
title: "Vues",
|
|
6345
|
+
titleWithView: "Affichage\xA0: {{name}} ({{type}})",
|
|
6346
|
+
viewLevel: {
|
|
6347
|
+
company: "Entreprise",
|
|
6348
|
+
project: "Projet",
|
|
6349
|
+
personal: "Personnelle",
|
|
6350
|
+
default: "Par d\xE9faut",
|
|
6351
|
+
temporary: "Temporaire"
|
|
6352
|
+
}
|
|
6307
6353
|
},
|
|
6308
6354
|
actions: {
|
|
6309
6355
|
update: "Mettre \xE0 jour",
|
|
@@ -6398,7 +6444,15 @@ var is_IS_default = {
|
|
|
6398
6444
|
title: "Vista\xF0ar sko\xF0anir",
|
|
6399
6445
|
tooltip: "B\xFA\xF0u til og vista\xF0u s\xE9rsni\xF0na t\xF6fluuppsetningu til a\xF0 fara flj\xF3tt aftur \xED valinn s\xFDn.",
|
|
6400
6446
|
button: {
|
|
6401
|
-
title: "\xDAts\xFDni"
|
|
6447
|
+
title: "\xDAts\xFDni",
|
|
6448
|
+
titleWithView: "Sko\xF0a: {{name}} ({{type}})",
|
|
6449
|
+
viewLevel: {
|
|
6450
|
+
company: "Fyrirt\xE6ki",
|
|
6451
|
+
project: "Verkefni",
|
|
6452
|
+
personal: "Pers\xF3nulegt",
|
|
6453
|
+
default: "Sj\xE1lfgefi\xF0",
|
|
6454
|
+
temporary: "T\xEDmabundi\xF0"
|
|
6455
|
+
}
|
|
6402
6456
|
},
|
|
6403
6457
|
actions: {
|
|
6404
6458
|
update: "Uppf\xE6rsla",
|
|
@@ -6493,7 +6547,15 @@ var it_IT_default = {
|
|
|
6493
6547
|
title: "Viste salvate",
|
|
6494
6548
|
tooltip: "Creare e salvare qualsiasi layout di tabella personalizzato per tornare rapidamente alla vista preferita.",
|
|
6495
6549
|
button: {
|
|
6496
|
-
title: "Viste"
|
|
6550
|
+
title: "Viste",
|
|
6551
|
+
titleWithView: "Visualizza: {{name}} ({{type}})",
|
|
6552
|
+
viewLevel: {
|
|
6553
|
+
company: "Azienda",
|
|
6554
|
+
project: "Progetto",
|
|
6555
|
+
personal: "Personale",
|
|
6556
|
+
default: "Predefinita",
|
|
6557
|
+
temporary: "Temporaneo"
|
|
6558
|
+
}
|
|
6497
6559
|
},
|
|
6498
6560
|
actions: {
|
|
6499
6561
|
update: "Aggiorna",
|
|
@@ -6588,7 +6650,15 @@ var ja_JP_default = {
|
|
|
6588
6650
|
title: "\u4FDD\u5B58\u6E08\u307F\u30D3\u30E5\u30FC",
|
|
6589
6651
|
tooltip: "\u4EFB\u610F\u306E\u30AB\u30B9\u30BF\u30E0 \u30C6\u30FC\u30D6\u30EB \u30EC\u30A4\u30A2\u30A6\u30C8\u3092\u4F5C\u6210\u3057\u3066\u4FDD\u5B58\u3057\u3001\u3059\u3070\u3084\u304F\u597D\u307F\u306E\u30D3\u30E5\u30FC\u306B\u623B\u305B\u307E\u3059\u3002",
|
|
6590
6652
|
button: {
|
|
6591
|
-
title: "\u30D3\u30E5\u30FC"
|
|
6653
|
+
title: "\u30D3\u30E5\u30FC",
|
|
6654
|
+
titleWithView: "\u30D3\u30E5\u30FC: {{name}} ({{type}})",
|
|
6655
|
+
viewLevel: {
|
|
6656
|
+
company: "\u4F1A\u793E",
|
|
6657
|
+
project: "\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8",
|
|
6658
|
+
personal: "\u500B\u4EBA\u7528",
|
|
6659
|
+
default: "\u65E2\u5B9A\u306E",
|
|
6660
|
+
temporary: "\u4E00\u6642\u7684"
|
|
6661
|
+
}
|
|
6592
6662
|
},
|
|
6593
6663
|
actions: {
|
|
6594
6664
|
update: "\u66F4\u65B0",
|
|
@@ -6683,7 +6753,15 @@ var pl_PL_default = {
|
|
|
6683
6753
|
title: "Zapisane widoki",
|
|
6684
6754
|
tooltip: "Utw\xF3rz i zapisz dowolny uk\u0142ad niestandardowej tabeli, aby szybko wr\xF3ci\u0107 do preferowanego widoku.",
|
|
6685
6755
|
button: {
|
|
6686
|
-
title: "Widoki"
|
|
6756
|
+
title: "Widoki",
|
|
6757
|
+
titleWithView: "Widok: {{name}} ({{type}})",
|
|
6758
|
+
viewLevel: {
|
|
6759
|
+
company: "Firma",
|
|
6760
|
+
project: "Projekt",
|
|
6761
|
+
personal: "Osobiste",
|
|
6762
|
+
default: "Domy\u015Blne",
|
|
6763
|
+
temporary: "Tymczasowe"
|
|
6764
|
+
}
|
|
6687
6765
|
},
|
|
6688
6766
|
actions: {
|
|
6689
6767
|
update: "Zaktualizuj",
|
|
@@ -6778,7 +6856,15 @@ var pt_BR_default = {
|
|
|
6778
6856
|
title: "Visualiza\xE7\xF5es Salvas",
|
|
6779
6857
|
tooltip: "Crie e salve qualquer layout personalizado de tabela para retornar rapidamente \xE0 sua visualiza\xE7\xE3o preferida.",
|
|
6780
6858
|
button: {
|
|
6781
|
-
title: "Visualiza\xE7\xF5es"
|
|
6859
|
+
title: "Visualiza\xE7\xF5es",
|
|
6860
|
+
titleWithView: "Visualiza\xE7\xE3o: {{name}} ({{type}})",
|
|
6861
|
+
viewLevel: {
|
|
6862
|
+
company: "Empresa",
|
|
6863
|
+
project: "Projeto",
|
|
6864
|
+
personal: "Pessoal",
|
|
6865
|
+
default: "Padr\xE3o",
|
|
6866
|
+
temporary: "Tempor\xE1rio"
|
|
6867
|
+
}
|
|
6782
6868
|
},
|
|
6783
6869
|
actions: {
|
|
6784
6870
|
update: "Atualizar",
|
|
@@ -6873,7 +6959,15 @@ var th_TH_default = {
|
|
|
6873
6959
|
title: "\u0E21\u0E38\u0E21\u0E21\u0E2D\u0E07\u0E17\u0E35\u0E48\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E44\u0E27\u0E49",
|
|
6874
6960
|
tooltip: "\u0E2A\u0E23\u0E49\u0E32\u0E07\u0E41\u0E25\u0E30\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E40\u0E04\u0E49\u0E32\u0E42\u0E04\u0E23\u0E07\u0E15\u0E32\u0E23\u0E32\u0E07\u0E41\u0E1A\u0E1A\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E40\u0E2D\u0E07\u0E40\u0E1E\u0E37\u0E48\u0E2D\u0E01\u0E25\u0E31\u0E1A\u0E44\u0E1B\u0E22\u0E31\u0E07\u0E21\u0E38\u0E21\u0E21\u0E2D\u0E07\u0E17\u0E35\u0E48\u0E04\u0E38\u0E13\u0E15\u0E49\u0E2D\u0E07\u0E01\u0E32\u0E23\u0E44\u0E14\u0E49\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E23\u0E27\u0E14\u0E40\u0E23\u0E47\u0E27",
|
|
6875
6961
|
button: {
|
|
6876
|
-
title: "\u0E21\u0E38\u0E21\u0E21\u0E2D\u0E07"
|
|
6962
|
+
title: "\u0E21\u0E38\u0E21\u0E21\u0E2D\u0E07",
|
|
6963
|
+
titleWithView: "\u0E08\u0E33\u0E19\u0E27\u0E19\u0E01\u0E32\u0E23\u0E14\u0E39: {{name}} ({{type}})",
|
|
6964
|
+
viewLevel: {
|
|
6965
|
+
company: "\u0E1A\u0E23\u0E34\u0E29\u0E31\u0E17",
|
|
6966
|
+
project: "\u0E42\u0E04\u0E23\u0E07\u0E01\u0E32\u0E23",
|
|
6967
|
+
personal: "\u0E2A\u0E48\u0E27\u0E19\u0E1A\u0E38\u0E04\u0E04\u0E25",
|
|
6968
|
+
default: "\u0E04\u0E48\u0E32\u0E40\u0E23\u0E34\u0E48\u0E21\u0E15\u0E49\u0E19",
|
|
6969
|
+
temporary: "\u0E0A\u0E31\u0E48\u0E27\u0E04\u0E23\u0E32\u0E27"
|
|
6970
|
+
}
|
|
6877
6971
|
},
|
|
6878
6972
|
actions: {
|
|
6879
6973
|
update: "\u0E2D\u0E31\u0E1B\u0E40\u0E14\u0E15",
|
|
@@ -6968,7 +7062,15 @@ var zh_SG_default = {
|
|
|
6968
7062
|
title: "\u5DF2\u4FDD\u5B58\u89C6\u56FE",
|
|
6969
7063
|
tooltip: "\u521B\u5EFA\u5E76\u4FDD\u5B58\u4EFB\u4F55\u81EA\u5B9A\u4E49\u8868\u683C\u5E03\u5C40\u4EE5\u5FEB\u901F\u8FD4\u56DE\u5230\u4F60\u7684\u9996\u9009\u89C6\u56FE\u3002",
|
|
6970
7064
|
button: {
|
|
6971
|
-
title: "\u89C6\u56FE"
|
|
7065
|
+
title: "\u89C6\u56FE",
|
|
7066
|
+
titleWithView: "\u67E5\u770B\uFF1A{{name}}\uFF08{{type}}\uFF09",
|
|
7067
|
+
viewLevel: {
|
|
7068
|
+
company: "\u516C\u53F8",
|
|
7069
|
+
project: "\u9879\u76EE",
|
|
7070
|
+
personal: "\u4E2A\u4EBA",
|
|
7071
|
+
default: "\u9ED8\u8BA4",
|
|
7072
|
+
temporary: "\u4E34\u65F6"
|
|
7073
|
+
}
|
|
6972
7074
|
},
|
|
6973
7075
|
actions: {
|
|
6974
7076
|
update: "\u66F4\u65B0",
|
|
@@ -7091,7 +7193,7 @@ function getTranslations(envLocale) {
|
|
|
7091
7193
|
}
|
|
7092
7194
|
|
|
7093
7195
|
// src/components/buttons/useSavedViewsPanel.tsx
|
|
7094
|
-
import { useState } from "react";
|
|
7196
|
+
import { useState as useState2 } from "react";
|
|
7095
7197
|
|
|
7096
7198
|
// ../../node_modules/tslib/tslib.es6.mjs
|
|
7097
7199
|
var __assign = function() {
|
|
@@ -7309,8 +7411,8 @@ Plus.displayName = "Plus";
|
|
|
7309
7411
|
var Plus_default = Plus;
|
|
7310
7412
|
|
|
7311
7413
|
// src/components/buttons/SavedViewsButton.tsx
|
|
7312
|
-
import { ToggleButton } from "@procore/core-react";
|
|
7313
|
-
import
|
|
7414
|
+
import { ToggleButton, Tooltip } from "@procore/core-react";
|
|
7415
|
+
import React14 from "react";
|
|
7314
7416
|
|
|
7315
7417
|
// ../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
|
|
7316
7418
|
function memoize(fn) {
|
|
@@ -8823,6 +8925,31 @@ var EnvironmentI18nProvider = ({ children }) => {
|
|
|
8823
8925
|
return /* @__PURE__ */ React12.createElement(I18nContext.Provider, { value: i18n }, children);
|
|
8824
8926
|
};
|
|
8825
8927
|
|
|
8928
|
+
// src/components/buttons/SavedViewsSelectionContext.tsx
|
|
8929
|
+
import React13, {
|
|
8930
|
+
createContext,
|
|
8931
|
+
useCallback,
|
|
8932
|
+
useContext,
|
|
8933
|
+
useMemo as useMemo2,
|
|
8934
|
+
useState
|
|
8935
|
+
} from "react";
|
|
8936
|
+
var SavedViewsSelectionContext = createContext(null);
|
|
8937
|
+
var SavedViewsSelectionProvider = ({
|
|
8938
|
+
children
|
|
8939
|
+
}) => {
|
|
8940
|
+
const [selectedView, setSelectedView] = useState(null);
|
|
8941
|
+
const updateSelectedView = useCallback(
|
|
8942
|
+
(view) => setSelectedView(view),
|
|
8943
|
+
[]
|
|
8944
|
+
);
|
|
8945
|
+
const value = useMemo2(
|
|
8946
|
+
() => ({ selectedView, setSelectedView: updateSelectedView }),
|
|
8947
|
+
[selectedView, updateSelectedView]
|
|
8948
|
+
);
|
|
8949
|
+
return /* @__PURE__ */ React13.createElement(SavedViewsSelectionContext.Provider, { value }, children);
|
|
8950
|
+
};
|
|
8951
|
+
var useSavedViewsSelection = () => useContext(SavedViewsSelectionContext);
|
|
8952
|
+
|
|
8826
8953
|
// src/components/buttons/SavedViewsButton.tsx
|
|
8827
8954
|
var StyledIcon = pt(ExpandSidebar_default)`
|
|
8828
8955
|
transform: ${(props) => props.left ? "rotate(180deg)" : ""};
|
|
@@ -8832,37 +8959,66 @@ var Container = pt.div`
|
|
|
8832
8959
|
border-right: 2px solid #d6dadc;
|
|
8833
8960
|
padding-right: 8px;
|
|
8834
8961
|
`;
|
|
8962
|
+
var Label = pt.span`
|
|
8963
|
+
display: inline-block;
|
|
8964
|
+
max-width: 218px;
|
|
8965
|
+
overflow: hidden;
|
|
8966
|
+
text-overflow: ellipsis;
|
|
8967
|
+
white-space: nowrap;
|
|
8968
|
+
vertical-align: middle;
|
|
8969
|
+
`;
|
|
8835
8970
|
var SavedViewsButton = ({
|
|
8836
8971
|
handleClick,
|
|
8837
8972
|
isOpen
|
|
8838
8973
|
}) => {
|
|
8839
8974
|
const I18n = useCDNTranslations();
|
|
8840
|
-
|
|
8975
|
+
const selection = useSavedViewsSelection();
|
|
8976
|
+
const activeView = selection == null ? void 0 : selection.selectedView;
|
|
8977
|
+
const activeName = activeView == null ? void 0 : activeView.name;
|
|
8978
|
+
const activeType = (activeView == null ? void 0 : activeView.view_level) ? I18n.t(`savedViews.button.viewLevel.${activeView.view_level}`) : "";
|
|
8979
|
+
const label = activeName ? I18n.t("savedViews.button.titleWithView", {
|
|
8980
|
+
name: activeName,
|
|
8981
|
+
type: activeType
|
|
8982
|
+
}) : I18n.t("savedViews.button.title");
|
|
8983
|
+
const button = /* @__PURE__ */ React14.createElement(
|
|
8841
8984
|
ToggleButton,
|
|
8842
8985
|
{
|
|
8843
8986
|
selected: isOpen,
|
|
8844
8987
|
onClick: handleClick,
|
|
8845
|
-
icon: /* @__PURE__ */
|
|
8988
|
+
icon: /* @__PURE__ */ React14.createElement(StyledIcon, { left: isOpen }),
|
|
8846
8989
|
"data-testid": "saved-views-button",
|
|
8847
|
-
"aria-controls": "saved-views-panel"
|
|
8990
|
+
"aria-controls": "saved-views-panel",
|
|
8991
|
+
"aria-label": label
|
|
8848
8992
|
},
|
|
8849
|
-
|
|
8850
|
-
)
|
|
8993
|
+
/* @__PURE__ */ React14.createElement(Label, null, label)
|
|
8994
|
+
);
|
|
8995
|
+
return /* @__PURE__ */ React14.createElement(Container, null, activeName ? /* @__PURE__ */ React14.createElement(
|
|
8996
|
+
Tooltip,
|
|
8997
|
+
{
|
|
8998
|
+
showDelay: 500,
|
|
8999
|
+
overlay: /* @__PURE__ */ React14.createElement(Tooltip.Content, null, label)
|
|
9000
|
+
},
|
|
9001
|
+
button
|
|
9002
|
+
) : button);
|
|
8851
9003
|
};
|
|
8852
9004
|
|
|
8853
9005
|
// src/components/buttons/useSavedViewsPanel.tsx
|
|
8854
|
-
import
|
|
9006
|
+
import React15 from "react";
|
|
8855
9007
|
var useSavedViewsPanel = (domain, tableName) => {
|
|
8856
9008
|
const key = (domain2, tableName2) => `savedViewsPanel-${domain2}-${tableName2}`;
|
|
8857
|
-
const [isOpen, setIsOpen] =
|
|
9009
|
+
const [isOpen, setIsOpen] = useState2(
|
|
8858
9010
|
localStorage.getItem(key(domain, tableName)) === null || localStorage.getItem(key(domain, tableName)) === "true"
|
|
8859
9011
|
);
|
|
8860
9012
|
const handleClick = () => {
|
|
8861
9013
|
setIsOpen(!isOpen);
|
|
8862
9014
|
localStorage.setItem(key(domain, tableName), JSON.stringify(!isOpen));
|
|
8863
9015
|
};
|
|
8864
|
-
const Button7 = () => /* @__PURE__ */
|
|
8865
|
-
return {
|
|
9016
|
+
const Button7 = () => /* @__PURE__ */ React15.createElement(SavedViewsButton, { handleClick, isOpen });
|
|
9017
|
+
return {
|
|
9018
|
+
isOpen,
|
|
9019
|
+
SavedViewsButton: Button7,
|
|
9020
|
+
SavedViewsProvider: SavedViewsSelectionProvider
|
|
9021
|
+
};
|
|
8866
9022
|
};
|
|
8867
9023
|
var useSavedViewsPanel_default = useSavedViewsPanel;
|
|
8868
9024
|
|
|
@@ -8874,8 +9030,28 @@ import {
|
|
|
8874
9030
|
Flex,
|
|
8875
9031
|
useI18nContext as useI18nContext2
|
|
8876
9032
|
} from "@procore/core-react";
|
|
8877
|
-
import * as
|
|
9033
|
+
import * as React17 from "react";
|
|
8878
9034
|
import { useToastAlertContext } from "@procore/toast-alert";
|
|
9035
|
+
|
|
9036
|
+
// src/transport/context.tsx
|
|
9037
|
+
import React16, { createContext as createContext2, useContext as useContext2 } from "react";
|
|
9038
|
+
var SavedViewsTransportContext = createContext2(void 0);
|
|
9039
|
+
var SavedViewsTransportProvider = ({
|
|
9040
|
+
transport,
|
|
9041
|
+
children
|
|
9042
|
+
}) => /* @__PURE__ */ React16.createElement(SavedViewsTransportContext.Provider, { value: transport }, children);
|
|
9043
|
+
var useSavedViewsTransport = () => {
|
|
9044
|
+
const transport = useContext2(SavedViewsTransportContext);
|
|
9045
|
+
if (!transport) {
|
|
9046
|
+
throw new Error(
|
|
9047
|
+
"useSavedViewsTransport must be used inside <SavedViews> (or a SavedViewsTransportProvider). This usually means a hook is being called outside the saved-views component tree."
|
|
9048
|
+
);
|
|
9049
|
+
}
|
|
9050
|
+
return transport;
|
|
9051
|
+
};
|
|
9052
|
+
var useOptionalSavedViewsTransport = () => useContext2(SavedViewsTransportContext);
|
|
9053
|
+
|
|
9054
|
+
// src/components/menu-items/SavedViewsCollectionsMenuItem.tsx
|
|
8879
9055
|
var RowActionsBox = pt(Flex)`
|
|
8880
9056
|
justify-content: center;
|
|
8881
9057
|
align-items: center;
|
|
@@ -8896,7 +9072,7 @@ var IconWrapper = pt.span`
|
|
|
8896
9072
|
justify-content: center;
|
|
8897
9073
|
`;
|
|
8898
9074
|
var SavedViewCollectionMenuItem = (props) => {
|
|
8899
|
-
const onClick =
|
|
9075
|
+
const onClick = React17.useCallback(
|
|
8900
9076
|
(a2) => {
|
|
8901
9077
|
var _a, _b;
|
|
8902
9078
|
if (!props.item) {
|
|
@@ -8922,6 +9098,8 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
8922
9098
|
};
|
|
8923
9099
|
const { showToast } = useToastAlertContext();
|
|
8924
9100
|
const i18n = useI18nContext2();
|
|
9101
|
+
const transport = useOptionalSavedViewsTransport();
|
|
9102
|
+
const canShareViaUrl = (transport == null ? void 0 : transport.supportsUrlSharing) !== false;
|
|
8925
9103
|
const copyShareLink = async (event) => {
|
|
8926
9104
|
event.stopPropagation();
|
|
8927
9105
|
try {
|
|
@@ -8944,18 +9122,18 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
8944
9122
|
label: i18n.t("savedViews.actions.delete")
|
|
8945
9123
|
}
|
|
8946
9124
|
];
|
|
8947
|
-
const preventEventBubbleToNotTriggerViewSelectEvent =
|
|
9125
|
+
const preventEventBubbleToNotTriggerViewSelectEvent = React17.useCallback(
|
|
8948
9126
|
(e) => {
|
|
8949
9127
|
e.stopPropagation();
|
|
8950
9128
|
},
|
|
8951
9129
|
[]
|
|
8952
9130
|
);
|
|
8953
9131
|
const hasUpdateButton = props.item.view_level !== "default" && props.canUpdate;
|
|
8954
|
-
const hasCopyShareLinkButton = props.item.view_level !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary";
|
|
9132
|
+
const hasCopyShareLinkButton = canShareViaUrl && props.item.view_level !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary";
|
|
8955
9133
|
const hasClearTemporaryButton = props.item.id === "temporary";
|
|
8956
9134
|
const hasOverflowMenu = props.item.view_level !== "default" && props.canEditOrDelete;
|
|
8957
9135
|
const hasActions = hasUpdateButton || hasCopyShareLinkButton || hasClearTemporaryButton || hasOverflowMenu;
|
|
8958
|
-
return /* @__PURE__ */
|
|
9136
|
+
return /* @__PURE__ */ React17.createElement(
|
|
8959
9137
|
Container2,
|
|
8960
9138
|
{
|
|
8961
9139
|
"aria-selected": Boolean(props.selected),
|
|
@@ -8967,7 +9145,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
8967
9145
|
"data-testid": "saved-view-collection-menu-item",
|
|
8968
9146
|
onKeyDown: preventEventBubbleToNotTriggerViewSelectEvent
|
|
8969
9147
|
},
|
|
8970
|
-
/* @__PURE__ */
|
|
9148
|
+
/* @__PURE__ */ React17.createElement(
|
|
8971
9149
|
"span",
|
|
8972
9150
|
{
|
|
8973
9151
|
"data-testid": "saved-view-display-name",
|
|
@@ -8975,7 +9153,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
8975
9153
|
},
|
|
8976
9154
|
props.item.name
|
|
8977
9155
|
),
|
|
8978
|
-
hasActions && /* @__PURE__ */
|
|
9156
|
+
hasActions && /* @__PURE__ */ React17.createElement(RowActionsBox, null, /* @__PURE__ */ React17.createElement(Box, { justifyContent: "space-between" }, hasUpdateButton && /* @__PURE__ */ React17.createElement(
|
|
8979
9157
|
Button,
|
|
8980
9158
|
{
|
|
8981
9159
|
onClick: updateItem,
|
|
@@ -8986,7 +9164,7 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
8986
9164
|
loading: props.isUpdateProcessing
|
|
8987
9165
|
},
|
|
8988
9166
|
i18n.t("savedViews.actions.update")
|
|
8989
|
-
), hasCopyShareLinkButton && /* @__PURE__ */
|
|
9167
|
+
), hasCopyShareLinkButton && /* @__PURE__ */ React17.createElement(
|
|
8990
9168
|
Button,
|
|
8991
9169
|
{
|
|
8992
9170
|
onClick: copyShareLink,
|
|
@@ -8995,8 +9173,8 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
8995
9173
|
"aria-label": i18n.t("savedViews.actions.copyShareLink"),
|
|
8996
9174
|
"data-testid": "copy-share-link-button"
|
|
8997
9175
|
},
|
|
8998
|
-
/* @__PURE__ */
|
|
8999
|
-
), hasClearTemporaryButton && /* @__PURE__ */
|
|
9176
|
+
/* @__PURE__ */ React17.createElement(IconWrapper, null, /* @__PURE__ */ React17.createElement(Link_default, { size: "sm" }))
|
|
9177
|
+
), hasClearTemporaryButton && /* @__PURE__ */ React17.createElement(
|
|
9000
9178
|
Button,
|
|
9001
9179
|
{
|
|
9002
9180
|
onClick: (e) => {
|
|
@@ -9010,8 +9188,8 @@ var SavedViewCollectionMenuItem = (props) => {
|
|
|
9010
9188
|
title: i18n.t("savedViews.actions.clearTemporary"),
|
|
9011
9189
|
"data-testid": "clear-temporary-view-button"
|
|
9012
9190
|
},
|
|
9013
|
-
/* @__PURE__ */
|
|
9014
|
-
)), /* @__PURE__ */
|
|
9191
|
+
/* @__PURE__ */ React17.createElement(IconWrapper, null, /* @__PURE__ */ React17.createElement(Clear_default, { size: "sm" }))
|
|
9192
|
+
)), /* @__PURE__ */ React17.createElement(Box, null, hasOverflowMenu && /* @__PURE__ */ React17.createElement(
|
|
9015
9193
|
DropdownFlyout,
|
|
9016
9194
|
{
|
|
9017
9195
|
"data-testid": "saved-view-overflow-button",
|
|
@@ -9037,15 +9215,9 @@ var ExpandedPanel = pt(Panel)`
|
|
|
9037
9215
|
// src/components/panels/PanelContent.tsx
|
|
9038
9216
|
import { Flex as Flex2, MenuImperative as MenuImperative2, useI18nContext as useI18nContext5 } from "@procore/core-react";
|
|
9039
9217
|
import { useToastAlertContext as useToastAlertContext2 } from "@procore/toast-alert";
|
|
9040
|
-
import
|
|
9041
|
-
|
|
9042
|
-
// src/utils/api/queries.ts
|
|
9043
|
-
import { requestJSON as requestJSON2 } from "@procore/core-http";
|
|
9044
|
-
import { useQuery } from "@tanstack/react-query";
|
|
9218
|
+
import React19 from "react";
|
|
9045
9219
|
|
|
9046
9220
|
// src/utils/api/queriesHandler.ts
|
|
9047
|
-
import { requestJSON } from "@procore/core-http";
|
|
9048
|
-
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
9049
9221
|
import { useI18nContext as useI18nContext3 } from "@procore/core-react";
|
|
9050
9222
|
var getBasePath = (companyId, projectId) => {
|
|
9051
9223
|
if (projectId) {
|
|
@@ -9055,22 +9227,39 @@ var getBasePath = (companyId, projectId) => {
|
|
|
9055
9227
|
};
|
|
9056
9228
|
var useApiRequest = (props, method, mutationKey) => {
|
|
9057
9229
|
const { projectId, companyId, domain, tableName } = props;
|
|
9058
|
-
const
|
|
9230
|
+
const transport = useSavedViewsTransport();
|
|
9231
|
+
const http = transport.useHttp();
|
|
9232
|
+
const cacheControl = transport.useCacheControl();
|
|
9059
9233
|
const { locale } = useI18nContext3();
|
|
9060
9234
|
const basePath = getBasePath(companyId, projectId);
|
|
9061
|
-
const queryKey = [
|
|
9062
|
-
|
|
9235
|
+
const queryKey = [
|
|
9236
|
+
"savedViews",
|
|
9237
|
+
domain,
|
|
9238
|
+
tableName,
|
|
9239
|
+
companyId,
|
|
9240
|
+
projectId
|
|
9241
|
+
];
|
|
9242
|
+
return transport.useMutationAdapter({
|
|
9063
9243
|
mutationKey,
|
|
9064
9244
|
mutationFn: async (savedView) => {
|
|
9065
|
-
let url =
|
|
9066
|
-
|
|
9245
|
+
let url = basePath;
|
|
9246
|
+
let body = { ...savedView };
|
|
9247
|
+
if (method === "DELETE") {
|
|
9067
9248
|
url = `${basePath}/${savedView.share_token}?permissions_domain=${domain}`;
|
|
9249
|
+
} else if (method === "PUT") {
|
|
9250
|
+
url = `${basePath}/${savedView.share_token}`;
|
|
9251
|
+
body = { ...savedView, permissions_domain: domain };
|
|
9068
9252
|
} else {
|
|
9069
|
-
|
|
9253
|
+
body = {
|
|
9254
|
+
...savedView,
|
|
9255
|
+
table_name: tableName,
|
|
9256
|
+
permissions_domain: domain
|
|
9257
|
+
};
|
|
9070
9258
|
}
|
|
9071
|
-
const response = await
|
|
9259
|
+
const response = await http({
|
|
9072
9260
|
method,
|
|
9073
|
-
|
|
9261
|
+
url,
|
|
9262
|
+
body: JSON.stringify(body),
|
|
9074
9263
|
headers: {
|
|
9075
9264
|
"Content-Type": "application/json",
|
|
9076
9265
|
"Accept-Language": locale
|
|
@@ -9083,23 +9272,19 @@ var useApiRequest = (props, method, mutationKey) => {
|
|
|
9083
9272
|
},
|
|
9084
9273
|
onSuccess: (savedView) => {
|
|
9085
9274
|
if (method === "DELETE" || method === "POST") {
|
|
9086
|
-
|
|
9087
|
-
queryKey
|
|
9088
|
-
});
|
|
9275
|
+
cacheControl.invalidate(queryKey);
|
|
9089
9276
|
return;
|
|
9090
9277
|
} else {
|
|
9091
|
-
const oldData =
|
|
9278
|
+
const oldData = cacheControl.getData(queryKey);
|
|
9092
9279
|
const oldView = oldData == null ? void 0 : oldData.find(
|
|
9093
9280
|
(item) => item.share_token === savedView.share_token
|
|
9094
9281
|
);
|
|
9095
9282
|
if ((oldView == null ? void 0 : oldView.name) !== savedView.name) {
|
|
9096
|
-
|
|
9097
|
-
queryKey
|
|
9098
|
-
});
|
|
9283
|
+
cacheControl.invalidate(queryKey);
|
|
9099
9284
|
return;
|
|
9100
9285
|
}
|
|
9101
9286
|
}
|
|
9102
|
-
|
|
9287
|
+
cacheControl.setData(queryKey, (oldData) => {
|
|
9103
9288
|
if (!oldData) return [savedView];
|
|
9104
9289
|
return oldData.map(
|
|
9105
9290
|
(item) => item.share_token === savedView.share_token ? savedView : item
|
|
@@ -9128,13 +9313,17 @@ var getBasePath2 = (companyId, projectId) => {
|
|
|
9128
9313
|
};
|
|
9129
9314
|
var useSavedViewsQuery = (props) => {
|
|
9130
9315
|
const { projectId, companyId, domain, tableName } = props;
|
|
9316
|
+
const transport = useSavedViewsTransport();
|
|
9317
|
+
const http = transport.useHttp();
|
|
9131
9318
|
const basePath = getBasePath2(companyId, projectId);
|
|
9132
9319
|
const url = `${basePath}?table_name=${tableName}&permissions_domain=${domain}`;
|
|
9133
|
-
return
|
|
9320
|
+
return transport.useQueryAdapter({
|
|
9134
9321
|
queryKey: ["savedViews", domain, tableName, companyId, projectId],
|
|
9135
9322
|
queryFn: async () => {
|
|
9136
9323
|
const getUrl = `${url}&per_page=${PAGE_SIZE}`;
|
|
9137
|
-
const response = await
|
|
9324
|
+
const response = await http({
|
|
9325
|
+
method: "GET",
|
|
9326
|
+
url: getUrl,
|
|
9138
9327
|
priority: "low"
|
|
9139
9328
|
});
|
|
9140
9329
|
return response.data;
|
|
@@ -9143,12 +9332,16 @@ var useSavedViewsQuery = (props) => {
|
|
|
9143
9332
|
};
|
|
9144
9333
|
var useSavedViewsPermissions = (props) => {
|
|
9145
9334
|
const { projectId, companyId, domain } = props;
|
|
9335
|
+
const transport = useSavedViewsTransport();
|
|
9336
|
+
const http = transport.useHttp();
|
|
9146
9337
|
const basePath = getBasePath2(companyId, projectId);
|
|
9147
9338
|
const url = `${basePath}/permissions?permissions_domain=${domain}`;
|
|
9148
|
-
return
|
|
9339
|
+
return transport.useQueryAdapter({
|
|
9149
9340
|
queryKey: ["savedViewsConfig", domain, companyId, projectId],
|
|
9150
9341
|
queryFn: async () => {
|
|
9151
|
-
const response = await
|
|
9342
|
+
const response = await http({
|
|
9343
|
+
method: "GET",
|
|
9344
|
+
url,
|
|
9152
9345
|
priority: "low"
|
|
9153
9346
|
});
|
|
9154
9347
|
return response.data;
|
|
@@ -9172,13 +9365,17 @@ var useDeleteSavedView = (props) => useApiRequest(props, "DELETE", [
|
|
|
9172
9365
|
]);
|
|
9173
9366
|
var useFetchSavedViewById = (savedViewToken, queryInput, enabled = true) => {
|
|
9174
9367
|
const { projectId, companyId, domain } = queryInput;
|
|
9368
|
+
const transport = useSavedViewsTransport();
|
|
9369
|
+
const http = transport.useHttp();
|
|
9175
9370
|
const basePath = getBasePath2(companyId, projectId);
|
|
9176
|
-
return
|
|
9371
|
+
return transport.useQueryAdapter({
|
|
9177
9372
|
enabled: enabled && Boolean(savedViewToken),
|
|
9178
9373
|
queryKey: ["savedView", savedViewToken, companyId, projectId],
|
|
9179
9374
|
queryFn: async () => {
|
|
9180
9375
|
const url = `${basePath}/${savedViewToken}?permissions_domain=${domain}`;
|
|
9181
|
-
const response = await
|
|
9376
|
+
const response = await http({
|
|
9377
|
+
method: "GET",
|
|
9378
|
+
url,
|
|
9182
9379
|
priority: "low"
|
|
9183
9380
|
});
|
|
9184
9381
|
return response.data;
|
|
@@ -9399,10 +9596,10 @@ var hasPermissionForViewLevel = (viewLevel, permissions) => {
|
|
|
9399
9596
|
};
|
|
9400
9597
|
|
|
9401
9598
|
// src/components/panels/useGroups.ts
|
|
9402
|
-
import { useState as
|
|
9599
|
+
import { useState as useState3 } from "react";
|
|
9403
9600
|
var useGroups = (isProjectLevelTool) => {
|
|
9404
9601
|
const viewLevels = getViewLevels(isProjectLevelTool);
|
|
9405
|
-
const [groups, setGroups] =
|
|
9602
|
+
const [groups, setGroups] = useState3(
|
|
9406
9603
|
Object.fromEntries(viewLevels.map((level) => [level, true]))
|
|
9407
9604
|
);
|
|
9408
9605
|
const toggleGroup = (group) => {
|
|
@@ -9419,15 +9616,15 @@ import {
|
|
|
9419
9616
|
Typography,
|
|
9420
9617
|
useI18nContext as useI18nContext4
|
|
9421
9618
|
} from "@procore/core-react";
|
|
9422
|
-
import
|
|
9619
|
+
import React18 from "react";
|
|
9423
9620
|
var groupIcon = (group) => {
|
|
9424
9621
|
switch (group) {
|
|
9425
9622
|
case "personal":
|
|
9426
|
-
return /* @__PURE__ */
|
|
9623
|
+
return /* @__PURE__ */ React18.createElement(Person_default, null);
|
|
9427
9624
|
case "project":
|
|
9428
|
-
return /* @__PURE__ */
|
|
9625
|
+
return /* @__PURE__ */ React18.createElement(Excavator_default, null);
|
|
9429
9626
|
case "company":
|
|
9430
|
-
return /* @__PURE__ */
|
|
9627
|
+
return /* @__PURE__ */ React18.createElement(Building_default, null);
|
|
9431
9628
|
}
|
|
9432
9629
|
};
|
|
9433
9630
|
var StyledButton = pt(Button2)`
|
|
@@ -9437,7 +9634,7 @@ var StyledButton = pt(Button2)`
|
|
|
9437
9634
|
`;
|
|
9438
9635
|
var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
|
|
9439
9636
|
const I18n = useI18nContext4();
|
|
9440
|
-
return /* @__PURE__ */
|
|
9637
|
+
return /* @__PURE__ */ React18.createElement(Box2, { style: { width: "100%" } }, /* @__PURE__ */ React18.createElement(
|
|
9441
9638
|
StyledButton,
|
|
9442
9639
|
{
|
|
9443
9640
|
block: true,
|
|
@@ -9450,10 +9647,10 @@ var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
|
|
|
9450
9647
|
onClick: () => toggleGroup(group),
|
|
9451
9648
|
"aria-controls": `saved-views-collections-${group}`,
|
|
9452
9649
|
"aria-expanded": expanded,
|
|
9453
|
-
icon: expanded ? /* @__PURE__ */
|
|
9650
|
+
icon: expanded ? /* @__PURE__ */ React18.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ React18.createElement(ChevronRight_default, { size: "sm" })
|
|
9454
9651
|
},
|
|
9455
9652
|
groupIcon(group),
|
|
9456
|
-
/* @__PURE__ */
|
|
9653
|
+
/* @__PURE__ */ React18.createElement(Typography, { weight: "semibold" }, I18n.t(`savedViews.viewLevel.${group}`))
|
|
9457
9654
|
));
|
|
9458
9655
|
};
|
|
9459
9656
|
var ViewLevelHeader_default = ViewLevelHeader;
|
|
@@ -9507,10 +9704,10 @@ var PanelContent = (props) => {
|
|
|
9507
9704
|
const { data: savedViewsFromQuery, error: savedViewsError } = useSavedViewsQuery(props.queryInput);
|
|
9508
9705
|
const updateMutation = useUpdateSavedView(queryInput);
|
|
9509
9706
|
const { mutate: updateSavedView } = updateMutation;
|
|
9510
|
-
const isUpdateLoading =
|
|
9707
|
+
const isUpdateLoading = updateMutation.isPending;
|
|
9511
9708
|
const savedViews = props.savedViews ?? savedViewsFromQuery;
|
|
9512
|
-
const errorToastRef =
|
|
9513
|
-
|
|
9709
|
+
const errorToastRef = React19.useRef(null);
|
|
9710
|
+
React19.useEffect(() => {
|
|
9514
9711
|
if (savedViewsError && savedViewsError !== errorToastRef.current) {
|
|
9515
9712
|
showToast.error(I18n.t("savedViews.errors.fetch"));
|
|
9516
9713
|
errorToastRef.current = savedViewsError;
|
|
@@ -9540,7 +9737,7 @@ var PanelContent = (props) => {
|
|
|
9540
9737
|
}
|
|
9541
9738
|
});
|
|
9542
9739
|
};
|
|
9543
|
-
return /* @__PURE__ */
|
|
9740
|
+
return /* @__PURE__ */ React19.createElement(Panel2, { "data-testid": "inner-panel" }, /* @__PURE__ */ React19.createElement(Flex2, { direction: "column", style: { height: "100%", width: "100%" } }, (temporaryView || presetViews) && /* @__PURE__ */ React19.createElement(
|
|
9544
9741
|
StyledMenuImperative,
|
|
9545
9742
|
{
|
|
9546
9743
|
role: "listbox",
|
|
@@ -9550,7 +9747,7 @@ var PanelContent = (props) => {
|
|
|
9550
9747
|
}
|
|
9551
9748
|
}
|
|
9552
9749
|
},
|
|
9553
|
-
/* @__PURE__ */
|
|
9750
|
+
/* @__PURE__ */ React19.createElement(MenuImperative2.Options, null, temporaryView && /* @__PURE__ */ React19.createElement(
|
|
9554
9751
|
Row,
|
|
9555
9752
|
{
|
|
9556
9753
|
key: temporaryView.id,
|
|
@@ -9559,7 +9756,7 @@ var PanelContent = (props) => {
|
|
|
9559
9756
|
"aria-current": isTemporarySelected ? "true" : void 0,
|
|
9560
9757
|
ref: isTemporarySelected ? selectedRowRef : null
|
|
9561
9758
|
},
|
|
9562
|
-
/* @__PURE__ */
|
|
9759
|
+
/* @__PURE__ */ React19.createElement(
|
|
9563
9760
|
SavedViewCollectionMenuItem,
|
|
9564
9761
|
{
|
|
9565
9762
|
item: temporaryView,
|
|
@@ -9569,7 +9766,7 @@ var PanelContent = (props) => {
|
|
|
9569
9766
|
)
|
|
9570
9767
|
), presetViews.map((presetView) => {
|
|
9571
9768
|
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === presetView.id;
|
|
9572
|
-
return /* @__PURE__ */
|
|
9769
|
+
return /* @__PURE__ */ React19.createElement(
|
|
9573
9770
|
Row,
|
|
9574
9771
|
{
|
|
9575
9772
|
key: presetView.id,
|
|
@@ -9578,7 +9775,7 @@ var PanelContent = (props) => {
|
|
|
9578
9775
|
"aria-current": isSelected ? "true" : void 0,
|
|
9579
9776
|
ref: isSelected ? selectedRowRef : null
|
|
9580
9777
|
},
|
|
9581
|
-
/* @__PURE__ */
|
|
9778
|
+
/* @__PURE__ */ React19.createElement(
|
|
9582
9779
|
SavedViewCollectionMenuItem,
|
|
9583
9780
|
{
|
|
9584
9781
|
item: presetView,
|
|
@@ -9592,14 +9789,14 @@ var PanelContent = (props) => {
|
|
|
9592
9789
|
const views = isExpanded && savedViews ? savedViews.filter(
|
|
9593
9790
|
(view) => view.view_level === level && view.id !== "temporary"
|
|
9594
9791
|
) : [];
|
|
9595
|
-
return /* @__PURE__ */
|
|
9792
|
+
return /* @__PURE__ */ React19.createElement(React19.Fragment, { key: level }, /* @__PURE__ */ React19.createElement(
|
|
9596
9793
|
ViewLevelHeader_default,
|
|
9597
9794
|
{
|
|
9598
9795
|
group: level,
|
|
9599
9796
|
toggleGroup,
|
|
9600
9797
|
expanded: isExpanded
|
|
9601
9798
|
}
|
|
9602
|
-
), isExpanded && views.length > 0 && /* @__PURE__ */
|
|
9799
|
+
), isExpanded && views.length > 0 && /* @__PURE__ */ React19.createElement(
|
|
9603
9800
|
StyledMenuImperative,
|
|
9604
9801
|
{
|
|
9605
9802
|
id: `saved-views-collections-${level}`,
|
|
@@ -9610,7 +9807,7 @@ var PanelContent = (props) => {
|
|
|
9610
9807
|
}
|
|
9611
9808
|
}
|
|
9612
9809
|
},
|
|
9613
|
-
/* @__PURE__ */
|
|
9810
|
+
/* @__PURE__ */ React19.createElement(MenuImperative2.Options, null, views.map((view) => {
|
|
9614
9811
|
const isSelected = (selectedSavedView == null ? void 0 : selectedSavedView.id) === view.id;
|
|
9615
9812
|
const canUpdate = isSelected && hasPermissionForViewLevel(
|
|
9616
9813
|
view.view_level,
|
|
@@ -9622,7 +9819,7 @@ var PanelContent = (props) => {
|
|
|
9622
9819
|
props.provider
|
|
9623
9820
|
);
|
|
9624
9821
|
const canEditOrDelete = isSelected && hasPermissionForViewLevel(view.view_level, permissions);
|
|
9625
|
-
return /* @__PURE__ */
|
|
9822
|
+
return /* @__PURE__ */ React19.createElement(
|
|
9626
9823
|
Row,
|
|
9627
9824
|
{
|
|
9628
9825
|
key: view.id,
|
|
@@ -9631,7 +9828,7 @@ var PanelContent = (props) => {
|
|
|
9631
9828
|
"aria-current": isSelected ? "true" : void 0,
|
|
9632
9829
|
ref: isSelected ? selectedRowRef : null
|
|
9633
9830
|
},
|
|
9634
|
-
/* @__PURE__ */
|
|
9831
|
+
/* @__PURE__ */ React19.createElement(
|
|
9635
9832
|
SavedViewCollectionMenuItem,
|
|
9636
9833
|
{
|
|
9637
9834
|
item: view,
|
|
@@ -9658,11 +9855,10 @@ import {
|
|
|
9658
9855
|
Button as Button6,
|
|
9659
9856
|
Flex as Flex5,
|
|
9660
9857
|
Panel as Panel3,
|
|
9661
|
-
Tooltip,
|
|
9858
|
+
Tooltip as Tooltip2,
|
|
9662
9859
|
useI18nContext as useI18nContext12
|
|
9663
9860
|
} from "@procore/core-react";
|
|
9664
|
-
import
|
|
9665
|
-
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
9861
|
+
import React25, { useState as useState5, useEffect as useEffect6, useCallback as useCallback5 } from "react";
|
|
9666
9862
|
import { useToastAlertContext as useToastAlertContext3, ToastAlertProvider } from "@procore/toast-alert";
|
|
9667
9863
|
|
|
9668
9864
|
// src/components/modals/DeleteConfirmationModal.tsx
|
|
@@ -9673,14 +9869,14 @@ import {
|
|
|
9673
9869
|
P as P2,
|
|
9674
9870
|
useI18nContext as useI18nContext6
|
|
9675
9871
|
} from "@procore/core-react";
|
|
9676
|
-
import
|
|
9872
|
+
import React20 from "react";
|
|
9677
9873
|
var SavedViewsDeleteConfirmationModalShared = ({
|
|
9678
9874
|
onCancel,
|
|
9679
9875
|
onDelete,
|
|
9680
9876
|
open
|
|
9681
9877
|
}) => {
|
|
9682
9878
|
const i18n = useI18nContext6();
|
|
9683
|
-
return /* @__PURE__ */
|
|
9879
|
+
return /* @__PURE__ */ React20.createElement(
|
|
9684
9880
|
ConfirmModal,
|
|
9685
9881
|
{
|
|
9686
9882
|
"data-testid": "delete-confirmation-modal",
|
|
@@ -9690,13 +9886,13 @@ var SavedViewsDeleteConfirmationModalShared = ({
|
|
|
9690
9886
|
onClose: onCancel,
|
|
9691
9887
|
style: { overflowWrap: "anywhere" }
|
|
9692
9888
|
},
|
|
9693
|
-
/* @__PURE__ */
|
|
9694
|
-
/* @__PURE__ */
|
|
9889
|
+
/* @__PURE__ */ React20.createElement(Modal.Body, null, /* @__PURE__ */ React20.createElement(P2, null, i18n.t("savedViews.modal.delete.description"))),
|
|
9890
|
+
/* @__PURE__ */ React20.createElement(Modal.Footer, null, /* @__PURE__ */ React20.createElement(Modal.FooterButtons, null, /* @__PURE__ */ React20.createElement(Button3, { variant: "secondary", onClick: onCancel }, i18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React20.createElement(Button3, { variant: "primary", onClick: onDelete }, i18n.t("savedViews.actions.delete"))))
|
|
9695
9891
|
);
|
|
9696
9892
|
};
|
|
9697
9893
|
|
|
9698
9894
|
// src/components/modals/form-modal/FormModal.tsx
|
|
9699
|
-
import
|
|
9895
|
+
import React23 from "react";
|
|
9700
9896
|
|
|
9701
9897
|
// src/components/modals/form-modal/FormModalBase.tsx
|
|
9702
9898
|
import {
|
|
@@ -9711,7 +9907,7 @@ import {
|
|
|
9711
9907
|
Typography as Typography2,
|
|
9712
9908
|
useI18nContext as useI18nContext8
|
|
9713
9909
|
} from "@procore/core-react";
|
|
9714
|
-
import * as
|
|
9910
|
+
import * as React22 from "react";
|
|
9715
9911
|
import * as yup from "yup";
|
|
9716
9912
|
|
|
9717
9913
|
// src/components/modals/form-modal/FormModalBaseUtils.ts
|
|
@@ -9748,7 +9944,7 @@ function extractMessage(error, I18n) {
|
|
|
9748
9944
|
|
|
9749
9945
|
// src/components/modals/form-modal/NameInputField.tsx
|
|
9750
9946
|
import { Form, useFormContext, useI18nContext as useI18nContext7 } from "@procore/core-react";
|
|
9751
|
-
import * as
|
|
9947
|
+
import * as React21 from "react";
|
|
9752
9948
|
var NAME_INPUT_ID = "saved-view-form-name-input";
|
|
9753
9949
|
var NameInputField = ({
|
|
9754
9950
|
error,
|
|
@@ -9757,13 +9953,13 @@ var NameInputField = ({
|
|
|
9757
9953
|
const I18n = useI18nContext7();
|
|
9758
9954
|
const label = I18n.t("savedViews.modal.fields.name");
|
|
9759
9955
|
const { errors: formErrors, submitCount } = useFormContext();
|
|
9760
|
-
|
|
9956
|
+
React21.useEffect(() => {
|
|
9761
9957
|
var _a;
|
|
9762
9958
|
if (submitCount > 0 && (formErrors == null ? void 0 : formErrors.name)) {
|
|
9763
9959
|
(_a = document.getElementById(NAME_INPUT_ID)) == null ? void 0 : _a.focus();
|
|
9764
9960
|
}
|
|
9765
9961
|
}, [formErrors == null ? void 0 : formErrors.name, submitCount]);
|
|
9766
|
-
return /* @__PURE__ */
|
|
9962
|
+
return /* @__PURE__ */ React21.createElement(
|
|
9767
9963
|
Form.Text,
|
|
9768
9964
|
{
|
|
9769
9965
|
id: NAME_INPUT_ID,
|
|
@@ -9855,7 +10051,7 @@ var FormModalBase = ({
|
|
|
9855
10051
|
I18n,
|
|
9856
10052
|
isProjectLevelTool
|
|
9857
10053
|
);
|
|
9858
|
-
return /* @__PURE__ */
|
|
10054
|
+
return /* @__PURE__ */ React22.createElement(
|
|
9859
10055
|
Modal2,
|
|
9860
10056
|
{
|
|
9861
10057
|
howToClose: ["x", "scrim"],
|
|
@@ -9864,7 +10060,7 @@ var FormModalBase = ({
|
|
|
9864
10060
|
width: "md",
|
|
9865
10061
|
"data-testid": "create-update-modal"
|
|
9866
10062
|
},
|
|
9867
|
-
/* @__PURE__ */
|
|
10063
|
+
/* @__PURE__ */ React22.createElement(ScrollContainer, null, /* @__PURE__ */ React22.createElement(Modal2.Header, { style: { borderBottom: `1px solid ${colors3.gray85}` } }, /* @__PURE__ */ React22.createElement(Modal2.Heading, null, header)), /* @__PURE__ */ React22.createElement(
|
|
9868
10064
|
Form2,
|
|
9869
10065
|
{
|
|
9870
10066
|
initialValues: {
|
|
@@ -9890,25 +10086,25 @@ var FormModalBase = ({
|
|
|
9890
10086
|
onReset: onCancel,
|
|
9891
10087
|
validateOnChange: true
|
|
9892
10088
|
},
|
|
9893
|
-
/* @__PURE__ */
|
|
10089
|
+
/* @__PURE__ */ React22.createElement(Form2.Form, { name: header }, /* @__PURE__ */ React22.createElement(
|
|
9894
10090
|
Modal2.Body,
|
|
9895
10091
|
{
|
|
9896
10092
|
style: { paddingTop: 0, paddingBottom: 0, marginTop: spacing2.lg }
|
|
9897
10093
|
},
|
|
9898
|
-
errors && /* @__PURE__ */
|
|
9899
|
-
/* @__PURE__ */
|
|
10094
|
+
errors && /* @__PURE__ */ React22.createElement(ErrorBanner, { style: { marginBottom: spacing2.xl } }, /* @__PURE__ */ React22.createElement(Banner.Content, null, /* @__PURE__ */ React22.createElement(Banner.Title, null, I18n.t("savedViews.modal.errors.title", { mode })), /* @__PURE__ */ React22.createElement(Banner.Body, null, (errors == null ? void 0 : errors.form) || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
|
|
10095
|
+
/* @__PURE__ */ React22.createElement(Form2.Row, null, /* @__PURE__ */ React22.createElement(
|
|
9900
10096
|
NameInputField,
|
|
9901
10097
|
{
|
|
9902
10098
|
error: errors == null ? void 0 : errors.name,
|
|
9903
10099
|
onResetMutations: resetMutations
|
|
9904
10100
|
}
|
|
9905
10101
|
)),
|
|
9906
|
-
/* @__PURE__ */
|
|
10102
|
+
/* @__PURE__ */ React22.createElement(
|
|
9907
10103
|
Form2.Row,
|
|
9908
10104
|
{
|
|
9909
10105
|
style: { marginTop: (errors == null ? void 0 : errors.name) ? spacing2.xl : spacing2.none }
|
|
9910
10106
|
},
|
|
9911
|
-
/* @__PURE__ */
|
|
10107
|
+
/* @__PURE__ */ React22.createElement(
|
|
9912
10108
|
Form2.TextArea,
|
|
9913
10109
|
{
|
|
9914
10110
|
name: "description",
|
|
@@ -9919,7 +10115,7 @@ var FormModalBase = ({
|
|
|
9919
10115
|
}
|
|
9920
10116
|
)
|
|
9921
10117
|
),
|
|
9922
|
-
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */
|
|
10118
|
+
viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React22.createElement(Form2.Row, null, /* @__PURE__ */ React22.createElement(
|
|
9923
10119
|
Form2.Select,
|
|
9924
10120
|
{
|
|
9925
10121
|
name: "view_level",
|
|
@@ -9929,8 +10125,8 @@ var FormModalBase = ({
|
|
|
9929
10125
|
onSearch: false,
|
|
9930
10126
|
onClear: false
|
|
9931
10127
|
}
|
|
9932
|
-
)) : /* @__PURE__ */
|
|
9933
|
-
), /* @__PURE__ */
|
|
10128
|
+
)) : /* @__PURE__ */ React22.createElement(React22.Fragment, null)
|
|
10129
|
+
), /* @__PURE__ */ React22.createElement(Modal2.Footer, { style: { borderTop: `1px solid ${colors3.gray85}` } }, /* @__PURE__ */ React22.createElement(Flex3, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React22.createElement(Typography2, { color: "gray45", italic: true }, /* @__PURE__ */ React22.createElement(Typography2, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React22.createElement(Modal2.FooterButtons, null, /* @__PURE__ */ React22.createElement(Button4, { type: "reset", variant: "tertiary", disabled: isLoading }, I18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React22.createElement(
|
|
9934
10130
|
Button4,
|
|
9935
10131
|
{
|
|
9936
10132
|
"data-testid": "create-update-modal-button",
|
|
@@ -9960,7 +10156,7 @@ var FormModal = ({
|
|
|
9960
10156
|
defaultView
|
|
9961
10157
|
}) => {
|
|
9962
10158
|
const i18n = useI18nContext9();
|
|
9963
|
-
return /* @__PURE__ */
|
|
10159
|
+
return /* @__PURE__ */ React23.createElement(
|
|
9964
10160
|
FormModalBase,
|
|
9965
10161
|
{
|
|
9966
10162
|
open,
|
|
@@ -9994,7 +10190,7 @@ import {
|
|
|
9994
10190
|
Typography as Typography3,
|
|
9995
10191
|
useI18nContext as useI18nContext10
|
|
9996
10192
|
} from "@procore/core-react";
|
|
9997
|
-
import * as
|
|
10193
|
+
import * as React24 from "react";
|
|
9998
10194
|
import * as yup2 from "yup";
|
|
9999
10195
|
var SharedViewFormModal = ({
|
|
10000
10196
|
open,
|
|
@@ -10017,7 +10213,7 @@ var SharedViewFormModal = ({
|
|
|
10017
10213
|
const handleOnSubmit = (data) => {
|
|
10018
10214
|
onCreateView(data.name, data.description);
|
|
10019
10215
|
};
|
|
10020
|
-
return /* @__PURE__ */
|
|
10216
|
+
return /* @__PURE__ */ React24.createElement(
|
|
10021
10217
|
Modal3,
|
|
10022
10218
|
{
|
|
10023
10219
|
"data-testid": "shared-view-form-modal",
|
|
@@ -10026,7 +10222,7 @@ var SharedViewFormModal = ({
|
|
|
10026
10222
|
onClose,
|
|
10027
10223
|
style: { width: "540px" }
|
|
10028
10224
|
},
|
|
10029
|
-
/* @__PURE__ */
|
|
10225
|
+
/* @__PURE__ */ React24.createElement(
|
|
10030
10226
|
Modal3.Header,
|
|
10031
10227
|
{
|
|
10032
10228
|
onClose,
|
|
@@ -10037,9 +10233,9 @@ var SharedViewFormModal = ({
|
|
|
10037
10233
|
paddingRight: spacing3.xl
|
|
10038
10234
|
}
|
|
10039
10235
|
},
|
|
10040
|
-
/* @__PURE__ */
|
|
10236
|
+
/* @__PURE__ */ React24.createElement(Modal3.Heading, null, I18n.t("savedViews.modal.create.title"))
|
|
10041
10237
|
),
|
|
10042
|
-
/* @__PURE__ */
|
|
10238
|
+
/* @__PURE__ */ React24.createElement(
|
|
10043
10239
|
P3,
|
|
10044
10240
|
{
|
|
10045
10241
|
style: {
|
|
@@ -10054,7 +10250,7 @@ var SharedViewFormModal = ({
|
|
|
10054
10250
|
},
|
|
10055
10251
|
I18n.t("savedViews.modal.copyConfirmation.description")
|
|
10056
10252
|
),
|
|
10057
|
-
/* @__PURE__ */
|
|
10253
|
+
/* @__PURE__ */ React24.createElement(
|
|
10058
10254
|
Form3,
|
|
10059
10255
|
{
|
|
10060
10256
|
initialValues: {
|
|
@@ -10073,7 +10269,7 @@ var SharedViewFormModal = ({
|
|
|
10073
10269
|
onSubmit: handleOnSubmit,
|
|
10074
10270
|
validateOnChange: true
|
|
10075
10271
|
},
|
|
10076
|
-
/* @__PURE__ */
|
|
10272
|
+
/* @__PURE__ */ React24.createElement(Form3.Form, { name: "share-view-form" }, /* @__PURE__ */ React24.createElement(
|
|
10077
10273
|
Modal3.Body,
|
|
10078
10274
|
{
|
|
10079
10275
|
style: {
|
|
@@ -10082,22 +10278,22 @@ var SharedViewFormModal = ({
|
|
|
10082
10278
|
borderTop: `1px solid ${colors4.gray85}`
|
|
10083
10279
|
}
|
|
10084
10280
|
},
|
|
10085
|
-
errors && /* @__PURE__ */
|
|
10281
|
+
errors && /* @__PURE__ */ React24.createElement(ErrorBanner2, { style: { marginBottom: spacing3.xl } }, /* @__PURE__ */ React24.createElement(Banner2.Content, null, /* @__PURE__ */ React24.createElement(Banner2.Title, null, I18n.t("savedViews.modal.errors.title", {
|
|
10086
10282
|
mode: "create"
|
|
10087
|
-
})), /* @__PURE__ */
|
|
10088
|
-
/* @__PURE__ */
|
|
10283
|
+
})), /* @__PURE__ */ React24.createElement(Banner2.Body, null, (errors == null ? void 0 : errors.form) || I18n.t("savedViews.modal.errors.description.create")))),
|
|
10284
|
+
/* @__PURE__ */ React24.createElement(Form3.Row, null, /* @__PURE__ */ React24.createElement(
|
|
10089
10285
|
NameInputField,
|
|
10090
10286
|
{
|
|
10091
10287
|
error: errors == null ? void 0 : errors.name,
|
|
10092
10288
|
onResetMutations: handleNameChange
|
|
10093
10289
|
}
|
|
10094
10290
|
)),
|
|
10095
|
-
/* @__PURE__ */
|
|
10291
|
+
/* @__PURE__ */ React24.createElement(
|
|
10096
10292
|
Form3.Row,
|
|
10097
10293
|
{
|
|
10098
10294
|
style: { marginTop: (errors == null ? void 0 : errors.name) ? spacing3.xl : spacing3.none }
|
|
10099
10295
|
},
|
|
10100
|
-
/* @__PURE__ */
|
|
10296
|
+
/* @__PURE__ */ React24.createElement(
|
|
10101
10297
|
Form3.TextArea,
|
|
10102
10298
|
{
|
|
10103
10299
|
name: "description",
|
|
@@ -10108,7 +10304,7 @@ var SharedViewFormModal = ({
|
|
|
10108
10304
|
}
|
|
10109
10305
|
)
|
|
10110
10306
|
)
|
|
10111
|
-
), /* @__PURE__ */
|
|
10307
|
+
), /* @__PURE__ */ React24.createElement(Modal3.Footer, { style: { borderTop: `1px solid ${colors4.gray85}` } }, /* @__PURE__ */ React24.createElement(Flex4, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React24.createElement(Typography3, { color: "gray45", italic: true }, /* @__PURE__ */ React24.createElement(Typography3, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React24.createElement(Modal3.FooterButtons, null, /* @__PURE__ */ React24.createElement(
|
|
10112
10308
|
Button5,
|
|
10113
10309
|
{
|
|
10114
10310
|
variant: "secondary",
|
|
@@ -10117,7 +10313,7 @@ var SharedViewFormModal = ({
|
|
|
10117
10313
|
disabled: isCreating
|
|
10118
10314
|
},
|
|
10119
10315
|
I18n.t("savedViews.actions.viewTemporarily")
|
|
10120
|
-
), /* @__PURE__ */
|
|
10316
|
+
), /* @__PURE__ */ React24.createElement(
|
|
10121
10317
|
Button5,
|
|
10122
10318
|
{
|
|
10123
10319
|
type: "submit",
|
|
@@ -10133,8 +10329,7 @@ var SharedViewFormModal = ({
|
|
|
10133
10329
|
};
|
|
10134
10330
|
|
|
10135
10331
|
// src/utils/hooks/useViewSelection.ts
|
|
10136
|
-
import { useState as
|
|
10137
|
-
import { useSearchParams } from "react-router-dom";
|
|
10332
|
+
import { useState as useState4, useCallback as useCallback4, useEffect as useEffect4, useRef as useRef3, useMemo as useMemo3 } from "react";
|
|
10138
10333
|
import { useI18nContext as useI18nContext11 } from "@procore/core-react";
|
|
10139
10334
|
|
|
10140
10335
|
// src/utils/viewStorage.ts
|
|
@@ -10160,13 +10355,13 @@ var ViewStorage = {
|
|
|
10160
10355
|
};
|
|
10161
10356
|
|
|
10162
10357
|
// src/utils/hooks/useLatest.ts
|
|
10163
|
-
import { useCallback as
|
|
10358
|
+
import { useCallback as useCallback3, useLayoutEffect, useRef as useRef2 } from "react";
|
|
10164
10359
|
var useLatest = (callback) => {
|
|
10165
10360
|
const ref = useRef2(callback);
|
|
10166
10361
|
useLayoutEffect(() => {
|
|
10167
10362
|
ref.current = callback;
|
|
10168
10363
|
});
|
|
10169
|
-
return
|
|
10364
|
+
return useCallback3((...args) => ref.current(...args), []);
|
|
10170
10365
|
};
|
|
10171
10366
|
|
|
10172
10367
|
// src/utils/hooks/useViewSelection.ts
|
|
@@ -10179,16 +10374,10 @@ var areRowGroupStatesEqual = (a2, b2) => {
|
|
|
10179
10374
|
if (a2.length !== b2.length) return false;
|
|
10180
10375
|
return a2.every((val, idx) => val === b2[idx]);
|
|
10181
10376
|
};
|
|
10182
|
-
var
|
|
10183
|
-
|
|
10184
|
-
if (view.id === "
|
|
10185
|
-
|
|
10186
|
-
} else if (view.id === "temporary") {
|
|
10187
|
-
updatedParams.set("saved-view", "temporary");
|
|
10188
|
-
} else {
|
|
10189
|
-
updatedParams.set("saved-view", view.share_token);
|
|
10190
|
-
}
|
|
10191
|
-
return updatedParams;
|
|
10377
|
+
var getViewTokenForView = (view) => {
|
|
10378
|
+
if (view.id === "default") return "default";
|
|
10379
|
+
if (view.id === "temporary") return "temporary";
|
|
10380
|
+
return view.share_token;
|
|
10192
10381
|
};
|
|
10193
10382
|
var checkIsViewSelected = (selectedView, viewId) => {
|
|
10194
10383
|
return (selectedView == null ? void 0 : selectedView.share_token) === viewId || (selectedView == null ? void 0 : selectedView.id) === viewId;
|
|
@@ -10196,55 +10385,40 @@ var checkIsViewSelected = (selectedView, viewId) => {
|
|
|
10196
10385
|
var findViewByToken = (views, token2) => {
|
|
10197
10386
|
return views.find((view) => view.share_token === token2);
|
|
10198
10387
|
};
|
|
10199
|
-
var setViewInUrl = (view, setSearchParams) => {
|
|
10200
|
-
setSearchParams(
|
|
10201
|
-
(currentParams) => getUpdatedSearchParams(currentParams, view),
|
|
10202
|
-
{ replace: true }
|
|
10203
|
-
);
|
|
10204
|
-
};
|
|
10205
|
-
var restoreUrlParameter = (currentParam, previousParam, setSearchParams) => {
|
|
10206
|
-
if (previousParam && !currentParam) {
|
|
10207
|
-
setSearchParams(
|
|
10208
|
-
(currentParams) => {
|
|
10209
|
-
const updatedParams = new URLSearchParams(currentParams);
|
|
10210
|
-
updatedParams.set("saved-view", previousParam);
|
|
10211
|
-
return updatedParams;
|
|
10212
|
-
},
|
|
10213
|
-
{ replace: true }
|
|
10214
|
-
);
|
|
10215
|
-
}
|
|
10216
|
-
};
|
|
10217
10388
|
var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, tableConfig) => {
|
|
10218
10389
|
const I18n = useI18nContext11();
|
|
10390
|
+
const transport = useSavedViewsTransport();
|
|
10391
|
+
const urlAdapter = transport.useUrlAdapter();
|
|
10219
10392
|
const projectIdSegment = config.projectId ?? "company";
|
|
10220
10393
|
const storageKey = `savedView_${config.domain}_${config.tableName}_${config.companyId}_${projectIdSegment}_${config.userId}`;
|
|
10221
10394
|
const temporaryStorageKey = `${storageKey}-temporary`;
|
|
10222
|
-
const [searchParams, setSearchParams] = useSearchParams();
|
|
10223
10395
|
const previousSavedViewParamRef = useRef3(null);
|
|
10224
|
-
const
|
|
10396
|
+
const intendedTokenRef = useRef3(null);
|
|
10397
|
+
const [selectedSavedView, setSelectedSavedView] = useState4(() => {
|
|
10225
10398
|
const stored = ViewStorage.load(storageKey, config.defaultView);
|
|
10226
10399
|
return stored ?? config.defaultView;
|
|
10227
10400
|
});
|
|
10228
|
-
const [temporaryView, setTemporaryView] =
|
|
10401
|
+
const [temporaryView, setTemporaryView] = useState4(() => {
|
|
10229
10402
|
const loaded = ViewStorage.load(temporaryStorageKey, config.defaultView);
|
|
10230
10403
|
return loaded && (loaded.id === "temporary" || loaded.view_level === "temporary") ? loaded : null;
|
|
10231
10404
|
});
|
|
10232
|
-
const persistViewToStorageAndUrl =
|
|
10405
|
+
const persistViewToStorageAndUrl = useCallback4(
|
|
10233
10406
|
(view) => {
|
|
10234
10407
|
ViewStorage.save(storageKey, view);
|
|
10235
|
-
|
|
10408
|
+
intendedTokenRef.current = getViewTokenForView(view);
|
|
10409
|
+
urlAdapter.setViewToken(getViewTokenForView(view));
|
|
10236
10410
|
},
|
|
10237
|
-
[storageKey,
|
|
10411
|
+
[storageKey, urlAdapter]
|
|
10238
10412
|
);
|
|
10239
|
-
const baseViews =
|
|
10413
|
+
const baseViews = useMemo3(
|
|
10240
10414
|
() => [...savedViews ?? [], ...presetViews ?? []],
|
|
10241
10415
|
[savedViews, presetViews]
|
|
10242
10416
|
);
|
|
10243
|
-
const allViews =
|
|
10417
|
+
const allViews = useMemo3(
|
|
10244
10418
|
() => temporaryView ? [...baseViews, temporaryView] : baseViews,
|
|
10245
10419
|
[baseViews, temporaryView]
|
|
10246
10420
|
);
|
|
10247
|
-
const selectView =
|
|
10421
|
+
const selectView = useCallback4(
|
|
10248
10422
|
(view) => {
|
|
10249
10423
|
const viewToSelect = config.onSelect({ item: view });
|
|
10250
10424
|
setSelectedSavedView(viewToSelect);
|
|
@@ -10253,7 +10427,7 @@ var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, ta
|
|
|
10253
10427
|
},
|
|
10254
10428
|
[config, persistViewToStorageAndUrl]
|
|
10255
10429
|
);
|
|
10256
|
-
const createTemporaryView =
|
|
10430
|
+
const createTemporaryView = useCallback4(
|
|
10257
10431
|
(fetchedView) => {
|
|
10258
10432
|
const tempView = {
|
|
10259
10433
|
...fetchedView,
|
|
@@ -10268,12 +10442,12 @@ var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, ta
|
|
|
10268
10442
|
},
|
|
10269
10443
|
[temporaryStorageKey, selectView]
|
|
10270
10444
|
);
|
|
10271
|
-
const clearTemporaryView =
|
|
10445
|
+
const clearTemporaryView = useCallback4(() => {
|
|
10272
10446
|
ViewStorage.remove(temporaryStorageKey);
|
|
10273
10447
|
setTemporaryView(null);
|
|
10274
10448
|
selectView(config.defaultView);
|
|
10275
10449
|
}, [temporaryStorageKey, config.defaultView, selectView]);
|
|
10276
|
-
const isViewAlreadySelected =
|
|
10450
|
+
const isViewAlreadySelected = useCallback4(
|
|
10277
10451
|
(viewId) => checkIsViewSelected(selectedSavedView, viewId),
|
|
10278
10452
|
[selectedSavedView]
|
|
10279
10453
|
);
|
|
@@ -10288,20 +10462,26 @@ var useViewSelection = (config, savedViews, presetViews, openSharedViewModal, ta
|
|
|
10288
10462
|
openSharedViewModal(viewId);
|
|
10289
10463
|
}
|
|
10290
10464
|
});
|
|
10465
|
+
const savedViewIdFromUrl = urlAdapter.getViewToken();
|
|
10291
10466
|
useEffect4(() => {
|
|
10292
|
-
const
|
|
10293
|
-
|
|
10294
|
-
|
|
10295
|
-
|
|
10296
|
-
|
|
10297
|
-
)
|
|
10298
|
-
|
|
10299
|
-
|
|
10467
|
+
const intendedToken = intendedTokenRef.current;
|
|
10468
|
+
if (intendedToken !== null && savedViewIdFromUrl !== intendedToken) {
|
|
10469
|
+
urlAdapter.setViewToken(intendedToken);
|
|
10470
|
+
return;
|
|
10471
|
+
}
|
|
10472
|
+
if (intendedToken !== null && savedViewIdFromUrl === intendedToken) {
|
|
10473
|
+
intendedTokenRef.current = null;
|
|
10474
|
+
}
|
|
10475
|
+
if (previousSavedViewParamRef.current && !savedViewIdFromUrl) {
|
|
10476
|
+
urlAdapter.setViewToken(previousSavedViewParamRef.current);
|
|
10477
|
+
}
|
|
10478
|
+
if (savedViewIdFromUrl) {
|
|
10479
|
+
previousSavedViewParamRef.current = savedViewIdFromUrl;
|
|
10300
10480
|
}
|
|
10301
|
-
if (
|
|
10302
|
-
handleSavedViewFromUrl(
|
|
10481
|
+
if (savedViewIdFromUrl && savedViews) {
|
|
10482
|
+
handleSavedViewFromUrl(savedViewIdFromUrl);
|
|
10303
10483
|
}
|
|
10304
|
-
}, [
|
|
10484
|
+
}, [savedViewIdFromUrl, handleSavedViewFromUrl, allViews.length, urlAdapter]);
|
|
10305
10485
|
const previousRowGroupStateRef = useRef3(
|
|
10306
10486
|
isSmartGridConfig(tableConfig) ? tableConfig.rowGroupState : void 0
|
|
10307
10487
|
);
|
|
@@ -10400,11 +10580,28 @@ var FocusScopeToggle = ({ isOpen }) => {
|
|
|
10400
10580
|
|
|
10401
10581
|
// src/components/saved-views/SavedViews.tsx
|
|
10402
10582
|
import { FocusScope } from "@react-aria/focus";
|
|
10583
|
+
|
|
10584
|
+
// src/transport/default-lazy.ts
|
|
10585
|
+
var cached;
|
|
10586
|
+
var inFlight;
|
|
10587
|
+
var getCachedDefaultTransport = () => cached;
|
|
10588
|
+
var loadDefaultTransport = () => {
|
|
10589
|
+
if (cached) return Promise.resolve(cached);
|
|
10590
|
+
if (inFlight) return inFlight;
|
|
10591
|
+
inFlight = import("./transport/default.mjs").then((mod) => {
|
|
10592
|
+
cached = mod.defaultTransport;
|
|
10593
|
+
inFlight = void 0;
|
|
10594
|
+
return mod.defaultTransport;
|
|
10595
|
+
});
|
|
10596
|
+
return inFlight;
|
|
10597
|
+
};
|
|
10598
|
+
|
|
10599
|
+
// src/components/saved-views/SavedViews.tsx
|
|
10403
10600
|
var StyledPanel = pt.div`
|
|
10404
10601
|
border: ${({ provider }) => provider === "data-table" ? "1px solid #d6dadc" : "none"};
|
|
10405
10602
|
`;
|
|
10406
|
-
var queryClient = new QueryClient();
|
|
10407
10603
|
var SavedViewsContent = (props) => {
|
|
10604
|
+
var _a;
|
|
10408
10605
|
const { projectId, companyId } = props;
|
|
10409
10606
|
const queryInput = {
|
|
10410
10607
|
domain: props.domain,
|
|
@@ -10416,13 +10613,13 @@ var SavedViewsContent = (props) => {
|
|
|
10416
10613
|
const { mutate: deleteSavedView } = useDeleteSavedView(queryInput);
|
|
10417
10614
|
const { showToast } = useToastAlertContext3();
|
|
10418
10615
|
const i18n = useI18nContext12();
|
|
10419
|
-
const [activeModal, setActiveModal] =
|
|
10420
|
-
const [modalData, setModalData] =
|
|
10616
|
+
const [activeModal, setActiveModal] = useState5(null);
|
|
10617
|
+
const [modalData, setModalData] = useState5(null);
|
|
10421
10618
|
const openModal = (type, data) => {
|
|
10422
10619
|
setActiveModal(type);
|
|
10423
10620
|
setModalData(data ?? null);
|
|
10424
10621
|
};
|
|
10425
|
-
const closeModal =
|
|
10622
|
+
const closeModal = useCallback5(() => {
|
|
10426
10623
|
setActiveModal(null);
|
|
10427
10624
|
setModalData(null);
|
|
10428
10625
|
}, []);
|
|
@@ -10469,6 +10666,10 @@ var SavedViewsContent = (props) => {
|
|
|
10469
10666
|
closeModal();
|
|
10470
10667
|
}
|
|
10471
10668
|
}, [fetchError, selectedView, props.defaultView, selectView, closeModal]);
|
|
10669
|
+
const setSelectedViewInContext = (_a = useSavedViewsSelection()) == null ? void 0 : _a.setSelectedView;
|
|
10670
|
+
useEffect6(() => {
|
|
10671
|
+
setSelectedViewInContext == null ? void 0 : setSelectedViewInContext(selectedView ?? null);
|
|
10672
|
+
}, [selectedView, setSelectedViewInContext]);
|
|
10472
10673
|
const viewSharedViewTemporarily = () => {
|
|
10473
10674
|
if (fetchedView) {
|
|
10474
10675
|
createTemporaryView(fetchedView);
|
|
@@ -10510,19 +10711,19 @@ var SavedViewsContent = (props) => {
|
|
|
10510
10711
|
deleteSelectedView();
|
|
10511
10712
|
closeModal();
|
|
10512
10713
|
};
|
|
10513
|
-
return /* @__PURE__ */
|
|
10714
|
+
return /* @__PURE__ */ React25.createElement(FocusScope, { contain: false }, /* @__PURE__ */ React25.createElement(StyledPanel, { id: "saved-views-panel", provider: props.provider }, /* @__PURE__ */ React25.createElement(FocusScopeToggle, { isOpen: props.isPanelOpen ?? true }), /* @__PURE__ */ React25.createElement(
|
|
10514
10715
|
ExpandedPanel,
|
|
10515
10716
|
{
|
|
10516
10717
|
"data-testid": "saved-view-expanded-panel",
|
|
10517
10718
|
provider: props.provider
|
|
10518
10719
|
},
|
|
10519
|
-
/* @__PURE__ */
|
|
10520
|
-
|
|
10720
|
+
/* @__PURE__ */ React25.createElement(Panel3.Header, { id: "saved-views-collections-panel-header" }, /* @__PURE__ */ React25.createElement(Panel3.Title, null, /* @__PURE__ */ React25.createElement(Flex5, { alignItems: "center" }, /* @__PURE__ */ React25.createElement(Box3, { paddingRight: "sm" }, i18n.t("savedViews.title")), /* @__PURE__ */ React25.createElement(
|
|
10721
|
+
Tooltip2,
|
|
10521
10722
|
{
|
|
10522
10723
|
showDelay: 200,
|
|
10523
|
-
overlay: /* @__PURE__ */
|
|
10724
|
+
overlay: /* @__PURE__ */ React25.createElement(Tooltip2.Content, null, i18n.t("savedViews.tooltip"))
|
|
10524
10725
|
},
|
|
10525
|
-
/* @__PURE__ */
|
|
10726
|
+
/* @__PURE__ */ React25.createElement(
|
|
10526
10727
|
Help_default,
|
|
10527
10728
|
{
|
|
10528
10729
|
tabIndex: 0,
|
|
@@ -10530,16 +10731,16 @@ var SavedViewsContent = (props) => {
|
|
|
10530
10731
|
"aria-label": i18n.t("savedViews.tooltip")
|
|
10531
10732
|
}
|
|
10532
10733
|
)
|
|
10533
|
-
))), /* @__PURE__ */
|
|
10534
|
-
|
|
10734
|
+
))), /* @__PURE__ */ React25.createElement(
|
|
10735
|
+
Tooltip2,
|
|
10535
10736
|
{
|
|
10536
10737
|
overlay: i18n.t("savedViews.actions.create"),
|
|
10537
10738
|
showDelay: 1e3
|
|
10538
10739
|
},
|
|
10539
|
-
/* @__PURE__ */
|
|
10740
|
+
/* @__PURE__ */ React25.createElement(
|
|
10540
10741
|
Button6,
|
|
10541
10742
|
{
|
|
10542
|
-
icon: /* @__PURE__ */
|
|
10743
|
+
icon: /* @__PURE__ */ React25.createElement(Plus_default, null),
|
|
10543
10744
|
variant: "secondary",
|
|
10544
10745
|
"data-testid": "expanded-panel-create-button",
|
|
10545
10746
|
onClick: () => openModal("create" /* CREATE */),
|
|
@@ -10548,7 +10749,7 @@ var SavedViewsContent = (props) => {
|
|
|
10548
10749
|
i18n.t("savedViews.actions.create")
|
|
10549
10750
|
)
|
|
10550
10751
|
)),
|
|
10551
|
-
/* @__PURE__ */
|
|
10752
|
+
/* @__PURE__ */ React25.createElement(Panel3.Body, { style: { display: "flex", flexFlow: "column" } }, /* @__PURE__ */ React25.createElement(
|
|
10552
10753
|
PanelContent,
|
|
10553
10754
|
{
|
|
10554
10755
|
onSelect: ({ item }) => selectView(item),
|
|
@@ -10565,7 +10766,7 @@ var SavedViewsContent = (props) => {
|
|
|
10565
10766
|
onClearTemporary: clearTemporaryView
|
|
10566
10767
|
}
|
|
10567
10768
|
))
|
|
10568
|
-
), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */
|
|
10769
|
+
), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */ React25.createElement(
|
|
10569
10770
|
FormModal,
|
|
10570
10771
|
{
|
|
10571
10772
|
open: true,
|
|
@@ -10579,14 +10780,14 @@ var SavedViewsContent = (props) => {
|
|
|
10579
10780
|
setOpenEditCreateModal: closeModal,
|
|
10580
10781
|
defaultView: props.defaultView
|
|
10581
10782
|
}
|
|
10582
|
-
), selectedView && isModalOpen("delete" /* DELETE */) && /* @__PURE__ */
|
|
10783
|
+
), selectedView && isModalOpen("delete" /* DELETE */) && /* @__PURE__ */ React25.createElement(
|
|
10583
10784
|
SavedViewsDeleteConfirmationModalShared,
|
|
10584
10785
|
{
|
|
10585
10786
|
open: true,
|
|
10586
10787
|
onDelete: confirmDeleteAndCloseModal,
|
|
10587
10788
|
onCancel: closeModal
|
|
10588
10789
|
}
|
|
10589
|
-
), fetchedView && isModalOpen("sharedView" /* SHARED_VIEW */) && /* @__PURE__ */
|
|
10790
|
+
), fetchedView && isModalOpen("sharedView" /* SHARED_VIEW */) && /* @__PURE__ */ React25.createElement(
|
|
10590
10791
|
SharedViewFormModal,
|
|
10591
10792
|
{
|
|
10592
10793
|
open: true,
|
|
@@ -10601,14 +10802,34 @@ var SavedViewsContent = (props) => {
|
|
|
10601
10802
|
)));
|
|
10602
10803
|
};
|
|
10603
10804
|
var SavedViews = (props) => {
|
|
10604
|
-
|
|
10805
|
+
const [resolvedDefault, setResolvedDefault] = useState5(() => props.transport ? void 0 : getCachedDefaultTransport());
|
|
10806
|
+
const [transportLoadError, setTransportLoadError] = useState5(void 0);
|
|
10807
|
+
useEffect6(() => {
|
|
10808
|
+
if (props.transport || resolvedDefault) return;
|
|
10809
|
+
let cancelled = false;
|
|
10810
|
+
void loadDefaultTransport().then((transport2) => {
|
|
10811
|
+
if (!cancelled) setResolvedDefault(transport2);
|
|
10812
|
+
}).catch((err) => {
|
|
10813
|
+
if (!cancelled) setTransportLoadError(err);
|
|
10814
|
+
});
|
|
10815
|
+
return () => {
|
|
10816
|
+
cancelled = true;
|
|
10817
|
+
};
|
|
10818
|
+
}, [props.transport, resolvedDefault]);
|
|
10819
|
+
const transport = props.transport ?? resolvedDefault;
|
|
10820
|
+
if (!transport) {
|
|
10821
|
+
if (transportLoadError) throw transportLoadError;
|
|
10822
|
+
return null;
|
|
10823
|
+
}
|
|
10824
|
+
const { CacheProvider } = transport;
|
|
10825
|
+
return /* @__PURE__ */ React25.createElement(EnvironmentI18nProvider, null, /* @__PURE__ */ React25.createElement(SavedViewsTransportProvider, { transport }, /* @__PURE__ */ React25.createElement(CacheProvider, null, /* @__PURE__ */ React25.createElement(ToastAlertProvider, null, /* @__PURE__ */ React25.createElement(SavedViewsContent, { ...props })))));
|
|
10605
10826
|
};
|
|
10606
10827
|
|
|
10607
10828
|
// src/components/adapters/smart-grid/SmartGridSavedViews.tsx
|
|
10608
|
-
import
|
|
10829
|
+
import React26, { useCallback as useCallback6 } from "react";
|
|
10609
10830
|
|
|
10610
10831
|
// src/components/adapters/smart-grid/SmartGridDefaultSavedView.tsx
|
|
10611
|
-
import { useMemo as
|
|
10832
|
+
import { useMemo as useMemo4 } from "react";
|
|
10612
10833
|
var DEFAULT_COLUMN_STATE = {
|
|
10613
10834
|
hide: false,
|
|
10614
10835
|
pinned: null,
|
|
@@ -10656,7 +10877,7 @@ var extractDefaultView = (gridApi, receivedConfig) => {
|
|
|
10656
10877
|
return result;
|
|
10657
10878
|
};
|
|
10658
10879
|
var useNormalizedDefaultViews = (defaultViews, gridApi) => {
|
|
10659
|
-
return
|
|
10880
|
+
return useMemo4(() => {
|
|
10660
10881
|
if (!gridApi)
|
|
10661
10882
|
return defaultViews.map((view) => ({ ...view, share_token: view.id }));
|
|
10662
10883
|
return defaultViews.map((view) => ({
|
|
@@ -10668,7 +10889,7 @@ var useNormalizedDefaultViews = (defaultViews, gridApi) => {
|
|
|
10668
10889
|
};
|
|
10669
10890
|
|
|
10670
10891
|
// src/components/adapters/smart-grid/useSmartGridConfig.ts
|
|
10671
|
-
import { useState as
|
|
10892
|
+
import { useState as useState6, useEffect as useEffect7 } from "react";
|
|
10672
10893
|
var GRID_STATE_EVENTS = [
|
|
10673
10894
|
"sortChanged",
|
|
10674
10895
|
"filterOpened",
|
|
@@ -10684,7 +10905,7 @@ var GRID_STATE_EVENTS = [
|
|
|
10684
10905
|
"gridReady"
|
|
10685
10906
|
];
|
|
10686
10907
|
var useSmartGridConfig = (gridApi) => {
|
|
10687
|
-
const [config, setConfig] =
|
|
10908
|
+
const [config, setConfig] = useState6(
|
|
10688
10909
|
() => getSmartGridConfig(gridApi)
|
|
10689
10910
|
);
|
|
10690
10911
|
useEffect7(() => {
|
|
@@ -10705,11 +10926,11 @@ var useSmartGridConfig = (gridApi) => {
|
|
|
10705
10926
|
};
|
|
10706
10927
|
|
|
10707
10928
|
// src/components/adapters/smart-grid/useSavedViewsPanelOpen.ts
|
|
10708
|
-
import { useEffect as useEffect8, useState as
|
|
10929
|
+
import { useEffect as useEffect8, useState as useState7 } from "react";
|
|
10709
10930
|
var SAVED_VIEWS_PANEL_ID = "savedViews";
|
|
10710
10931
|
var useSavedViewsPanelOpen = (gridApi) => {
|
|
10711
10932
|
var _a;
|
|
10712
|
-
const [isOpen, setIsOpen] =
|
|
10933
|
+
const [isOpen, setIsOpen] = useState7(
|
|
10713
10934
|
((_a = gridApi.getOpenedToolPanel) == null ? void 0 : _a.call(gridApi)) === SAVED_VIEWS_PANEL_ID
|
|
10714
10935
|
);
|
|
10715
10936
|
useEffect8(() => {
|
|
@@ -10735,7 +10956,7 @@ var SmartGridSavedViews = (props) => {
|
|
|
10735
10956
|
const isPanelOpen = useSavedViewsPanelOpen(gridApi);
|
|
10736
10957
|
const presetViews = useNormalizedDefaultViews(props.defaultViews, gridApi);
|
|
10737
10958
|
const defaultView = presetViews.find((view) => view.id === "default") ?? presetViews[0];
|
|
10738
|
-
const onSelect =
|
|
10959
|
+
const onSelect = useCallback6(
|
|
10739
10960
|
({ item }) => {
|
|
10740
10961
|
var _a;
|
|
10741
10962
|
if (!gridApi) return item;
|
|
@@ -10763,7 +10984,7 @@ var SmartGridSavedViews = (props) => {
|
|
|
10763
10984
|
},
|
|
10764
10985
|
[gridApi, tableConfig, setTableConfig]
|
|
10765
10986
|
);
|
|
10766
|
-
return /* @__PURE__ */
|
|
10987
|
+
return /* @__PURE__ */ React26.createElement(
|
|
10767
10988
|
SavedViews,
|
|
10768
10989
|
{
|
|
10769
10990
|
onSelect,
|
|
@@ -10776,21 +10997,22 @@ var SmartGridSavedViews = (props) => {
|
|
|
10776
10997
|
presetViews,
|
|
10777
10998
|
tableName: props.tableName,
|
|
10778
10999
|
tableConfig,
|
|
10779
|
-
isPanelOpen
|
|
11000
|
+
isPanelOpen,
|
|
11001
|
+
transport: props.transport
|
|
10780
11002
|
}
|
|
10781
11003
|
);
|
|
10782
11004
|
};
|
|
10783
11005
|
|
|
10784
11006
|
// src/components/adapters/data-table/DataTableSavedViews.tsx
|
|
10785
|
-
import
|
|
11007
|
+
import React27, {
|
|
10786
11008
|
forwardRef as forwardRef11,
|
|
10787
11009
|
useImperativeHandle,
|
|
10788
|
-
useState as
|
|
10789
|
-
useCallback as
|
|
11010
|
+
useState as useState8,
|
|
11011
|
+
useCallback as useCallback7
|
|
10790
11012
|
} from "react";
|
|
10791
11013
|
|
|
10792
11014
|
// src/components/adapters/data-table/DataTableDefaultSavedView.tsx
|
|
10793
|
-
import { useMemo as
|
|
11015
|
+
import { useMemo as useMemo5 } from "react";
|
|
10794
11016
|
var DEFAULT_COLUMN_STATE2 = {
|
|
10795
11017
|
hidden: false,
|
|
10796
11018
|
pinned: null,
|
|
@@ -10838,7 +11060,7 @@ var extractDefaultView2 = (columnDefinitions, receivedConfigFromTool) => {
|
|
|
10838
11060
|
return result;
|
|
10839
11061
|
};
|
|
10840
11062
|
var useNormalizedDefaultViews2 = (defaultViews, columnDefinitions) => {
|
|
10841
|
-
return
|
|
11063
|
+
return useMemo5(
|
|
10842
11064
|
() => defaultViews.map((view) => ({
|
|
10843
11065
|
...view,
|
|
10844
11066
|
share_token: view.id,
|
|
@@ -10856,7 +11078,7 @@ var DataTableSavedViews = forwardRef11((props, ref) => {
|
|
|
10856
11078
|
props.columnDefinitions
|
|
10857
11079
|
);
|
|
10858
11080
|
const defaultView = presetViews.find((view) => view.id === "default") ?? presetViews[0];
|
|
10859
|
-
const [internalTableConfig, setInternalTableConfig] =
|
|
11081
|
+
const [internalTableConfig, setInternalTableConfig] = useState8(
|
|
10860
11082
|
ViewStorage.load(props.stickyViewsKey, defaultView).table_config
|
|
10861
11083
|
);
|
|
10862
11084
|
useImperativeHandle(ref, () => ({
|
|
@@ -10864,7 +11086,7 @@ var DataTableSavedViews = forwardRef11((props, ref) => {
|
|
|
10864
11086
|
setInternalTableConfig(newConfig);
|
|
10865
11087
|
}
|
|
10866
11088
|
}));
|
|
10867
|
-
const onSelect =
|
|
11089
|
+
const onSelect = useCallback7(
|
|
10868
11090
|
({ item }) => {
|
|
10869
11091
|
var _a;
|
|
10870
11092
|
const isPresetView = item.view_level === "default";
|
|
@@ -10888,7 +11110,7 @@ var DataTableSavedViews = forwardRef11((props, ref) => {
|
|
|
10888
11110
|
if (!internalTableConfig) {
|
|
10889
11111
|
return null;
|
|
10890
11112
|
}
|
|
10891
|
-
return /* @__PURE__ */
|
|
11113
|
+
return /* @__PURE__ */ React27.createElement(
|
|
10892
11114
|
SavedViews,
|
|
10893
11115
|
{
|
|
10894
11116
|
onSelect,
|
|
@@ -10900,7 +11122,8 @@ var DataTableSavedViews = forwardRef11((props, ref) => {
|
|
|
10900
11122
|
defaultView,
|
|
10901
11123
|
presetViews,
|
|
10902
11124
|
tableName: props.tableName,
|
|
10903
|
-
tableConfig: internalTableConfig
|
|
11125
|
+
tableConfig: internalTableConfig,
|
|
11126
|
+
transport: props.transport
|
|
10904
11127
|
}
|
|
10905
11128
|
);
|
|
10906
11129
|
});
|
|
@@ -10913,9 +11136,11 @@ export {
|
|
|
10913
11136
|
SavedViewCollectionMenuItem,
|
|
10914
11137
|
SavedViews,
|
|
10915
11138
|
SavedViewsDeleteConfirmationModalShared,
|
|
11139
|
+
SavedViewsSelectionProvider,
|
|
10916
11140
|
SmartGridSavedViews,
|
|
10917
11141
|
getTranslations,
|
|
10918
|
-
useSavedViewsPanel_default as useSavedViewsPanel
|
|
11142
|
+
useSavedViewsPanel_default as useSavedViewsPanel,
|
|
11143
|
+
useSavedViewsSelection
|
|
10919
11144
|
};
|
|
10920
11145
|
/*! Bundled license information:
|
|
10921
11146
|
|