@perses-dev/plugin-system 0.54.0-beta.0 → 0.54.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/dist/cjs/components/CalculationSelector/CalculationSelector.js +3 -3
  2. package/dist/cjs/components/DatasourceEditorForm/DatasourceEditorForm.js +2 -3
  3. package/dist/cjs/components/LegendOptionsEditor/LegendOptionsEditor.js +4 -5
  4. package/dist/cjs/components/PluginRegistry/PluginRegistry.js +11 -15
  5. package/dist/cjs/components/PluginRegistry/getPluginSearchHelper.js +92 -0
  6. package/dist/cjs/components/PluginRegistry/plugin-indexes.js +16 -13
  7. package/dist/cjs/components/Variables/VariableEditorForm/VariableEditorForm.js +2 -3
  8. package/dist/cjs/components/Variables/variable-model.js +115 -29
  9. package/dist/cjs/context/ValidationProvider.js +3 -3
  10. package/dist/cjs/model/alerts-queries.js +16 -0
  11. package/dist/cjs/model/calculations.js +178 -0
  12. package/dist/cjs/model/index.js +3 -0
  13. package/dist/cjs/model/legend.js +6 -5
  14. package/dist/cjs/model/log-volume-utils.js +10 -10
  15. package/dist/cjs/model/plugin-loading.js +24 -8
  16. package/dist/cjs/model/plugins.js +10 -0
  17. package/dist/cjs/model/silences-queries.js +16 -0
  18. package/dist/cjs/model/time-series-queries.js +10 -0
  19. package/dist/cjs/remote/PluginRuntime.js +38 -9
  20. package/dist/cjs/remote/remotePluginLoader.js +28 -5
  21. package/dist/cjs/runtime/DataQueriesProvider/DataQueriesProvider.js +18 -2
  22. package/dist/cjs/runtime/DataQueriesProvider/model.js +30 -4
  23. package/dist/cjs/runtime/UsageMetricsProvider.js +2 -2
  24. package/dist/cjs/runtime/alerts-queries.js +101 -0
  25. package/dist/cjs/runtime/index.js +2 -0
  26. package/dist/cjs/runtime/item-actions.js +3 -3
  27. package/dist/cjs/runtime/log-queries.js +4 -1
  28. package/dist/cjs/runtime/plugin-registry.js +12 -3
  29. package/dist/cjs/runtime/profile-queries.js +4 -1
  30. package/dist/cjs/runtime/silences-queries.js +101 -0
  31. package/dist/cjs/runtime/time-series-queries.js +4 -1
  32. package/dist/cjs/runtime/trace-queries.js +4 -1
  33. package/dist/cjs/test/mock-data.js +51 -0
  34. package/dist/cjs/test/test-plugins/bert/index.js +9 -12
  35. package/dist/cjs/test/test-plugins/ernie/index.js +9 -12
  36. package/dist/cjs/test/test-plugins/index.js +2 -2
  37. package/dist/cjs/test/utils.js +2 -2
  38. package/dist/cjs/test-utils/mock-plugin-registry.js +8 -2
  39. package/dist/cjs/utils/index.js +0 -1
  40. package/dist/components/CalculationSelector/CalculationSelector.d.ts +1 -1
  41. package/dist/components/CalculationSelector/CalculationSelector.d.ts.map +1 -1
  42. package/dist/components/CalculationSelector/CalculationSelector.js +2 -2
  43. package/dist/components/CalculationSelector/CalculationSelector.js.map +1 -1
  44. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts +2 -1
  45. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.d.ts.map +1 -1
  46. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js +2 -3
  47. package/dist/components/DatasourceEditorForm/DatasourceEditorForm.js.map +1 -1
  48. package/dist/components/DatasourceSelect/DatasourceSelect.js +2 -2
  49. package/dist/components/DatasourceSelect/DatasourceSelect.js.map +1 -1
  50. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +1 -1
  51. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
  52. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +1 -1
  53. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
  54. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +1 -1
  55. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js.map +1 -1
  56. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.d.ts.map +1 -1
  57. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js +2 -3
  58. package/dist/components/LegendOptionsEditor/LegendOptionsEditor.js.map +1 -1
  59. package/dist/components/MetricLabelInput/MetricLabelInput.js +1 -1
  60. package/dist/components/MetricLabelInput/MetricLabelInput.js.map +1 -1
  61. package/dist/components/MultiQueryEditor/MultiQueryEditor.d.ts +1 -1
  62. package/dist/components/MultiQueryEditor/MultiQueryEditor.js +1 -1
  63. package/dist/components/MultiQueryEditor/MultiQueryEditor.js.map +1 -1
  64. package/dist/components/MultiQueryEditor/QueryEditorContainer.js +1 -1
  65. package/dist/components/MultiQueryEditor/QueryEditorContainer.js.map +1 -1
  66. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js +1 -1
  67. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.js.map +1 -1
  68. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js +1 -1
  69. package/dist/components/OptionsEditorTabPanel/OptionsEditorTabPanel.js.map +1 -1
  70. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js +1 -1
  71. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.js.map +1 -1
  72. package/dist/components/PanelSpecEditor/PanelSpecEditor.js +1 -1
  73. package/dist/components/PanelSpecEditor/PanelSpecEditor.js.map +1 -1
  74. package/dist/components/PluginEditor/PluginEditor.js +1 -1
  75. package/dist/components/PluginEditor/PluginEditor.js.map +1 -1
  76. package/dist/components/PluginKindSelect/PluginKindSelect.js +1 -1
  77. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  78. package/dist/components/PluginRegistry/PluginRegistry.d.ts.map +1 -1
  79. package/dist/components/PluginRegistry/PluginRegistry.js +12 -16
  80. package/dist/components/PluginRegistry/PluginRegistry.js.map +1 -1
  81. package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts +12 -0
  82. package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts.map +1 -0
  83. package/dist/components/PluginRegistry/getPluginSearchHelper.js +88 -0
  84. package/dist/components/PluginRegistry/getPluginSearchHelper.js.map +1 -0
  85. package/dist/components/PluginRegistry/plugin-indexes.d.ts +4 -6
  86. package/dist/components/PluginRegistry/plugin-indexes.d.ts.map +1 -1
  87. package/dist/components/PluginRegistry/plugin-indexes.js +15 -13
  88. package/dist/components/PluginRegistry/plugin-indexes.js.map +1 -1
  89. package/dist/components/PluginSpecEditor/PluginSpecEditor.d.ts.map +1 -1
  90. package/dist/components/PluginSpecEditor/PluginSpecEditor.js +1 -1
  91. package/dist/components/PluginSpecEditor/PluginSpecEditor.js.map +1 -1
  92. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js +1 -1
  93. package/dist/components/SelectionOptionsEditor/SelectionOptionsEditor.js.map +1 -1
  94. package/dist/components/TimeRangeControls/TimeRangeControls.js +1 -1
  95. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  96. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts +1 -1
  97. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.d.ts.map +1 -1
  98. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js +2 -3
  99. package/dist/components/Variables/VariableEditorForm/VariableEditorForm.js.map +1 -1
  100. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +1 -1
  101. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  102. package/dist/components/Variables/variable-model.d.ts +9 -1
  103. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  104. package/dist/components/Variables/variable-model.js +117 -31
  105. package/dist/components/Variables/variable-model.js.map +1 -1
  106. package/dist/context/ValidationProvider.d.ts +1 -1
  107. package/dist/context/ValidationProvider.d.ts.map +1 -1
  108. package/dist/context/ValidationProvider.js +2 -2
  109. package/dist/context/ValidationProvider.js.map +1 -1
  110. package/dist/model/alerts-queries.d.ts +33 -0
  111. package/dist/model/alerts-queries.d.ts.map +1 -0
  112. package/dist/{utils/action.js → model/alerts-queries.js} +2 -14
  113. package/dist/model/alerts-queries.js.map +1 -0
  114. package/dist/model/calculations.d.ts +45 -0
  115. package/dist/model/calculations.d.ts.map +1 -0
  116. package/dist/model/calculations.js +165 -0
  117. package/dist/model/calculations.js.map +1 -0
  118. package/dist/model/index.d.ts +3 -0
  119. package/dist/model/index.d.ts.map +1 -1
  120. package/dist/model/index.js +3 -0
  121. package/dist/model/index.js.map +1 -1
  122. package/dist/model/legend.d.ts +3 -2
  123. package/dist/model/legend.d.ts.map +1 -1
  124. package/dist/model/legend.js +2 -1
  125. package/dist/model/legend.js.map +1 -1
  126. package/dist/model/plugin-loading.d.ts.map +1 -1
  127. package/dist/model/plugin-loading.js +24 -8
  128. package/dist/model/plugin-loading.js.map +1 -1
  129. package/dist/model/plugins.d.ts +21 -0
  130. package/dist/model/plugins.d.ts.map +1 -1
  131. package/dist/model/plugins.js +4 -1
  132. package/dist/model/plugins.js.map +1 -1
  133. package/dist/model/silences-queries.d.ts +33 -0
  134. package/dist/model/silences-queries.d.ts.map +1 -0
  135. package/dist/model/silences-queries.js +15 -0
  136. package/dist/model/silences-queries.js.map +1 -0
  137. package/dist/model/time-series-queries.d.ts +11 -1
  138. package/dist/model/time-series-queries.d.ts.map +1 -1
  139. package/dist/model/time-series-queries.js +4 -1
  140. package/dist/model/time-series-queries.js.map +1 -1
  141. package/dist/remote/PersesPlugin.types.d.ts +2 -0
  142. package/dist/remote/PersesPlugin.types.d.ts.map +1 -1
  143. package/dist/remote/PersesPlugin.types.js.map +1 -1
  144. package/dist/remote/PluginLoaderComponent.js +1 -1
  145. package/dist/remote/PluginLoaderComponent.js.map +1 -1
  146. package/dist/remote/PluginRuntime.d.ts +7 -1
  147. package/dist/remote/PluginRuntime.d.ts.map +1 -1
  148. package/dist/remote/PluginRuntime.js +38 -9
  149. package/dist/remote/PluginRuntime.js.map +1 -1
  150. package/dist/remote/remotePluginLoader.d.ts.map +1 -1
  151. package/dist/remote/remotePluginLoader.js +28 -5
  152. package/dist/remote/remotePluginLoader.js.map +1 -1
  153. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.d.ts.map +1 -1
  154. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js +19 -3
  155. package/dist/runtime/DataQueriesProvider/DataQueriesProvider.js.map +1 -1
  156. package/dist/runtime/DataQueriesProvider/model.d.ts.map +1 -1
  157. package/dist/runtime/DataQueriesProvider/model.js +30 -4
  158. package/dist/runtime/DataQueriesProvider/model.js.map +1 -1
  159. package/dist/runtime/QueryCountProvider.js +1 -1
  160. package/dist/runtime/QueryCountProvider.js.map +1 -1
  161. package/dist/runtime/RouterProvider.js +1 -1
  162. package/dist/runtime/RouterProvider.js.map +1 -1
  163. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js +1 -1
  164. package/dist/runtime/TimeRangeProvider/TimeRangeProvider.js.map +1 -1
  165. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +1 -1
  166. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
  167. package/dist/runtime/UsageMetricsProvider.js +2 -2
  168. package/dist/runtime/UsageMetricsProvider.js.map +1 -1
  169. package/dist/runtime/alerts-queries.d.ts +11 -0
  170. package/dist/runtime/alerts-queries.d.ts.map +1 -0
  171. package/dist/runtime/alerts-queries.js +89 -0
  172. package/dist/runtime/alerts-queries.js.map +1 -0
  173. package/dist/runtime/index.d.ts +2 -0
  174. package/dist/runtime/index.d.ts.map +1 -1
  175. package/dist/runtime/index.js +2 -0
  176. package/dist/runtime/index.js.map +1 -1
  177. package/dist/runtime/item-actions.js +1 -1
  178. package/dist/runtime/item-actions.js.map +1 -1
  179. package/dist/runtime/log-queries.js +4 -1
  180. package/dist/runtime/log-queries.js.map +1 -1
  181. package/dist/runtime/plugin-registry.d.ts +2 -1
  182. package/dist/runtime/plugin-registry.d.ts.map +1 -1
  183. package/dist/runtime/plugin-registry.js +12 -3
  184. package/dist/runtime/plugin-registry.js.map +1 -1
  185. package/dist/runtime/profile-queries.js +4 -1
  186. package/dist/runtime/profile-queries.js.map +1 -1
  187. package/dist/runtime/silences-queries.d.ts +11 -0
  188. package/dist/runtime/silences-queries.d.ts.map +1 -0
  189. package/dist/runtime/silences-queries.js +89 -0
  190. package/dist/runtime/silences-queries.js.map +1 -0
  191. package/dist/runtime/time-series-queries.js +4 -1
  192. package/dist/runtime/time-series-queries.js.map +1 -1
  193. package/dist/runtime/trace-queries.js +4 -1
  194. package/dist/runtime/trace-queries.js.map +1 -1
  195. package/dist/test/mock-data.d.ts +3 -1
  196. package/dist/test/mock-data.d.ts.map +1 -1
  197. package/dist/test/mock-data.js +45 -0
  198. package/dist/test/mock-data.js.map +1 -1
  199. package/dist/test/render.js +1 -1
  200. package/dist/test/render.js.map +1 -1
  201. package/dist/test/test-plugins/bert/index.d.ts +12 -6
  202. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  203. package/dist/test/test-plugins/bert/index.js +6 -2
  204. package/dist/test/test-plugins/bert/index.js.map +1 -1
  205. package/dist/test/test-plugins/ernie/index.d.ts +8 -6
  206. package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
  207. package/dist/test/test-plugins/ernie/index.js +6 -2
  208. package/dist/test/test-plugins/ernie/index.js.map +1 -1
  209. package/dist/test/test-plugins/index.js +2 -2
  210. package/dist/test/test-plugins/index.js.map +1 -1
  211. package/dist/test/utils.d.ts.map +1 -1
  212. package/dist/test/utils.js +2 -2
  213. package/dist/test/utils.js.map +1 -1
  214. package/dist/test-utils/mock-plugin-registry.d.ts.map +1 -1
  215. package/dist/test-utils/mock-plugin-registry.js +8 -2
  216. package/dist/test-utils/mock-plugin-registry.js.map +1 -1
  217. package/dist/utils/index.d.ts +0 -1
  218. package/dist/utils/index.d.ts.map +1 -1
  219. package/dist/utils/index.js +0 -1
  220. package/dist/utils/index.js.map +1 -1
  221. package/package.json +6 -5
  222. package/dist/cjs/utils/action.js +0 -43
  223. package/dist/utils/action.d.ts +0 -4
  224. package/dist/utils/action.d.ts.map +0 -1
  225. package/dist/utils/action.js.map +0 -1
@@ -1,4 +1,3 @@
1
- export * from './action';
2
1
  export * from './event';
3
2
  export * from './variables';
4
3
  export * from './csv-export';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAaA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAaA,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
@@ -10,7 +10,6 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export * from './action';
14
13
  export * from './event';
15
14
  export * from './variables';
16
15
  export * from './csv-export';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './action';\nexport * from './event';\nexport * from './variables';\nexport * from './csv-export';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,WAAW;AACzB,cAAc,UAAU;AACxB,cAAc,cAAc;AAC5B,cAAc,eAAe"}
1
+ {"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './event';\nexport * from './variables';\nexport * from './csv-export';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,UAAU;AACxB,cAAc,cAAc;AAC5B,cAAc,eAAe"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/plugin-system",
3
- "version": "0.54.0-beta.0",
3
+ "version": "0.54.0-beta.2",
4
4
  "description": "The plugin feature in Pereses",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/perses/perses/blob/main/README.md",
@@ -29,16 +29,17 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@module-federation/enhanced": "^2.3.3",
32
- "@perses-dev/components": "0.54.0-beta.0",
32
+ "@perses-dev/components": "0.54.0-beta.2",
33
33
  "@perses-dev/core": "0.53.0",
34
- "@perses-dev/spec": "0.2.0-beta.0",
34
+ "@perses-dev/spec": "0.2.0-beta.2",
35
+ "@perses-dev/client": "0.54.0-beta.2",
35
36
  "date-fns": "^4.1.0",
36
37
  "date-fns-tz": "^3.2.0",
37
38
  "immer": "^10.1.1",
38
39
  "react-hook-form": "^7.46.1",
39
- "use-immer": "^0.11.0",
40
40
  "use-query-params": "^2.2.1",
41
- "zod": "^3.25.76"
41
+ "zod": "^3.25.76",
42
+ "semver": "^7.8.0"
42
43
  },
43
44
  "peerDependencies": {
44
45
  "@emotion/react": "^11.14.0",
@@ -1,43 +0,0 @@
1
- // Copyright The Perses Authors
2
- // Licensed under the Apache License, Version 2.0 (the "License");
3
- // you may not use this file except in compliance with the License.
4
- // You may obtain a copy of the License at
5
- //
6
- // http://www.apache.org/licenses/LICENSE-2.0
7
- //
8
- // Unless required by applicable law or agreed to in writing, software
9
- // distributed under the License is distributed on an "AS IS" BASIS,
10
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
- // See the License for the specific language governing permissions and
12
- // limitations under the License.
13
- "use strict";
14
- Object.defineProperty(exports, "__esModule", {
15
- value: true
16
- });
17
- function _export(target, all) {
18
- for(var name in all)Object.defineProperty(target, name, {
19
- enumerable: true,
20
- get: Object.getOwnPropertyDescriptor(all, name).get
21
- });
22
- }
23
- _export(exports, {
24
- get getSubmitText () {
25
- return getSubmitText;
26
- },
27
- get getTitleAction () {
28
- return getTitleAction;
29
- }
30
- });
31
- function getTitleAction(action, isDraft) {
32
- if (action === 'read') return 'View';
33
- if (isDraft && action === 'create') return 'Add';
34
- if (!isDraft && action === 'create') return 'Create';
35
- if (action === 'update') return 'Edit';
36
- return '';
37
- }
38
- function getSubmitText(action, isDraft) {
39
- if (isDraft && action === 'create') return 'Add';
40
- if (isDraft && action === 'update') return 'Apply';
41
- if (!isDraft) return 'Save';
42
- return '';
43
- }
@@ -1,4 +0,0 @@
1
- import { Action } from '@perses-dev/core';
2
- export declare function getTitleAction(action: Action, isDraft: boolean): string;
3
- export declare function getSubmitText(action: Action, isDraft: boolean): string;
4
- //# sourceMappingURL=action.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../src/utils/action.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAMvE;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAKtE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/action.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Action } from '@perses-dev/core'; // TODO this is weird the plugin-system is providing component depending on the RBAC system of Perses.\n\nexport function getTitleAction(action: Action, isDraft: boolean): string {\n if (action === 'read') return 'View';\n if (isDraft && action === 'create') return 'Add';\n if (!isDraft && action === 'create') return 'Create';\n if (action === 'update') return 'Edit';\n return '';\n}\n\nexport function getSubmitText(action: Action, isDraft: boolean): string {\n if (isDraft && action === 'create') return 'Add';\n if (isDraft && action === 'update') return 'Apply';\n if (!isDraft) return 'Save';\n return '';\n}\n"],"names":["getTitleAction","action","isDraft","getSubmitText"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAIjC,OAAO,SAASA,eAAeC,MAAc,EAAEC,OAAgB;IAC7D,IAAID,WAAW,QAAQ,OAAO;IAC9B,IAAIC,WAAWD,WAAW,UAAU,OAAO;IAC3C,IAAI,CAACC,WAAWD,WAAW,UAAU,OAAO;IAC5C,IAAIA,WAAW,UAAU,OAAO;IAChC,OAAO;AACT;AAEA,OAAO,SAASE,cAAcF,MAAc,EAAEC,OAAgB;IAC5D,IAAIA,WAAWD,WAAW,UAAU,OAAO;IAC3C,IAAIC,WAAWD,WAAW,UAAU,OAAO;IAC3C,IAAI,CAACC,SAAS,OAAO;IACrB,OAAO;AACT"}