@vendure/dashboard 3.5.0-minor-202509261210 → 3.5.0-minor-202510031341
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 +4 -0
- package/dist/plugin/dashboard.plugin.d.ts +25 -6
- package/dist/plugin/dashboard.plugin.js +184 -27
- package/dist/plugin/default-page.html +188 -0
- package/dist/vite/vite-plugin-config.js +13 -9
- package/dist/vite/vite-plugin-translations.d.ts +22 -0
- package/dist/vite/vite-plugin-translations.js +66 -0
- package/dist/vite/vite-plugin-vendure-dashboard.js +8 -6
- package/lingui.config.js +25 -2
- package/package.json +159 -156
- package/src/app/app-providers.tsx +0 -4
- package/src/app/common/delete-bulk-action.tsx +6 -5
- package/src/app/common/duplicate-bulk-action.tsx +4 -5
- package/src/app/common/duplicate-entity-dialog.tsx +1 -1
- package/src/app/common/set-document-direction.ts +7 -0
- package/src/app/main.tsx +50 -17
- package/src/app/routes/_authenticated/_administrators/administrators.tsx +8 -6
- package/src/app/routes/_authenticated/_administrators/administrators_.$id.tsx +17 -6
- package/src/app/routes/_authenticated/_administrators/components/role-permissions-display.tsx +2 -2
- package/src/app/routes/_authenticated/_assets/assets.tsx +1 -1
- package/src/app/routes/_authenticated/_assets/assets_.$id.tsx +4 -4
- package/src/app/routes/_authenticated/_assets/components/asset-bulk-actions.tsx +8 -6
- package/src/app/routes/_authenticated/_assets/components/asset-tag-filter.tsx +1 -1
- package/src/app/routes/_authenticated/_assets/components/asset-tags-editor.tsx +1 -1
- package/src/app/routes/_authenticated/_assets/components/manage-tags-dialog.tsx +3 -8
- package/src/app/routes/_authenticated/_channels/channels.tsx +3 -6
- package/src/app/routes/_authenticated/_channels/channels_.$id.tsx +5 -5
- package/src/app/routes/_authenticated/_collections/collections.tsx +3 -4
- package/src/app/routes/_authenticated/_collections/collections_.$id.tsx +4 -6
- package/src/app/routes/_authenticated/_collections/components/collection-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_collections/components/collection-contents-sheet.tsx +1 -1
- package/src/app/routes/_authenticated/_collections/components/move-collections-dialog.tsx +6 -6
- package/src/app/routes/_authenticated/_countries/countries.graphql.ts +2 -0
- package/src/app/routes/_authenticated/_countries/countries.tsx +2 -3
- package/src/app/routes/_authenticated/_countries/countries_.$id.tsx +4 -4
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-sheet.tsx +1 -1
- package/src/app/routes/_authenticated/_customer-groups/components/customer-group-members-table.tsx +4 -4
- package/src/app/routes/_authenticated/_customer-groups/customer-groups.tsx +2 -4
- package/src/app/routes/_authenticated/_customer-groups/customer-groups_.$id.tsx +13 -6
- package/src/app/routes/_authenticated/_customers/components/customer-address-card.tsx +8 -8
- package/src/app/routes/_authenticated/_customers/components/customer-address-form.tsx +3 -3
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history-container.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-history/customer-history-utils.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-history/default-customer-history-components.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-history/use-customer-history.ts +1 -1
- package/src/app/routes/_authenticated/_customers/components/customer-status-badge.tsx +1 -1
- package/src/app/routes/_authenticated/_customers/customers.graphql.ts +4 -0
- package/src/app/routes/_authenticated/_customers/customers.tsx +23 -11
- package/src/app/routes/_authenticated/_customers/customers_.$id.tsx +10 -8
- package/src/app/routes/_authenticated/_facets/components/edit-facet-value.tsx +1 -1
- package/src/app/routes/_authenticated/_facets/components/facet-bulk-actions.tsx +6 -5
- package/src/app/routes/_authenticated/_facets/components/facet-values-sheet.tsx +1 -1
- package/src/app/routes/_authenticated/_facets/components/facet-values-table.tsx +1 -1
- package/src/app/routes/_authenticated/_facets/facets.tsx +5 -5
- package/src/app/routes/_authenticated/_facets/facets_.$facetId.values_.$id.tsx +7 -5
- package/src/app/routes/_authenticated/_facets/facets_.$id.tsx +4 -4
- package/src/app/routes/_authenticated/_global-settings/global-settings.tsx +5 -5
- package/src/app/routes/_authenticated/_orders/components/add-manual-payment-dialog.tsx +19 -21
- package/src/app/routes/_authenticated/_orders/components/customer-address-selector.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/edit-order-table.tsx +22 -22
- package/src/app/routes/_authenticated/_orders/components/fulfill-order-dialog.tsx +6 -6
- package/src/app/routes/_authenticated/_orders/components/fulfillment-details.tsx +15 -9
- package/src/app/routes/_authenticated/_orders/components/order-address.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-detail-shared.tsx +11 -9
- package/src/app/routes/_authenticated/_orders/components/order-history/default-order-history-components.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history-container.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-history/order-history-utils.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-history/use-order-history.ts +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-line-custom-fields-form.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-modification-preview-dialog.tsx +4 -4
- package/src/app/routes/_authenticated/_orders/components/order-modification-summary.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/order-table-totals.tsx +27 -27
- package/src/app/routes/_authenticated/_orders/components/order-table.tsx +2 -2
- package/src/app/routes/_authenticated/_orders/components/order-tax-summary.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/payment-details.tsx +26 -20
- package/src/app/routes/_authenticated/_orders/components/seller-orders-card.tsx +3 -1
- package/src/app/routes/_authenticated/_orders/components/settle-refund-dialog.tsx +6 -6
- package/src/app/routes/_authenticated/_orders/components/shipping-method-selector.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/state-transition-control.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/components/use-transition-order-to-state.tsx +3 -2
- package/src/app/routes/_authenticated/_orders/orders.tsx +5 -9
- package/src/app/routes/_authenticated/_orders/orders_.$aggregateOrderId_.seller-orders.$sellerOrderId.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/orders_.$id.tsx +1 -1
- package/src/app/routes/_authenticated/_orders/orders_.$id_.modify.tsx +4 -4
- package/src/app/routes/_authenticated/_orders/orders_.draft.$id.tsx +17 -17
- package/src/app/routes/_authenticated/_orders/utils/order-detail-loaders.tsx +1 -1
- package/src/app/routes/_authenticated/_payment-methods/payment-methods.tsx +5 -6
- package/src/app/routes/_authenticated/_payment-methods/payment-methods_.$id.tsx +13 -6
- package/src/app/routes/_authenticated/_product-variants/components/product-variant-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_product-variants/components/variant-price-detail.tsx +1 -1
- package/src/app/routes/_authenticated/_product-variants/product-variants.tsx +9 -2
- package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +13 -6
- package/src/app/routes/_authenticated/_products/components/add-option-group-dialog.tsx +5 -5
- package/src/app/routes/_authenticated/_products/components/add-product-variant-dialog.tsx +5 -5
- package/src/app/routes/_authenticated/_products/components/assign-facet-values-dialog.tsx +5 -4
- package/src/app/routes/_authenticated/_products/components/create-product-options-dialog.tsx +9 -12
- package/src/app/routes/_authenticated/_products/components/create-product-variants-dialog.tsx +1 -1
- package/src/app/routes/_authenticated/_products/components/create-product-variants.tsx +4 -4
- package/src/app/routes/_authenticated/_products/components/option-groups-editor.tsx +1 -1
- package/src/app/routes/_authenticated/_products/components/product-bulk-actions.tsx +1 -1
- package/src/app/routes/_authenticated/_products/components/product-option-select.tsx +3 -3
- package/src/app/routes/_authenticated/_products/components/product-options-table.tsx +9 -6
- package/src/app/routes/_authenticated/_products/products.graphql.ts +31 -31
- package/src/app/routes/_authenticated/_products/products.tsx +11 -6
- package/src/app/routes/_authenticated/_products/products_.$id.tsx +4 -4
- package/src/app/routes/_authenticated/_products/products_.$id_.variants.tsx +11 -11
- package/src/app/routes/_authenticated/_products/products_.$productId.option-groups.$id.tsx +8 -12
- package/src/app/routes/_authenticated/_products/products_.$productId.option-groups.$productOptionGroupId.options_.$id.tsx +2 -2
- package/src/app/routes/_authenticated/_profile/profile.tsx +4 -4
- package/src/app/routes/_authenticated/_promotions/promotions.tsx +2 -4
- package/src/app/routes/_authenticated/_promotions/promotions_.$id.tsx +16 -9
- package/src/app/routes/_authenticated/_roles/components/permissions-table-grid.tsx +1 -1
- package/src/app/routes/_authenticated/_roles/roles.tsx +3 -6
- package/src/app/routes/_authenticated/_roles/roles_.$id.tsx +4 -6
- package/src/app/routes/_authenticated/_sellers/sellers.tsx +3 -4
- package/src/app/routes/_authenticated/_sellers/sellers_.$id.tsx +4 -4
- package/src/app/routes/_authenticated/_shipping-methods/components/price-display.tsx +5 -5
- package/src/app/routes/_authenticated/_shipping-methods/components/shipping-method-test-result-wrapper.tsx +1 -1
- package/src/app/routes/_authenticated/_shipping-methods/components/test-address-form.tsx +4 -3
- package/src/app/routes/_authenticated/_shipping-methods/components/test-order-builder.tsx +4 -3
- package/src/app/routes/_authenticated/_shipping-methods/components/test-shipping-methods-result.tsx +8 -8
- package/src/app/routes/_authenticated/_shipping-methods/components/test-shipping-methods-sheet.tsx +1 -1
- package/src/app/routes/_authenticated/_shipping-methods/components/test-single-method-result.tsx +8 -8
- package/src/app/routes/_authenticated/_shipping-methods/components/test-single-shipping-method-sheet.tsx +4 -4
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods.tsx +2 -3
- package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +2 -2
- package/src/app/routes/_authenticated/_stock-locations/stock-locations.tsx +3 -4
- package/src/app/routes/_authenticated/_stock-locations/stock-locations_.$id.tsx +13 -6
- package/src/app/routes/_authenticated/_system/healthchecks.tsx +10 -4
- package/src/app/routes/_authenticated/_system/job-queue.tsx +10 -13
- package/src/app/routes/_authenticated/_system/scheduled-tasks.tsx +18 -16
- package/src/app/routes/_authenticated/_tax-categories/tax-categories.tsx +2 -4
- package/src/app/routes/_authenticated/_tax-categories/tax-categories_.$id.tsx +13 -6
- package/src/app/routes/_authenticated/_tax-rates/tax-rates.tsx +8 -12
- package/src/app/routes/_authenticated/_tax-rates/tax-rates_.$id.tsx +6 -4
- package/src/app/routes/_authenticated/_zones/zones.tsx +4 -4
- package/src/app/routes/_authenticated/_zones/zones_.$id.tsx +8 -5
- package/src/app/routes/_authenticated/index.tsx +6 -2
- package/src/app/styles.css +4 -0
- package/src/i18n/common-strings.ts +111 -0
- package/src/i18n/locales/ar.po +4777 -0
- package/src/i18n/locales/cs.po +4777 -0
- package/src/i18n/locales/de.po +4299 -1101
- package/src/i18n/locales/en.po +3857 -659
- package/src/i18n/locales/es.po +4777 -0
- package/src/i18n/locales/fa.po +4777 -0
- package/src/i18n/locales/fr.po +4777 -0
- package/src/i18n/locales/he.po +4777 -0
- package/src/i18n/locales/hr.po +4777 -0
- package/src/i18n/locales/it.po +4777 -0
- package/src/i18n/locales/ja.po +4777 -0
- package/src/i18n/locales/ko.po +4628 -0
- package/src/i18n/locales/nb.po +4777 -0
- package/src/i18n/locales/ne.po +4777 -0
- package/src/i18n/locales/nl.po +4628 -0
- package/src/i18n/locales/pl.po +4777 -0
- package/src/i18n/locales/pt_BR.po +4777 -0
- package/src/i18n/locales/pt_PT.po +4777 -0
- package/src/i18n/locales/ru.po +4777 -0
- package/src/i18n/locales/sv.po +4777 -0
- package/src/i18n/locales/tr.po +4777 -0
- package/src/i18n/locales/uk.po +4777 -0
- package/src/i18n/locales/zh_Hans.po +4777 -0
- package/src/i18n/locales/zh_Hant.po +4777 -0
- package/src/lib/components/data-input/combination-mode-input.tsx +1 -1
- package/src/lib/components/data-input/custom-field-list-input.tsx +11 -7
- package/src/lib/components/data-input/customer-group-input.tsx +27 -33
- package/src/lib/components/data-input/datetime-input.tsx +40 -1
- package/src/lib/components/data-input/default-relation-input.tsx +5 -4
- package/src/lib/components/data-input/product-multi-selector-input.tsx +14 -14
- package/src/lib/components/data-input/relation-selector.tsx +1 -1
- package/src/lib/components/data-input/select-with-options.tsx +1 -1
- package/src/lib/components/data-input/slug-input.tsx +9 -15
- package/src/lib/components/data-table/add-filter-menu.tsx +4 -4
- package/src/lib/components/data-table/data-table-bulk-action-item.tsx +8 -8
- package/src/lib/components/data-table/data-table-bulk-actions.tsx +4 -4
- package/src/lib/components/data-table/data-table-column-header.tsx +13 -8
- package/src/lib/components/data-table/data-table-faceted-filter.tsx +2 -1
- package/src/lib/components/data-table/data-table-filter-dialog.tsx +1 -1
- package/src/lib/components/data-table/data-table-utils.ts +21 -4
- package/src/lib/components/data-table/data-table-view-options.tsx +4 -2
- package/src/lib/components/data-table/data-table.tsx +3 -3
- package/src/lib/components/data-table/filters/data-table-boolean-filter.tsx +4 -4
- package/src/lib/components/data-table/global-views-bar.tsx +1 -1
- package/src/lib/components/data-table/human-readable-operator.tsx +1 -1
- package/src/lib/components/data-table/manage-global-views-button.tsx +1 -1
- package/src/lib/components/data-table/my-views-button.tsx +13 -13
- package/src/lib/components/data-table/refresh-button.tsx +1 -1
- package/src/lib/components/data-table/save-view-button.tsx +11 -11
- package/src/lib/components/data-table/use-generated-columns.tsx +10 -7
- package/src/lib/components/data-table/views-sheet.tsx +79 -71
- package/src/lib/components/date-range-picker.tsx +36 -34
- package/src/lib/components/layout/app-sidebar.tsx +3 -1
- package/src/lib/components/layout/channel-switcher.tsx +8 -10
- package/src/lib/components/layout/dev-mode-indicator.tsx +1 -1
- package/src/lib/components/layout/generated-breadcrumbs.tsx +10 -8
- package/src/lib/components/layout/language-dialog.tsx +34 -13
- package/src/lib/components/layout/manage-languages-dialog.tsx +1 -1
- package/src/lib/components/layout/nav-main.tsx +23 -13
- package/src/lib/components/layout/nav-user.tsx +19 -23
- package/src/lib/components/login/login-form.tsx +1 -1
- package/src/lib/components/shared/asset/asset-bulk-actions.tsx +4 -4
- package/src/lib/components/shared/asset/asset-focal-point-editor.tsx +1 -1
- package/src/lib/components/shared/asset/asset-gallery.tsx +15 -14
- package/src/lib/components/shared/assign-to-channel-bulk-action.tsx +11 -11
- package/src/lib/components/shared/assign-to-channel-dialog.tsx +6 -5
- package/src/lib/components/shared/channel-code-label.tsx +1 -1
- package/src/lib/components/shared/channel-selector.tsx +4 -4
- package/src/lib/components/shared/configurable-operation-multi-selector.tsx +16 -14
- package/src/lib/components/shared/configurable-operation-selector.tsx +1 -1
- package/src/lib/components/shared/confirmation-dialog.tsx +8 -8
- package/src/lib/components/shared/country-selector.tsx +1 -1
- package/src/lib/components/shared/currency-selector.tsx +4 -4
- package/src/lib/components/shared/custom-fields-form.tsx +8 -24
- package/src/lib/components/shared/customer-address-form.tsx +3 -3
- package/src/lib/components/shared/customer-group-selector.tsx +1 -1
- package/src/lib/components/shared/customer-selector.tsx +1 -1
- package/src/lib/components/shared/error-page.tsx +1 -1
- package/src/lib/components/shared/facet-value-selector.tsx +10 -10
- package/src/lib/components/shared/history-timeline/history-note-checkbox.tsx +1 -1
- package/src/lib/components/shared/history-timeline/history-note-editor.tsx +1 -1
- package/src/lib/components/shared/history-timeline/history-note-entry.tsx +1 -1
- package/src/lib/components/shared/language-selector.tsx +4 -4
- package/src/lib/components/shared/navigation-confirmation.tsx +1 -1
- package/src/lib/components/shared/paginated-list-data-table.tsx +21 -18
- package/src/lib/components/shared/remove-from-channel-bulk-action.tsx +6 -5
- package/src/lib/components/shared/rich-text-editor/image-dialog.tsx +1 -1
- package/src/lib/components/shared/rich-text-editor/link-dialog.tsx +1 -1
- package/src/lib/components/shared/rich-text-editor/responsive-toolbar.tsx +1 -1
- package/src/lib/components/shared/rich-text-editor/table-edit-icons.tsx +1 -1
- package/src/lib/components/shared/role-code-label.tsx +1 -1
- package/src/lib/components/shared/role-selector.tsx +4 -4
- package/src/lib/components/shared/seller-selector.tsx +1 -1
- package/src/lib/components/shared/stock-level-label.tsx +3 -5
- package/src/lib/components/shared/table-cell/order-table-cell-components.tsx +3 -1
- package/src/lib/components/shared/tax-category-selector.tsx +1 -1
- package/src/lib/components/shared/translatable-form-field.tsx +15 -15
- package/src/lib/components/shared/zone-selector.tsx +1 -1
- package/src/lib/constants.ts +10 -0
- package/src/lib/framework/dashboard-widget/base-widget.tsx +11 -9
- package/src/lib/framework/dashboard-widget/latest-orders-widget/index.tsx +6 -4
- package/src/lib/framework/dashboard-widget/metrics-widget/index.tsx +8 -5
- package/src/lib/framework/dashboard-widget/orders-summary/index.tsx +7 -4
- package/src/lib/framework/dashboard-widget/widget-filters-context.tsx +3 -1
- package/src/lib/framework/defaults.ts +34 -63
- package/src/lib/framework/layout-engine/page-layout.tsx +36 -36
- package/src/lib/framework/page/detail-page.tsx +10 -10
- package/src/lib/framework/page/use-extended-router.tsx +48 -23
- package/src/lib/graphql/api.ts +22 -7
- package/src/lib/graphql/graphql-env.d.ts +13 -25
- package/src/lib/hooks/use-display-locale.ts +40 -0
- package/src/lib/hooks/use-dynamic-translations.ts +46 -0
- package/src/lib/hooks/use-extended-detail-query.ts +1 -1
- package/src/lib/hooks/use-extended-list-query.ts +1 -1
- package/src/lib/hooks/use-local-format.ts +15 -1
- package/src/lib/hooks/use-saved-views.ts +7 -0
- package/src/lib/hooks/use-ui-language-loader.ts +30 -0
- package/src/lib/lib/load-i18n-messages.ts +17 -0
- package/src/lib/lib/trans.tsx +15 -11
- package/src/lib/providers/auth.tsx +2 -2
- package/src/lib/providers/channel-provider.tsx +3 -2
- package/src/lib/providers/i18n-provider.tsx +7 -14
- package/src/lib/providers/user-settings.tsx +46 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Trans } from '
|
|
1
|
+
import { Trans } from '@lingui/react/macro';
|
|
2
2
|
|
|
3
3
|
import { Select, SelectItem, SelectTrigger, SelectValue } from '@/vdb/components/ui/select.js';
|
|
4
4
|
|
|
@@ -14,9 +14,9 @@ export interface DataTableBooleanFilterProps {
|
|
|
14
14
|
export const BOOLEAN_OPERATORS = ['eq', 'isNull'] as const;
|
|
15
15
|
|
|
16
16
|
export function DataTableBooleanFilter({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}: Readonly<DataTableBooleanFilterProps>) {
|
|
17
|
+
value: incomingValue,
|
|
18
|
+
onChange,
|
|
19
|
+
}: Readonly<DataTableBooleanFilterProps>) {
|
|
20
20
|
const initialOperator = incomingValue ? (Object.keys(incomingValue)[0] ?? 'eq') : 'eq';
|
|
21
21
|
const initialValue = incomingValue ? Object.values(incomingValue)[0] : true;
|
|
22
22
|
const [operator, setOperator] = useState<string>(initialOperator ?? 'eq');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { Trans } from '@lingui/react/macro';
|
|
1
2
|
import { ChevronDown } from 'lucide-react';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
import { useSavedViews } from '../../hooks/use-saved-views.js';
|
|
4
|
-
import { Trans } from '../../lib/trans.js';
|
|
5
5
|
import { SavedView } from '../../types/saved-views.js';
|
|
6
6
|
import { findMatchingSavedView } from '../../utils/saved-views-utils.js';
|
|
7
7
|
import { PermissionGuard } from '../shared/permission-guard.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Trans } from '
|
|
1
|
+
import { Trans } from '@lingui/react/macro';
|
|
2
2
|
import { BOOLEAN_OPERATORS } from './filters/data-table-boolean-filter.js';
|
|
3
3
|
import { DATETIME_OPERATORS } from './filters/data-table-datetime-filter.js';
|
|
4
4
|
import { ID_OPERATORS } from './filters/data-table-id-filter.js';
|
|
@@ -2,7 +2,7 @@ import { Settings } from 'lucide-react';
|
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import { Button } from '../ui/button.js';
|
|
4
4
|
import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip.js';
|
|
5
|
-
import { Trans } from '
|
|
5
|
+
import { Trans } from '@lingui/react/macro';
|
|
6
6
|
import { GlobalViewsSheet } from './global-views-sheet.js';
|
|
7
7
|
|
|
8
8
|
export const ManageGlobalViewsButton: React.FC = () => {
|
|
@@ -1,30 +1,34 @@
|
|
|
1
|
+
import { Trans } from '@lingui/react/macro';
|
|
1
2
|
import { Bookmark } from 'lucide-react';
|
|
2
|
-
import React, {
|
|
3
|
-
import { Button } from '../ui/button.js';
|
|
4
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip.js';
|
|
5
|
-
import { Trans } from '@/vdb/lib/trans.js';
|
|
6
|
-
import { UserViewsSheet } from './user-views-sheet.js';
|
|
3
|
+
import React, { useMemo, useState } from 'react';
|
|
7
4
|
import { useSavedViews } from '../../hooks/use-saved-views.js';
|
|
8
5
|
import { findMatchingSavedView } from '../../utils/saved-views-utils.js';
|
|
6
|
+
import { Button } from '../ui/button.js';
|
|
7
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/tooltip.js';
|
|
9
8
|
import { useDataTableContext } from './data-table-context.js';
|
|
9
|
+
import { UserViewsSheet } from './user-views-sheet.js';
|
|
10
10
|
|
|
11
11
|
export const MyViewsButton: React.FC = () => {
|
|
12
12
|
const [sheetOpen, setSheetOpen] = useState(false);
|
|
13
|
-
const { userViews } = useSavedViews();
|
|
14
|
-
const { columnFilters, searchTerm
|
|
13
|
+
const { userViews, savedViewsAreAvailable } = useSavedViews();
|
|
14
|
+
const { columnFilters, searchTerm } = useDataTableContext();
|
|
15
15
|
|
|
16
16
|
// Find the active view using centralized utility
|
|
17
17
|
const activeView = useMemo(() => {
|
|
18
18
|
return findMatchingSavedView(columnFilters, searchTerm, userViews);
|
|
19
19
|
}, [userViews, columnFilters, searchTerm]);
|
|
20
20
|
|
|
21
|
+
if (!savedViewsAreAvailable) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
return (
|
|
22
26
|
<>
|
|
23
27
|
<div className="flex items-center gap-2">
|
|
24
28
|
<Tooltip>
|
|
25
29
|
<TooltipTrigger asChild>
|
|
26
30
|
<Button
|
|
27
|
-
variant={activeView ?
|
|
31
|
+
variant={activeView ? 'default' : 'outline'}
|
|
28
32
|
size="icon"
|
|
29
33
|
onClick={() => setSheetOpen(true)}
|
|
30
34
|
>
|
|
@@ -35,11 +39,7 @@ export const MyViewsButton: React.FC = () => {
|
|
|
35
39
|
<Trans>My saved views</Trans>
|
|
36
40
|
</TooltipContent>
|
|
37
41
|
</Tooltip>
|
|
38
|
-
{activeView &&
|
|
39
|
-
<span className="text-sm text-muted-foreground">
|
|
40
|
-
{activeView.name}
|
|
41
|
-
</span>
|
|
42
|
-
)}
|
|
42
|
+
{activeView && <span className="text-sm text-muted-foreground">{activeView.name}</span>}
|
|
43
43
|
</div>
|
|
44
44
|
<UserViewsSheet open={sheetOpen} onOpenChange={setSheetOpen} />
|
|
45
45
|
</>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button } from '@/vdb/components/ui/button.js';
|
|
2
2
|
import { Tooltip, TooltipContent, TooltipTrigger } from '@/vdb/components/ui/tooltip.js';
|
|
3
|
-
import { Trans } from '
|
|
3
|
+
import { Trans } from '@lingui/react/macro';
|
|
4
4
|
import { RefreshCw } from 'lucide-react';
|
|
5
5
|
import { useEffect, useState } from 'react';
|
|
6
6
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { Trans } from '@lingui/react/macro';
|
|
1
2
|
import { BookmarkPlus } from 'lucide-react';
|
|
2
3
|
import React, { useState } from 'react';
|
|
3
|
-
import { Button } from '../ui/button.js';
|
|
4
|
-
import { SaveViewDialog } from './save-view-dialog.js';
|
|
5
4
|
import { useSavedViews } from '../../hooks/use-saved-views.js';
|
|
6
5
|
import { isMatchingSavedView } from '../../utils/saved-views-utils.js';
|
|
6
|
+
import { Button } from '../ui/button.js';
|
|
7
7
|
import { useDataTableContext } from './data-table-context.js';
|
|
8
|
+
import { SaveViewDialog } from './save-view-dialog.js';
|
|
8
9
|
|
|
9
10
|
interface SaveViewButtonProps {
|
|
10
11
|
disabled?: boolean;
|
|
@@ -12,7 +13,7 @@ interface SaveViewButtonProps {
|
|
|
12
13
|
|
|
13
14
|
export const SaveViewButton: React.FC<SaveViewButtonProps> = ({ disabled }) => {
|
|
14
15
|
const [dialogOpen, setDialogOpen] = useState(false);
|
|
15
|
-
const { userViews, globalViews } = useSavedViews();
|
|
16
|
+
const { userViews, globalViews, savedViewsAreAvailable } = useSavedViews();
|
|
16
17
|
const { columnFilters, searchTerm } = useDataTableContext();
|
|
17
18
|
|
|
18
19
|
const hasFilters = columnFilters.length > 0 || (searchTerm && searchTerm.length > 0);
|
|
@@ -23,16 +24,15 @@ export const SaveViewButton: React.FC<SaveViewButtonProps> = ({ disabled }) => {
|
|
|
23
24
|
return null;
|
|
24
25
|
}
|
|
25
26
|
|
|
27
|
+
if (!savedViewsAreAvailable) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
|
|
26
31
|
return (
|
|
27
32
|
<>
|
|
28
|
-
<Button
|
|
29
|
-
variant="outline"
|
|
30
|
-
size="sm"
|
|
31
|
-
onClick={() => setDialogOpen(true)}
|
|
32
|
-
disabled={disabled}
|
|
33
|
-
>
|
|
33
|
+
<Button variant="outline" size="sm" onClick={() => setDialogOpen(true)} disabled={disabled}>
|
|
34
34
|
<BookmarkPlus className="h-4 w-4 mr-1" />
|
|
35
|
-
Save View
|
|
35
|
+
<Trans>Save View</Trans>
|
|
36
36
|
</Button>
|
|
37
37
|
<SaveViewDialog
|
|
38
38
|
open={dialogOpen}
|
|
@@ -42,4 +42,4 @@ export const SaveViewButton: React.FC<SaveViewButtonProps> = ({ disabled }) => {
|
|
|
42
42
|
/>
|
|
43
43
|
</>
|
|
44
44
|
);
|
|
45
|
-
};
|
|
45
|
+
};
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
} from '@/vdb/framework/document-introspection/get-document-structure.js';
|
|
8
8
|
import { BulkAction } from '@/vdb/framework/extension-api/types/index.js';
|
|
9
9
|
import { api } from '@/vdb/graphql/api.js';
|
|
10
|
-
import { Trans, useLingui } from '@/vdb/lib/trans.js';
|
|
11
10
|
import { TypedDocumentNode } from '@graphql-typed-document-node/core';
|
|
11
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
12
12
|
import { useMutation } from '@tanstack/react-query';
|
|
13
|
-
import { AccessorKeyColumnDef, createColumnHelper, Row } from '@tanstack/react-table';
|
|
13
|
+
import { AccessorFnColumnDef, AccessorKeyColumnDef, createColumnHelper, Row } from '@tanstack/react-table';
|
|
14
14
|
import { EllipsisIcon, TrashIcon } from 'lucide-react';
|
|
15
15
|
import { useMemo } from 'react';
|
|
16
16
|
import { toast } from 'sonner';
|
|
@@ -73,7 +73,10 @@ export function useGeneratedColumns<T extends TypedDocumentNode<any, any>>({
|
|
|
73
73
|
includeSelectionColumn?: boolean;
|
|
74
74
|
includeActionsColumn?: boolean;
|
|
75
75
|
enableSorting?: boolean;
|
|
76
|
-
}>) {
|
|
76
|
+
}>): {
|
|
77
|
+
columns: Array<AccessorKeyColumnDef<any> | AccessorFnColumnDef<any>>;
|
|
78
|
+
customFieldColumnNames: string[];
|
|
79
|
+
} {
|
|
77
80
|
const columnHelper = createColumnHelper<PaginatedListItemFields<T>>();
|
|
78
81
|
const allBulkActions = useAllBulkActions(bulkActions ?? []);
|
|
79
82
|
|
|
@@ -264,7 +267,7 @@ function DeleteMutationRowAction({
|
|
|
264
267
|
row: Row<{ id: string }>;
|
|
265
268
|
}>) {
|
|
266
269
|
const { refetchPaginatedList } = usePaginatedList();
|
|
267
|
-
const {
|
|
270
|
+
const { t } = useLingui();
|
|
268
271
|
|
|
269
272
|
// Inspect the mutation variables to determine if it expects 'id' or 'ids'
|
|
270
273
|
const mutationVariables = getOperationVariablesFields(deleteMutation);
|
|
@@ -285,15 +288,15 @@ function DeleteMutationRowAction({
|
|
|
285
288
|
const resultToCheck = Array.isArray(unwrappedResult) ? unwrappedResult[0] : unwrappedResult;
|
|
286
289
|
if (resultToCheck.result === 'DELETED') {
|
|
287
290
|
refetchPaginatedList();
|
|
288
|
-
toast.success(
|
|
291
|
+
toast.success(t`Deleted successfully`);
|
|
289
292
|
} else {
|
|
290
|
-
toast.error(
|
|
293
|
+
toast.error(t`Failed to delete`, {
|
|
291
294
|
description: resultToCheck.message,
|
|
292
295
|
});
|
|
293
296
|
}
|
|
294
297
|
},
|
|
295
298
|
onError: (err: Error) => {
|
|
296
|
-
toast.error(
|
|
299
|
+
toast.error(t`Failed to delete`, {
|
|
297
300
|
description: err.message,
|
|
298
301
|
});
|
|
299
302
|
},
|
|
@@ -1,24 +1,9 @@
|
|
|
1
|
+
import { Trans, useLingui } from '@lingui/react/macro';
|
|
1
2
|
import { Copy, Edit, Globe, MoreHorizontal, Trash2 } from 'lucide-react';
|
|
2
3
|
import React, { useState } from 'react';
|
|
4
|
+
import { toast } from 'sonner';
|
|
3
5
|
import { useSavedViews } from '../../hooks/use-saved-views.js';
|
|
4
|
-
import { useDataTableContext } from './data-table-context.js';
|
|
5
|
-
import { Button } from '../ui/button.js';
|
|
6
|
-
import { Input } from '../ui/input.js';
|
|
7
|
-
import {
|
|
8
|
-
DropdownMenu,
|
|
9
|
-
DropdownMenuContent,
|
|
10
|
-
DropdownMenuItem,
|
|
11
|
-
DropdownMenuTrigger,
|
|
12
|
-
} from '../ui/dropdown-menu.js';
|
|
13
|
-
import {
|
|
14
|
-
Sheet,
|
|
15
|
-
SheetContent,
|
|
16
|
-
SheetDescription,
|
|
17
|
-
SheetHeader,
|
|
18
|
-
SheetTitle,
|
|
19
|
-
} from '../ui/sheet.js';
|
|
20
6
|
import { SavedView } from '../../types/saved-views.js';
|
|
21
|
-
import { toast } from 'sonner';
|
|
22
7
|
import {
|
|
23
8
|
AlertDialog,
|
|
24
9
|
AlertDialogAction,
|
|
@@ -29,7 +14,16 @@ import {
|
|
|
29
14
|
AlertDialogHeader,
|
|
30
15
|
AlertDialogTitle,
|
|
31
16
|
} from '../ui/alert-dialog.js';
|
|
32
|
-
import {
|
|
17
|
+
import { Button } from '../ui/button.js';
|
|
18
|
+
import {
|
|
19
|
+
DropdownMenu,
|
|
20
|
+
DropdownMenuContent,
|
|
21
|
+
DropdownMenuItem,
|
|
22
|
+
DropdownMenuTrigger,
|
|
23
|
+
} from '../ui/dropdown-menu.js';
|
|
24
|
+
import { Input } from '../ui/input.js';
|
|
25
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from '../ui/sheet.js';
|
|
26
|
+
import { useDataTableContext } from './data-table-context.js';
|
|
33
27
|
|
|
34
28
|
interface ViewsSheetProps {
|
|
35
29
|
open: boolean;
|
|
@@ -38,9 +32,10 @@ interface ViewsSheetProps {
|
|
|
38
32
|
}
|
|
39
33
|
|
|
40
34
|
export const ViewsSheet: React.FC<ViewsSheetProps> = ({ open, onOpenChange, type }) => {
|
|
41
|
-
const { userViews, globalViews, deleteView, updateView, duplicateView, canManageGlobalViews } =
|
|
35
|
+
const { userViews, globalViews, deleteView, updateView, duplicateView, canManageGlobalViews } =
|
|
36
|
+
useSavedViews();
|
|
42
37
|
const { handleApplyView } = useDataTableContext();
|
|
43
|
-
const {
|
|
38
|
+
const { t } = useLingui();
|
|
44
39
|
const [editingId, setEditingId] = useState<string | null>(null);
|
|
45
40
|
const [editingName, setEditingName] = useState('');
|
|
46
41
|
const [deleteConfirmId, setDeleteConfirmId] = useState<string | null>(null);
|
|
@@ -50,9 +45,8 @@ export const ViewsSheet: React.FC<ViewsSheetProps> = ({ open, onOpenChange, type
|
|
|
50
45
|
|
|
51
46
|
const handleViewApply = (view: SavedView) => {
|
|
52
47
|
handleApplyView(view.filters, view.searchTerm);
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
: i18n.t(`Applied view "${view.name}"`);
|
|
48
|
+
const viewName = view.name;
|
|
49
|
+
const message = isGlobal ? t`Applied global view "${viewName}"` : t`Applied view "${viewName}"`;
|
|
56
50
|
toast.success(message);
|
|
57
51
|
};
|
|
58
52
|
|
|
@@ -66,16 +60,12 @@ export const ViewsSheet: React.FC<ViewsSheetProps> = ({ open, onOpenChange, type
|
|
|
66
60
|
|
|
67
61
|
try {
|
|
68
62
|
await updateView({ id: editingId, name: editingName.trim() });
|
|
69
|
-
const message = isGlobal
|
|
70
|
-
? i18n.t('Global view renamed successfully')
|
|
71
|
-
: i18n.t('View renamed successfully');
|
|
63
|
+
const message = isGlobal ? t`Global view renamed successfully` : t`View renamed successfully`;
|
|
72
64
|
toast.success(message);
|
|
73
65
|
setEditingId(null);
|
|
74
66
|
setEditingName('');
|
|
75
67
|
} catch (error) {
|
|
76
|
-
const message = isGlobal
|
|
77
|
-
? i18n.t('Failed to rename global view')
|
|
78
|
-
: i18n.t('Failed to rename view');
|
|
68
|
+
const message = isGlobal ? t`Failed to rename global view` : t`Failed to rename view`;
|
|
79
69
|
toast.error(message);
|
|
80
70
|
}
|
|
81
71
|
};
|
|
@@ -90,15 +80,11 @@ export const ViewsSheet: React.FC<ViewsSheetProps> = ({ open, onOpenChange, type
|
|
|
90
80
|
|
|
91
81
|
try {
|
|
92
82
|
await deleteView(deleteConfirmId);
|
|
93
|
-
const message = isGlobal
|
|
94
|
-
? i18n.t('Global view deleted successfully')
|
|
95
|
-
: i18n.t('View deleted successfully');
|
|
83
|
+
const message = isGlobal ? t`Global view deleted successfully` : t`View deleted successfully`;
|
|
96
84
|
toast.success(message);
|
|
97
85
|
setDeleteConfirmId(null);
|
|
98
86
|
} catch (error) {
|
|
99
|
-
const message = isGlobal
|
|
100
|
-
? i18n.t('Failed to delete global view')
|
|
101
|
-
: i18n.t('Failed to delete view');
|
|
87
|
+
const message = isGlobal ? t`Failed to delete global view` : t`Failed to delete view`;
|
|
102
88
|
toast.error(message);
|
|
103
89
|
}
|
|
104
90
|
};
|
|
@@ -107,13 +93,11 @@ export const ViewsSheet: React.FC<ViewsSheetProps> = ({ open, onOpenChange, type
|
|
|
107
93
|
try {
|
|
108
94
|
await duplicateView(view.id, type);
|
|
109
95
|
const message = isGlobal
|
|
110
|
-
?
|
|
111
|
-
:
|
|
96
|
+
? t`Global view duplicated successfully`
|
|
97
|
+
: t`View duplicated successfully`;
|
|
112
98
|
toast.success(message);
|
|
113
99
|
} catch (error) {
|
|
114
|
-
const message = isGlobal
|
|
115
|
-
? i18n.t('Failed to duplicate global view')
|
|
116
|
-
: i18n.t('Failed to duplicate view');
|
|
100
|
+
const message = isGlobal ? t`Failed to duplicate global view` : t`Failed to duplicate view`;
|
|
117
101
|
toast.error(message);
|
|
118
102
|
}
|
|
119
103
|
};
|
|
@@ -121,9 +105,9 @@ export const ViewsSheet: React.FC<ViewsSheetProps> = ({ open, onOpenChange, type
|
|
|
121
105
|
const handleConvertToUser = async (view: SavedView) => {
|
|
122
106
|
try {
|
|
123
107
|
await duplicateView(view.id, 'user');
|
|
124
|
-
toast.success(
|
|
108
|
+
toast.success(t`Global view converted to personal view successfully`);
|
|
125
109
|
} catch (error) {
|
|
126
|
-
toast.error(
|
|
110
|
+
toast.error(t`Failed to convert global view to personal view`);
|
|
127
111
|
}
|
|
128
112
|
};
|
|
129
113
|
|
|
@@ -131,9 +115,9 @@ export const ViewsSheet: React.FC<ViewsSheetProps> = ({ open, onOpenChange, type
|
|
|
131
115
|
try {
|
|
132
116
|
await duplicateView(view.id, 'global');
|
|
133
117
|
await deleteView(view.id);
|
|
134
|
-
toast.success(
|
|
118
|
+
toast.success(t`View converted to global successfully`);
|
|
135
119
|
} catch (error) {
|
|
136
|
-
toast.error(
|
|
120
|
+
toast.error(t`Failed to convert view to global`);
|
|
137
121
|
}
|
|
138
122
|
};
|
|
139
123
|
|
|
@@ -142,16 +126,20 @@ export const ViewsSheet: React.FC<ViewsSheetProps> = ({ open, onOpenChange, type
|
|
|
142
126
|
};
|
|
143
127
|
|
|
144
128
|
const getDescription = () => {
|
|
145
|
-
return isGlobal
|
|
146
|
-
|
|
147
|
-
|
|
129
|
+
return isGlobal ? (
|
|
130
|
+
<Trans>Manage global saved views that are visible to all users</Trans>
|
|
131
|
+
) : (
|
|
132
|
+
<Trans>Manage your personal saved views for this table</Trans>
|
|
133
|
+
);
|
|
148
134
|
};
|
|
149
135
|
|
|
150
136
|
const getEmptyStateMessage = () => {
|
|
151
137
|
if (isGlobal) {
|
|
152
138
|
return (
|
|
153
139
|
<>
|
|
154
|
-
<p
|
|
140
|
+
<p>
|
|
141
|
+
<Trans>No global views have been created yet.</Trans>
|
|
142
|
+
</p>
|
|
155
143
|
<p className="text-sm mt-2">
|
|
156
144
|
<Trans>Save a view as "Global" to make it available to all users.</Trans>
|
|
157
145
|
</p>
|
|
@@ -160,7 +148,9 @@ export const ViewsSheet: React.FC<ViewsSheetProps> = ({ open, onOpenChange, type
|
|
|
160
148
|
} else {
|
|
161
149
|
return (
|
|
162
150
|
<>
|
|
163
|
-
<p
|
|
151
|
+
<p>
|
|
152
|
+
<Trans>You haven't saved any views yet.</Trans>
|
|
153
|
+
</p>
|
|
164
154
|
<p className="text-sm mt-2">
|
|
165
155
|
<Trans>Apply filters to the table and click "Save View" to get started.</Trans>
|
|
166
156
|
</p>
|
|
@@ -174,9 +164,14 @@ export const ViewsSheet: React.FC<ViewsSheetProps> = ({ open, onOpenChange, type
|
|
|
174
164
|
};
|
|
175
165
|
|
|
176
166
|
const getDeleteDialogDescription = () => {
|
|
177
|
-
return isGlobal
|
|
178
|
-
|
|
179
|
-
|
|
167
|
+
return isGlobal ? (
|
|
168
|
+
<Trans>
|
|
169
|
+
Are you sure you want to delete this global view? This action cannot be undone and will affect
|
|
170
|
+
all users.
|
|
171
|
+
</Trans>
|
|
172
|
+
) : (
|
|
173
|
+
<Trans>Are you sure you want to delete this view? This action cannot be undone.</Trans>
|
|
174
|
+
);
|
|
180
175
|
};
|
|
181
176
|
|
|
182
177
|
return (
|
|
@@ -185,9 +180,7 @@ export const ViewsSheet: React.FC<ViewsSheetProps> = ({ open, onOpenChange, type
|
|
|
185
180
|
<SheetContent className="w-[400px] sm:w-[540px]">
|
|
186
181
|
<SheetHeader>
|
|
187
182
|
<SheetTitle>{getTitle()}</SheetTitle>
|
|
188
|
-
<SheetDescription>
|
|
189
|
-
{getDescription()}
|
|
190
|
-
</SheetDescription>
|
|
183
|
+
<SheetDescription>{getDescription()}</SheetDescription>
|
|
191
184
|
</SheetHeader>
|
|
192
185
|
<div className="mt-4">
|
|
193
186
|
{views.length === 0 ? (
|
|
@@ -216,18 +209,21 @@ export const ViewsSheet: React.FC<ViewsSheetProps> = ({ open, onOpenChange, type
|
|
|
216
209
|
<Button size="sm" onClick={handleSaveEdit}>
|
|
217
210
|
<Trans>Save</Trans>
|
|
218
211
|
</Button>
|
|
219
|
-
<Button
|
|
212
|
+
<Button
|
|
213
|
+
size="sm"
|
|
214
|
+
variant="outline"
|
|
215
|
+
onClick={handleCancelEdit}
|
|
216
|
+
>
|
|
220
217
|
<Trans>Cancel</Trans>
|
|
221
218
|
</Button>
|
|
222
219
|
</div>
|
|
223
220
|
) : (
|
|
224
221
|
<>
|
|
225
|
-
<span className="font-medium text-sm truncate flex-1">
|
|
222
|
+
<span className="font-medium text-sm truncate flex-1">
|
|
223
|
+
{view.name}
|
|
224
|
+
</span>
|
|
226
225
|
<div className="flex items-center gap-1">
|
|
227
|
-
<Button
|
|
228
|
-
size="sm"
|
|
229
|
-
onClick={() => handleViewApply(view)}
|
|
230
|
-
>
|
|
226
|
+
<Button size="sm" onClick={() => handleViewApply(view)}>
|
|
231
227
|
<Trans>Apply</Trans>
|
|
232
228
|
</Button>
|
|
233
229
|
<DropdownMenu>
|
|
@@ -237,22 +233,32 @@ export const ViewsSheet: React.FC<ViewsSheetProps> = ({ open, onOpenChange, type
|
|
|
237
233
|
</Button>
|
|
238
234
|
</DropdownMenuTrigger>
|
|
239
235
|
<DropdownMenuContent align="end">
|
|
240
|
-
<DropdownMenuItem
|
|
236
|
+
<DropdownMenuItem
|
|
237
|
+
onClick={() => handleStartEdit(view)}
|
|
238
|
+
>
|
|
241
239
|
<Edit className="h-4 w-4 mr-2" />
|
|
242
240
|
<Trans>Rename</Trans>
|
|
243
241
|
</DropdownMenuItem>
|
|
244
|
-
<DropdownMenuItem
|
|
242
|
+
<DropdownMenuItem
|
|
243
|
+
onClick={() => handleDuplicate(view)}
|
|
244
|
+
>
|
|
245
245
|
<Copy className="h-4 w-4 mr-2" />
|
|
246
246
|
<Trans>Duplicate</Trans>
|
|
247
247
|
</DropdownMenuItem>
|
|
248
248
|
{isGlobal ? (
|
|
249
|
-
<DropdownMenuItem
|
|
249
|
+
<DropdownMenuItem
|
|
250
|
+
onClick={() => handleConvertToUser(view)}
|
|
251
|
+
>
|
|
250
252
|
<Copy className="h-4 w-4 mr-2" />
|
|
251
253
|
<Trans>Copy to Personal</Trans>
|
|
252
254
|
</DropdownMenuItem>
|
|
253
255
|
) : (
|
|
254
256
|
canManageGlobalViews && (
|
|
255
|
-
<DropdownMenuItem
|
|
257
|
+
<DropdownMenuItem
|
|
258
|
+
onClick={() =>
|
|
259
|
+
handleConvertToGlobal(view)
|
|
260
|
+
}
|
|
261
|
+
>
|
|
256
262
|
<Globe className="h-4 w-4 mr-2" />
|
|
257
263
|
<Trans>Make Global</Trans>
|
|
258
264
|
</DropdownMenuItem>
|
|
@@ -282,16 +288,18 @@ export const ViewsSheet: React.FC<ViewsSheetProps> = ({ open, onOpenChange, type
|
|
|
282
288
|
<AlertDialogContent>
|
|
283
289
|
<AlertDialogHeader>
|
|
284
290
|
<AlertDialogTitle>{getDeleteDialogTitle()}</AlertDialogTitle>
|
|
285
|
-
<AlertDialogDescription>
|
|
286
|
-
{getDeleteDialogDescription()}
|
|
287
|
-
</AlertDialogDescription>
|
|
291
|
+
<AlertDialogDescription>{getDeleteDialogDescription()}</AlertDialogDescription>
|
|
288
292
|
</AlertDialogHeader>
|
|
289
293
|
<AlertDialogFooter>
|
|
290
|
-
<AlertDialogCancel
|
|
291
|
-
|
|
294
|
+
<AlertDialogCancel>
|
|
295
|
+
<Trans>Cancel</Trans>
|
|
296
|
+
</AlertDialogCancel>
|
|
297
|
+
<AlertDialogAction onClick={handleDelete}>
|
|
298
|
+
<Trans>Delete</Trans>
|
|
299
|
+
</AlertDialogAction>
|
|
292
300
|
</AlertDialogFooter>
|
|
293
301
|
</AlertDialogContent>
|
|
294
302
|
</AlertDialog>
|
|
295
303
|
</>
|
|
296
304
|
);
|
|
297
|
-
};
|
|
305
|
+
};
|