@deenruv/admin-dashboard 1.0.17-dev.4 → 1.0.17-dev.40

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 (87) hide show
  1. package/dist/DeenruvAdminPanel.js +30 -41
  2. package/dist/access/access-context.js +10 -0
  3. package/dist/access/admin-router.js +60 -0
  4. package/dist/access/built-in-route-permissions.js +44 -0
  5. package/dist/access/built-in-routes.js +301 -0
  6. package/dist/access/channel-selection.js +11 -0
  7. package/dist/access/index.js +6 -0
  8. package/dist/access/navigation.js +33 -0
  9. package/dist/access/permission-access.js +9 -0
  10. package/dist/access/permission-routes.js +3 -0
  11. package/dist/access/types.js +1 -0
  12. package/dist/components/BrandLogo.js +5 -5
  13. package/dist/components/GlobalSearch.js +32 -57
  14. package/dist/components/Menu/AccountMenu.js +58 -0
  15. package/dist/components/Menu/Breadcrumbs.js +23 -0
  16. package/dist/components/Menu/ChannelSwitcher.js +8 -1
  17. package/dist/components/Menu/Navigation.js +79 -257
  18. package/dist/components/Menu/NavigationFooter.js +16 -7
  19. package/dist/components/Menu/SidebarContent.js +9 -0
  20. package/dist/components/Menu/SidebarState.js +93 -0
  21. package/dist/components/Menu/TopbarOverflow.js +11 -0
  22. package/dist/components/Menu/index.js +68 -56
  23. package/dist/components/storefrontAction/StorefrontAction.js +9 -0
  24. package/dist/components/storefrontAction/StorefrontAction.logic.js +27 -0
  25. package/dist/components/storefrontAction/index.js +2 -0
  26. package/dist/graphql/scalars.js +4 -0
  27. package/dist/index.css +65 -0
  28. package/dist/locales/en/admins.json +62 -0
  29. package/dist/locales/en/collections.json +14 -0
  30. package/dist/locales/en/common.json +55 -27
  31. package/dist/locales/en/orders.json +9 -1
  32. package/dist/locales/en/products.json +15 -0
  33. package/dist/locales/pl/admins.json +62 -0
  34. package/dist/locales/pl/collections.json +14 -0
  35. package/dist/locales/pl/common.json +56 -28
  36. package/dist/locales/pl/orders.json +9 -1
  37. package/dist/locales/pl/products.json +15 -0
  38. package/dist/pages/Root.js +76 -35
  39. package/dist/pages/admins/Detail.js +1 -1
  40. package/dist/pages/admins/List.js +8 -3
  41. package/dist/pages/admins/Provision.js +173 -0
  42. package/dist/pages/admins/Provision.logic.js +53 -0
  43. package/dist/pages/admins/index.js +1 -0
  44. package/dist/pages/assets/List.js +3 -3
  45. package/dist/pages/channels/Detail.js +1 -1
  46. package/dist/pages/collections/Detail.js +9 -1
  47. package/dist/pages/collections/List.js +87 -20
  48. package/dist/pages/collections/_components/ContentsCard.js +1 -1
  49. package/dist/pages/collections/_components/collectionStorefrontAction/CollectionStorefrontAction.js +41 -0
  50. package/dist/pages/collections/_components/collectionStorefrontAction/CollectionStorefrontAction.logic.js +44 -0
  51. package/dist/pages/collections/_components/collectionStorefrontAction/index.js +2 -0
  52. package/dist/pages/countries/Detail.js +6 -1
  53. package/dist/pages/countries/List.js +1 -1
  54. package/dist/pages/dashboard/Dashboard.js +2 -2
  55. package/dist/pages/facets/Detail.js +6 -1
  56. package/dist/pages/facets/List.js +1 -1
  57. package/dist/pages/facets/_components/FacetDetailView.js +3 -2
  58. package/dist/pages/orders/_components/CancelAndRefundDialog.js +80 -19
  59. package/dist/pages/orders/_components/OrderLineImage.logic.js +4 -0
  60. package/dist/pages/orders/_components/Payments.js +39 -23
  61. package/dist/pages/orders/_components/ProductsCard.js +2 -3
  62. package/dist/pages/orders/_components/ProductsTable.js +13 -25
  63. package/dist/pages/orders/_components/TopActions.js +14 -8
  64. package/dist/pages/payment-methods/Detail.js +6 -1
  65. package/dist/pages/payment-methods/List.js +1 -1
  66. package/dist/pages/product-variants/List.js +7 -6
  67. package/dist/pages/products/Detail.js +9 -17
  68. package/dist/pages/products/List.js +3 -2
  69. package/dist/pages/products/ProductInitialVariantFormConfig.js +17 -0
  70. package/dist/pages/products/_components/Variant.js +13 -7
  71. package/dist/pages/products/_components/productStorefrontAction/ProductStorefrontAction.js +42 -0
  72. package/dist/pages/products/_components/productStorefrontAction/ProductStorefrontAction.logic.js +39 -0
  73. package/dist/pages/products/_components/productStorefrontAction/index.js +2 -0
  74. package/dist/pages/roles/Detail.js +1 -1
  75. package/dist/pages/sellers/Detail.js +1 -1
  76. package/dist/pages/shipping-methods/Detail.js +6 -1
  77. package/dist/pages/shipping-methods/List.js +1 -1
  78. package/dist/pages/status/_components/Jobs.js +2 -2
  79. package/dist/pages/stock-locations/Detail.js +1 -1
  80. package/dist/pages/tax-categories/Detail.js +3 -3
  81. package/dist/pages/tax-categories/List.js +1 -1
  82. package/dist/pages/tax-rates/Detail.js +6 -1
  83. package/dist/pages/tax-rates/List.js +1 -1
  84. package/dist/pages/zones/Detail.js +6 -1
  85. package/dist/pages/zones/List.js +1 -1
  86. package/dist/version.js +1 -1
  87. package/package.json +5 -5
@@ -476,6 +476,19 @@
476
476
  "edit": "Edit",
477
477
  "rebuildSerachIndex": "Rebuild search index",
478
478
  "fastLinks": "Quick links",
479
+ "account": "Account",
480
+ "openAccountMenu": "Open account menu",
481
+ "mainNavigation": "Main navigation",
482
+ "mobileNavigationDescription": "Navigate to an administration area.",
483
+ "openSidebar": "Open navigation",
484
+ "expandSidebar": "Expand navigation",
485
+ "collapseSidebar": "Collapse navigation",
486
+ "sidebarShortcut": "Ctrl or Command + B",
487
+ "expandNavigationGroup": "Expand navigation and open {{group}}",
488
+ "goToDashboard": "Go to dashboard",
489
+ "openGlobalSearch": "Open global search",
490
+ "openTopbarControls": "Open language, channel and plugin controls",
491
+ "versionAbbreviation": "version",
479
492
  "systemStatus": "System status",
480
493
  "globalSettings": "Global settings",
481
494
  "delete": "Delete",
@@ -568,33 +581,34 @@
568
581
  "options": "Options",
569
582
  "variants": "Variants",
570
583
  "adminUiV2": "Admin UI",
571
- "extensions": "extensions",
572
- "dashboard": "desktop",
573
- "status": "status",
574
- "products": "products",
575
- "customers": "customers",
576
- "customerGroups": "customer groups",
577
- "productVariants": "product variants",
578
- "collections": "collections",
579
- "orders": "orders",
580
- "facets": "aspects of",
581
- "channels": "channels",
582
- "globalSettings": "global settings",
583
- "roles": "roles",
584
- "admins": "administrators",
585
- "stock": "storage locations",
586
- "sellers": "retailers",
587
- "assets": "assets",
588
- "zones": "zones",
589
- "promotions": "promotions",
590
- "countries": "countries",
591
- "paymentMethods": "payment methods",
592
- "shippingMethods": "shipping methods",
593
- "stockLocations": "warehouse locations",
594
- "taxCategories": "tax categories",
595
- "taxRates": "tax rates",
596
- "logOut": "logout",
597
- "systemStatus": "system status"
584
+ "extensions": "Extensions",
585
+ "dashboard": "Dashboard",
586
+ "status": "Status",
587
+ "products": "Products",
588
+ "customers": "Customers",
589
+ "customerGroups": "Customer groups",
590
+ "productVariants": "Product variants",
591
+ "collections": "Collections",
592
+ "orders": "Orders",
593
+ "facets": "Facets",
594
+ "channels": "Channels",
595
+ "globalSettings": "Global settings",
596
+ "roles": "Roles",
597
+ "admins": "Administrators",
598
+ "adminProvision": "Administrator provisioning",
599
+ "stock": "Storage locations",
600
+ "sellers": "Sellers",
601
+ "assets": "Assets",
602
+ "zones": "Zones",
603
+ "promotions": "Promotions",
604
+ "countries": "Countries",
605
+ "paymentMethods": "Payment methods",
606
+ "shippingMethods": "Shipping methods",
607
+ "stockLocations": "Warehouse locations",
608
+ "taxCategories": "Tax categories",
609
+ "taxRates": "Tax rates",
610
+ "logOut": "Log out",
611
+ "systemStatus": "System status"
598
612
  },
599
613
  "noFilterField": "None",
600
614
  "draft": "Project",
@@ -958,13 +972,22 @@
958
972
  "asset": {
959
973
  "dialogTitle": "Select resource",
960
974
  "dialogButton": "Select resource",
975
+ "pickerDescription": "Choose one resource. Your selection is applied only after confirmation.",
976
+ "searchLabel": "Search resources by filename",
961
977
  "dialogSearchPlaceholder": "Searching for resources by name",
962
978
  "tags": "Filter by tag",
979
+ "removeTag": "Remove {{value}} filter",
963
980
  "perPageValue": "{{value}} per page",
964
981
  "confirmButton": "Add resource",
965
982
  "uploadButton": "Upload from disk",
966
983
  "cancel": "Cancel",
967
984
  "noImages": "No resources for a specific search",
985
+ "fetchError": "Resources could not be loaded. Try again.",
986
+ "loading": "Loading resources",
987
+ "selected": "Selected",
988
+ "resultRange": "{{from}}–{{to}} of {{total}}",
989
+ "paginationLabel": "Resource pages",
990
+ "actionsLabel": "Resource selection controls",
968
991
  "description": "Uploading and managing resources that can be used in content"
969
992
  },
970
993
  "product": {
@@ -985,6 +1008,11 @@
985
1008
  "undefined": "Other"
986
1009
  },
987
1010
  "selectedValue": "{{from}} of {{to}} lines selected",
1011
+ "dataTable": {
1012
+ "label": "Data table",
1013
+ "caption": "Data table. Scroll horizontally to view additional columns.",
1014
+ "selectionSummary": "{{selected}} of {{loaded}} loaded rows selected"
1015
+ },
988
1016
  "deleteOrCancel": "Delete/Cancel option selected",
989
1017
  "actionsMenu": {
990
1018
  "openMenu": "Open menu",
@@ -383,7 +383,15 @@
383
383
  "title": "Cancel and refund the order",
384
384
  "refund": "Refund",
385
385
  "returnToStock": "Return to warehouse",
386
- "refundShipping": "Return for shipment"
386
+ "refundShipping": "Refund shipping",
387
+ "cancelShipping": "Return shipping to stock",
388
+ "cancelShippingRequiresLines": "Select at least one item to return before returning shipping.",
389
+ "refundQuantity": "Refund quantity",
390
+ "reason": "Reason",
391
+ "suggestedAmount": "Calculated refund",
392
+ "auto": "Automatic",
393
+ "submit": "Apply cancellation and refund",
394
+ "error": "Could not apply cancellation or refund"
387
395
  },
388
396
  "create": {
389
397
  "addModal": {
@@ -42,6 +42,21 @@
42
42
  "removeVariant": "Usuń wariant",
43
43
  "removeVariantFromChannel": "Usuń wariant z kanału"
44
44
  },
45
+ "storefrontAction": {
46
+ "label": "Open in storefront",
47
+ "disabled": {
48
+ "productDisabled": "Enable and save the product before opening it in the storefront.",
49
+ "missingChannel": "Select a channel before opening the product in the storefront.",
50
+ "channelNotAssigned": "The saved product is not assigned to the selected channel.",
51
+ "missingSlug": "The saved product has no slug for the selected language.",
52
+ "unsavedSlug": "Save the current slug before opening the product in the storefront.",
53
+ "unsavedEnabled": "Save the current availability status before opening the product in the storefront.",
54
+ "resolverFailed": "The storefront URL could not be resolved.",
55
+ "resolverEmpty": "The storefront URL resolver returned no URL.",
56
+ "urlNotAbsolute": "The storefront URL must be absolute.",
57
+ "unsupportedProtocol": "The storefront URL must use HTTP or HTTPS."
58
+ }
59
+ },
45
60
  "initialVariant": {
46
61
  "title": "Initial variant",
47
62
  "description": "Create one default variant together with this product. If the variant name is empty, the product name will be used.",
@@ -32,6 +32,68 @@
32
32
  "placeholder": "Dodawanie ról do użytkownika"
33
33
  }
34
34
  },
35
+ "provision": {
36
+ "action": "Utwórz z rolą",
37
+ "title": "Utwórz administratora z rolą",
38
+ "description": "Użyj biznesowego presetu, żeby w jednym przepływie utworzyć rolę i przypisać ją do nowego administratora.",
39
+ "submit": "Utwórz administratora",
40
+ "submitting": "Tworzenie...",
41
+ "admin": {
42
+ "title": "Konto administratora",
43
+ "description": "Dane logowania i kontaktowe nowego administratora."
44
+ },
45
+ "role": {
46
+ "title": "Konfiguracja roli",
47
+ "description": "Utwórz nową rolę z wybranego presetu albo użyj istniejącej roli po kodzie.",
48
+ "code": "Kod roli",
49
+ "descriptionLabel": "Nazwa roli",
50
+ "reuseExisting": "Użyj istniejącej roli o tym kodzie",
51
+ "reuseExistingHint": "Po włączeniu tej opcji uprawnienia i kanały poniżej są ignorowane, a administrator otrzyma istniejącą rolę.",
52
+ "channels": "Kanały",
53
+ "channelsPlaceholder": "Dodaj kanał"
54
+ },
55
+ "permissions": {
56
+ "title": "Uprawnienia",
57
+ "description": "Przejrzyj preset i dostosuj uprawnienia przed utworzeniem roli.",
58
+ "reuseExisting": "Uprawnienia są pobierane z istniejącej roli, gdy włączone jest użycie istniejącej roli."
59
+ },
60
+ "presets": {
61
+ "title": "Preset biznesowy",
62
+ "description": "Zacznij od bezpiecznej roli operacyjnej i dostosuj ją, jeśli trzeba.",
63
+ "defaultBadge": "Domyślny",
64
+ "backendNote": "Backend nadal egzekwuje każde uprawnienie. Ten wizard tylko zakłada role i konta administratorów.",
65
+ "shopManager": {
66
+ "title": "Shop manager",
67
+ "description": "Obsługa zamówień, wsparcie klienta, widoczność katalogu, podgląd płatności/wysyłki i lokalizacji magazynowych.",
68
+ "roleDescription": "Shop manager"
69
+ }
70
+ },
71
+ "summary": {
72
+ "title": "Podsumowanie",
73
+ "description": "To zostanie wysłane.",
74
+ "role": "Rola",
75
+ "channels": "Kanały",
76
+ "permissions": "Uprawnienia",
77
+ "mode": "Tryb",
78
+ "create": "Utwórz rolę",
79
+ "reuse": "Użyj roli"
80
+ },
81
+ "validation": {
82
+ "emailRequired": "Adres e-mail jest wymagany",
83
+ "emailInvalid": "Podaj poprawny adres e-mail",
84
+ "roleCodeRequired": "Kod roli jest wymagany",
85
+ "channelsRequired": "Wybierz co najmniej jeden kanał",
86
+ "permissionsRequired": "Wybierz co najmniej jedno uprawnienie",
87
+ "roleCodeExists": "Rola o tym kodzie już istnieje. Włącz użycie istniejącej roli albo wybierz inny kod.",
88
+ "roleNotFound": "Nie znaleziono istniejącej roli o tym kodzie."
89
+ },
90
+ "toasts": {
91
+ "success": "Administrator i rola zostały utworzone pomyślnie",
92
+ "error": "Nie udało się utworzyć administratora z rolą",
93
+ "roleCodeExists": "Rola o tym kodzie już istnieje",
94
+ "roleNotFound": "Nie znaleziono istniejącej roli o tym kodzie"
95
+ }
96
+ },
35
97
  "toasts": {
36
98
  "adminLoadingError": "Nie udało się załadować administratora o identyfikatorze {{value}}",
37
99
  "adminUpdateSuccess": "Administrator został pomyślnie zaktualizowany",
@@ -7,6 +7,20 @@
7
7
  "baseInfoUpdated": "Zaktualizowano: {{value}}",
8
8
  "buttonDisabledTooltip": "Wypełnij wszystkie wymagane pola",
9
9
  "noChangesTooltip": "Nie wprowadzono żadnych zmian",
10
+ "storefrontAction": {
11
+ "label": "Otwórz w sklepie",
12
+ "disabled": {
13
+ "collectionPrivate": "Ustaw kolekcję jako publiczną i zapisz ją, aby otworzyć ją w sklepie.",
14
+ "missingChannel": "Wybierz kanał, aby otworzyć kolekcję w sklepie.",
15
+ "missingSlug": "Zapisana kolekcja nie ma slugu dla wybranego języka.",
16
+ "unsavedPrivate": "Zapisz bieżącą widoczność, aby otworzyć kolekcję w sklepie.",
17
+ "unsavedSlug": "Zapisz bieżący slug, aby otworzyć kolekcję w sklepie.",
18
+ "resolverFailed": "Nie udało się wyznaczyć adresu URL sklepu.",
19
+ "resolverEmpty": "Konfiguracja sklepu nie zwróciła adresu URL.",
20
+ "urlNotAbsolute": "Adres URL sklepu musi być bezwzględny.",
21
+ "unsupportedProtocol": "Adres URL sklepu musi używać protokołu HTTP lub HTTPS."
22
+ }
23
+ },
10
24
  "table": {
11
25
  "id": "ID",
12
26
  "name": "Nazwa",
@@ -475,6 +475,19 @@
475
475
  "edit": "Edytuj",
476
476
  "rebuildSerachIndex": "Przebuduj search index",
477
477
  "fastLinks": "Szybkie linki",
478
+ "account": "Konto",
479
+ "openAccountMenu": "Otwórz menu konta",
480
+ "mainNavigation": "Główna nawigacja",
481
+ "mobileNavigationDescription": "Przejdź do wybranego obszaru administracyjnego.",
482
+ "openSidebar": "Otwórz nawigację",
483
+ "expandSidebar": "Rozwiń nawigację",
484
+ "collapseSidebar": "Zwiń nawigację",
485
+ "sidebarShortcut": "Ctrl lub Command + B",
486
+ "expandNavigationGroup": "Rozwiń nawigację i otwórz grupę {{group}}",
487
+ "goToDashboard": "Przejdź do pulpitu",
488
+ "openGlobalSearch": "Otwórz wyszukiwanie globalne",
489
+ "openTopbarControls": "Otwórz ustawienia języka, kanału i wtyczek",
490
+ "versionAbbreviation": "wersja",
478
491
  "systemStatus": "Status systemu",
479
492
  "globalSettings": "Ustawienia globalne",
480
493
  "delete": "Usuń",
@@ -567,33 +580,34 @@
567
580
  "options": "Opcje produktu",
568
581
  "variants": "Warianty",
569
582
  "adminUiV2": "Admin UI",
570
- "extensions": "rozszerzenia",
571
- "dashboard": "pulpit",
572
- "status": "status",
573
- "products": "produkty",
574
- "customers": "klienci",
575
- "customerGroups": "grupy klientów",
576
- "productVariants": "warianty produktów",
577
- "collections": "kolekcje",
578
- "orders": "zamówienia",
579
- "facets": "aspekty",
580
- "channels": "kanały",
581
- "globalSettings": "ustawienia globalne",
582
- "roles": "role",
583
- "admins": "administratorzy",
584
- "stock": "lokalizacje magazynowe",
585
- "sellers": "sprzedawcy",
586
- "assets": "aktywa",
587
- "zones": "strefy",
588
- "promotions": "promocje",
589
- "countries": "kraje",
590
- "paymentMethods": "metody płatności",
591
- "shippingMethods": "metody wysyłki",
592
- "stockLocations": "lokacje magazynów",
593
- "taxCategories": "kategorie podatkowe",
594
- "taxRates": "stawki podatkowe",
595
- "logOut": "wylogowanie",
596
- "systemStatus": "status systemu"
583
+ "extensions": "Rozszerzenia",
584
+ "dashboard": "Pulpit",
585
+ "status": "Status",
586
+ "products": "Produkty",
587
+ "customers": "Klienci",
588
+ "customerGroups": "Grupy klientów",
589
+ "productVariants": "Warianty produktów",
590
+ "collections": "Kolekcje",
591
+ "orders": "Zamówienia",
592
+ "facets": "Aspekty",
593
+ "channels": "Kanały",
594
+ "globalSettings": "Ustawienia globalne",
595
+ "roles": "Role",
596
+ "admins": "Administratorzy",
597
+ "adminProvision": "Zakładanie administratora",
598
+ "stock": "Lokalizacje magazynowe",
599
+ "sellers": "Sprzedawcy",
600
+ "assets": "Aktywa",
601
+ "zones": "Strefy",
602
+ "promotions": "Promocje",
603
+ "countries": "Kraje",
604
+ "paymentMethods": "Metody płatności",
605
+ "shippingMethods": "Metody wysyłki",
606
+ "stockLocations": "Lokacje magazynów",
607
+ "taxCategories": "Kategorie podatkowe",
608
+ "taxRates": "Stawki podatkowe",
609
+ "logOut": "Wylogowanie",
610
+ "systemStatus": "Status systemu"
597
611
  },
598
612
  "noFilterField": "Brak",
599
613
  "draft": "Projekt",
@@ -651,7 +665,7 @@
651
665
  "notifications": "Powiadomienia",
652
666
  "noNewNotifications": "Brak nowych powiadomień",
653
667
  "toggleNotifications": "Przełącz powiadomienia",
654
- "dashboard": "Pulpit nawigacyjny",
668
+ "dashboard": "Pulpit",
655
669
  "search": {
656
670
  "advanceToggle": "Wyszukiwanie zaawansowane",
657
671
  "basicToggle": "Wyszukiwanie podstawowe",
@@ -957,13 +971,22 @@
957
971
  "asset": {
958
972
  "dialogTitle": "Wybierz zasób",
959
973
  "dialogButton": "Wybierz zasób",
974
+ "pickerDescription": "Wybierz jeden zasób. Wybór zostanie zastosowany dopiero po potwierdzeniu.",
975
+ "searchLabel": "Szukaj zasobów według nazwy pliku",
960
976
  "dialogSearchPlaceholder": "Wyszukiwanie zasobów według nazwy",
961
977
  "tags": "Filtruj według tagu",
978
+ "removeTag": "Usuń filtr {{value}}",
962
979
  "perPageValue": "{{value}} na stronę",
963
980
  "confirmButton": "Dodaj zasób",
964
981
  "uploadButton": "Prześlij z dysku",
965
982
  "cancel": "Anuluj",
966
983
  "noImages": "Brak zasobów dla określonego wyszukiwania",
984
+ "fetchError": "Nie udało się załadować zasobów. Spróbuj ponownie.",
985
+ "loading": "Ładowanie zasobów",
986
+ "selected": "Wybrano",
987
+ "resultRange": "{{from}}–{{to}} z {{total}}",
988
+ "paginationLabel": "Strony zasobów",
989
+ "actionsLabel": "Elementy sterujące wyborem zasobu",
967
990
  "description": "Przesyłanie i zarządzanie zasobami, które mogą być używane w treści"
968
991
  },
969
992
  "product": {
@@ -984,6 +1007,11 @@
984
1007
  "undefined": "Inne"
985
1008
  },
986
1009
  "selectedValue": "wybrano {{from}} z {{to}} wierszy",
1010
+ "dataTable": {
1011
+ "label": "Tabela danych",
1012
+ "caption": "Tabela danych. Przewiń poziomo, aby zobaczyć dodatkowe kolumny.",
1013
+ "selectionSummary": "Wybrano {{selected}} z {{loaded}} wczytanych wierszy"
1014
+ },
987
1015
  "deleteOrCancel": "Wybrano opcję Usuń/Anuluj",
988
1016
  "actionsMenu": {
989
1017
  "openMenu": "Otwórz menu",
@@ -383,7 +383,15 @@
383
383
  "title": "Anuluj i refunduj zamówienie",
384
384
  "refund": "Refunduj",
385
385
  "returnToStock": "Zwróć do magazynu",
386
- "refundShipping": "Zwróć za przesyłkę"
386
+ "refundShipping": "Zwróć koszt przesyłki",
387
+ "cancelShipping": "Zwróć przesyłkę do magazynu",
388
+ "cancelShippingRequiresLines": "Wybierz co najmniej jeden produkt do zwrotu przed zwrotem przesyłki.",
389
+ "refundQuantity": "Ilość do refundacji",
390
+ "reason": "Powód",
391
+ "suggestedAmount": "Wyliczony zwrot",
392
+ "auto": "Automatycznie",
393
+ "submit": "Zastosuj anulowanie i zwrot",
394
+ "error": "Nie udało się anulować lub zwrócić płatności"
387
395
  },
388
396
  "create": {
389
397
  "addModal": {
@@ -42,6 +42,21 @@
42
42
  "removeVariant": "Usuń wariant",
43
43
  "removeVariantFromChannel": "Usuń wariant z kanału"
44
44
  },
45
+ "storefrontAction": {
46
+ "label": "Otwórz w sklepie",
47
+ "disabled": {
48
+ "productDisabled": "Włącz i zapisz produkt, aby otworzyć go w sklepie.",
49
+ "missingChannel": "Wybierz kanał, aby otworzyć produkt w sklepie.",
50
+ "channelNotAssigned": "Zapisany produkt nie jest przypisany do wybranego kanału.",
51
+ "missingSlug": "Zapisany produkt nie ma slugu dla wybranego języka.",
52
+ "unsavedSlug": "Zapisz bieżący slug, aby otworzyć produkt w sklepie.",
53
+ "unsavedEnabled": "Zapisz bieżący status dostępności, aby otworzyć produkt w sklepie.",
54
+ "resolverFailed": "Nie udało się wyznaczyć adresu URL sklepu.",
55
+ "resolverEmpty": "Konfiguracja sklepu nie zwróciła adresu URL.",
56
+ "urlNotAbsolute": "Adres URL sklepu musi być bezwzględny.",
57
+ "unsupportedProtocol": "Adres URL sklepu musi używać protokołu HTTP lub HTTPS."
58
+ }
59
+ },
45
60
  "initialVariant": {
46
61
  "title": "Początkowy wariant",
47
62
  "description": "Utwórz jeden domyślny wariant razem z tym produktem. Jeśli nazwa wariantu jest pusta, zostanie użyta nazwa produktu.",
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { CanLeaveRouteDialog } from "../components";
3
3
  import { serverConfigSelector, configurableOperationDefinitionSelector, countrySelector, apiClient, useOrder, useNotifications, DEFAULT_CHANNEL_CODE, useTranslation, capitalizeFirstLetter, } from '@deenruv/react-ui-devkit';
4
- import { useCallback, useEffect } from 'react';
4
+ import { useCallback, useEffect, useRef } from 'react';
5
5
  import { Outlet, useLocation, useSearchParams } from 'react-router';
6
6
  import { toast } from 'sonner';
7
7
  import { activeAdministratorSelector, paymentMethodsSelector, useServer, useSettings, } from '@deenruv/react-ui-devkit';
@@ -10,6 +10,8 @@ import { GlobalSearch } from "../components/GlobalSearch.js";
10
10
  import { ContentAreaSkeleton } from "../components/ContentAreaSkeleton.js";
11
11
  import { DeenruvDeveloperIndicator } from "../DeenruvDeveloperIndicator.js";
12
12
  import { Permission } from '@deenruv/admin-types';
13
+ import { selectPreferredChannel } from "../access/channel-selection.js";
14
+ import { ErrorPage } from "./Custom404.js";
13
15
  const TAKE = 100;
14
16
  const getAllPaginatedCountries = async () => {
15
17
  let countries = [];
@@ -45,14 +47,17 @@ const getAllPaymentMethods = async () => {
45
47
  export const Root = ({ allPaths }) => {
46
48
  const isLocalhost = window.location.hostname === 'localhost';
47
49
  const { t } = useTranslation('common');
48
- const setActiveAdministrator = useServer((p) => p.setActiveAdministrator);
49
- const setUserPermissions = useServer((p) => p.setUserPermissions);
50
+ const failAdministratorAccess = useServer((p) => p.failAdministratorAccess);
51
+ const beginAdministratorAccessInitialization = useServer((p) => p.beginAdministratorAccessInitialization);
52
+ const setAdministratorAccess = useServer((p) => p.setAdministratorAccess);
53
+ const setSelectedChannelPermissions = useServer((p) => p.setSelectedChannelPermissions);
50
54
  const setServerConfig = useServer((p) => p.setServerConfig);
51
55
  const setCountries = useServer((p) => p.setCountries);
52
56
  const setFulfillmentHandlers = useServer((p) => p.setFulfillmentHandlers);
53
57
  const setPaymentMethodsType = useServer((p) => p.setPaymentMethodsType);
54
58
  const fetchPendingJobs = useServer((p) => p.fetchPendingJobs);
55
59
  const loaded = useServer((p) => p.loaded);
60
+ const administratorAccessState = useServer((p) => p.administratorAccessState);
56
61
  const setLoaded = useServer((p) => p.setLoaded);
57
62
  const setAvailableLanguages = useSettings((p) => p.setAvailableLanguages);
58
63
  const setLanguage = useSettings((p) => p.setLanguage);
@@ -68,6 +73,10 @@ export const Root = ({ allPaths }) => {
68
73
  const channel = useSettings((p) => p.selectedChannel);
69
74
  const location = useLocation();
70
75
  const [searchParams] = useSearchParams();
76
+ const hasInitializedAdministratorAccess = useRef(false);
77
+ useEffect(() => {
78
+ setSelectedChannelPermissions(selectedChannel?.id);
79
+ }, [selectedChannel?.id, setSelectedChannelPermissions]);
71
80
  const managePageTitle = useCallback(() => {
72
81
  const pathname = location.pathname;
73
82
  const isDeenruvPath = allPaths.some((path) => pathname.startsWith(path));
@@ -143,17 +152,37 @@ export const Root = ({ allPaths }) => {
143
152
  };
144
153
  }, [notifications.map((n) => n.id).join(','), loaded]);
145
154
  useEffect(() => {
155
+ if (administratorAccessState !== 'pending' || hasInitializedAdministratorAccess.current)
156
+ return;
157
+ hasInitializedAdministratorAccess.current = true;
158
+ beginAdministratorAccessInitialization();
159
+ const uiSettings = window.__DEENRUV_SETTINGS__.ui;
160
+ if (uiSettings?.showLanguagePicker === false) {
161
+ setLanguage(uiSettings.defaultLanguageCode);
162
+ setTranslationLanguage(uiSettings.defaultTranslationLanguageCode);
163
+ }
146
164
  const init = async () => {
147
165
  const activeAdministratorResponse = await apiClient('query')({
148
166
  activeAdministrator: activeAdministratorSelector,
149
167
  });
150
168
  const roles = activeAdministratorResponse.activeAdministrator?.user.roles || [];
151
169
  if (!activeAdministratorResponse.activeAdministrator) {
170
+ failAdministratorAccess();
171
+ setLoaded(true);
152
172
  toast.error(t('setup.failedAdmin'));
173
+ return;
153
174
  }
154
175
  else {
155
- setActiveAdministrator(activeAdministratorResponse.activeAdministrator);
156
- setUserPermissions(Array.from(new Set(roles.flatMap((role) => role.permissions))));
176
+ const channelPickerIsHidden = uiSettings?.showChannelPicker === false;
177
+ const configuredChannelCode = uiSettings?.defaultChannelCode;
178
+ const failFixedChannelInitialization = () => {
179
+ failAdministratorAccess();
180
+ setLoaded(true);
181
+ toast.error(t('setup.failedAdmin'), {
182
+ description: `Configured channel "${configuredChannelCode}" is not accessible to this administrator.`,
183
+ });
184
+ };
185
+ let administratorChannelId = selectedChannel?.id;
157
186
  if ([Permission.ReadChannel].some((p) => roles.some((r) => r.permissions.includes(p)))) {
158
187
  const { channels: { items: allChannels = [] }, } = await apiClient('query')({
159
188
  channels: [
@@ -171,41 +200,50 @@ export const Root = ({ allPaths }) => {
171
200
  ],
172
201
  });
173
202
  setChannels(allChannels);
174
- if (!channel) {
175
- if (selectedChannel) {
176
- const foundChannel = allChannels.find((ch) => ch.code === selectedChannel.code);
177
- setSelectedChannel(foundChannel || allChannels[0]);
178
- }
179
- const existingChannel = allChannels.find((ch) => ch.code === window?.__DEENRUV_SETTINGS__?.ui?.defaultChannelCode);
180
- if (existingChannel) {
181
- setSelectedChannel(existingChannel);
182
- }
183
- const defaultChannel = allChannels.find((ch) => ch.code === DEFAULT_CHANNEL_CODE) || allChannels[0];
184
- setSelectedChannel(defaultChannel);
203
+ const preferredChannel = selectPreferredChannel(allChannels, selectedChannel, configuredChannelCode, DEFAULT_CHANNEL_CODE, channelPickerIsHidden);
204
+ if (channelPickerIsHidden && !preferredChannel) {
205
+ failFixedChannelInitialization();
206
+ return;
185
207
  }
208
+ if (preferredChannel && preferredChannel.id !== channel?.id) {
209
+ setSelectedChannel(preferredChannel);
210
+ }
211
+ administratorChannelId = preferredChannel?.id;
186
212
  }
187
213
  else {
188
214
  const possibleChannels = roles.flatMap((role) => role.channels);
189
215
  if (possibleChannels.length > 0) {
190
- setSelectedChannel(possibleChannels[0]);
216
+ const preferredChannel = channelPickerIsHidden
217
+ ? selectPreferredChannel(possibleChannels, selectedChannel, configuredChannelCode, DEFAULT_CHANNEL_CODE, true)
218
+ : possibleChannels[0];
219
+ if (!preferredChannel) {
220
+ failFixedChannelInitialization();
221
+ return;
222
+ }
223
+ setSelectedChannel(preferredChannel);
224
+ administratorChannelId = preferredChannel.id;
225
+ }
226
+ else if (channelPickerIsHidden) {
227
+ failFixedChannelInitialization();
228
+ return;
191
229
  }
192
230
  }
231
+ setAdministratorAccess(activeAdministratorResponse.activeAdministrator, administratorChannelId);
193
232
  }
194
- // WE NEED TO CHECK IF LOCALSTORAGE HAS LANGUAGE SET
195
- if (window?.__DEENRUV_SETTINGS__?.ui?.defaultLanguageCode) {
196
- // window?.__DEENRUV_SETTINGS__.i18n.changeLanguage(window?.__DEENRUV_SETTINGS__?.ui?.defaultLanguageCode);
197
- // setLanguage(window?.__DEENRUV_SETTINGS__?.ui?.defaultLanguageCode);
233
+ try {
234
+ const { globalSettings } = await apiClient('query')({
235
+ globalSettings: { serverConfig: serverConfigSelector, availableLanguages: true },
236
+ });
237
+ fetchPendingJobs();
238
+ initializeOrderCustomFields(globalSettings.serverConfig);
239
+ setLoaded(true);
240
+ setServerConfig(globalSettings.serverConfig);
241
+ setAvailableLanguages(globalSettings.availableLanguages);
198
242
  }
199
- // WE NEED TO CHECK IF LOCALSTORAGE HAS LANGUAGE SET
200
- if (window?.__DEENRUV_SETTINGS__?.ui?.defaultTranslationLanguageCode) {
201
- // setTranslationLanguage(window?.__DEENRUV_SETTINGS__?.ui?.defaultTranslationLanguageCode);
243
+ catch {
244
+ toast.error(t('setup.failedServer'));
245
+ setLoaded(true);
202
246
  }
203
- const { globalSettings } = await apiClient('query')({
204
- globalSettings: { serverConfig: serverConfigSelector, availableLanguages: true },
205
- });
206
- fetchPendingJobs();
207
- initializeOrderCustomFields(globalSettings.serverConfig);
208
- setLoaded(true);
209
247
  if ([Permission.ReadCountry, Permission.ReadPaymentMethod, Permission.ReadOrder].some((p) => roles.some((r) => r.permissions.includes(p)))) {
210
248
  const [countriesResponse, paymentsResponse, fulfillmentsResponse] = await Promise.allSettled([
211
249
  getAllPaginatedCountries(),
@@ -216,8 +254,6 @@ export const Root = ({ allPaths }) => {
216
254
  toast.error(t('setup.failedServer'));
217
255
  }
218
256
  else {
219
- setServerConfig(globalSettings.serverConfig);
220
- setAvailableLanguages(globalSettings.availableLanguages);
221
257
  // const socket = serverConfigResponse.value.globalSettings.serverConfig.plugins?.find(
222
258
  // (plugin) => plugin.name === 'AexolAdminsPlugin',
223
259
  // );
@@ -243,10 +279,15 @@ export const Root = ({ allPaths }) => {
243
279
  }
244
280
  }
245
281
  };
246
- fetchGraphQLSchema().then(async (schema) => {
282
+ fetchGraphQLSchema()
283
+ .then(async (schema) => {
247
284
  window.__DEENRUV_SCHEMA__ = schema;
248
285
  await init();
286
+ })
287
+ .catch(() => {
288
+ failAdministratorAccess();
289
+ setLoaded(true);
249
290
  });
250
- }, []);
251
- return (_jsx(_Fragment, { children: _jsxs("div", { className: "flex max-h-screen w-full max-w-full overflow-hidden bg-background text-foreground antialiased", children: [_jsx(Menu, { children: loaded ? _jsx(Outlet, {}) : _jsx(ContentAreaSkeleton, {}) }), loaded && (_jsxs(_Fragment, { children: [_jsx(GlobalSearch, {}), _jsx(CanLeaveRouteDialog, {}), isLocalhost ? _jsx(DeenruvDeveloperIndicator, {}) : null] }))] }) }));
291
+ }, [administratorAccessState]);
292
+ return (_jsx(_Fragment, { children: _jsxs("div", { className: "flex max-h-screen w-full max-w-full overflow-hidden bg-background text-foreground antialiased", children: [_jsx(Menu, { children: administratorAccessState === 'unavailable' ? (_jsx(ErrorPage, {})) : administratorAccessState === 'pending' || !loaded ? (_jsx(ContentAreaSkeleton, {})) : (_jsx(Outlet, {})) }), loaded && administratorAccessState === 'ready' && (_jsxs(_Fragment, { children: [_jsx(GlobalSearch, {}), _jsx(CanLeaveRouteDialog, {}), isLocalhost ? _jsx(DeenruvDeveloperIndicator, {}) : null] }))] }) }));
252
293
  };
@@ -45,7 +45,7 @@ export const AdminsDetailPage = () => {
45
45
  if (!id) {
46
46
  throw new Error('Could not find the id.');
47
47
  }
48
- return remove({ input: { id } });
48
+ return remove({ id });
49
49
  }, [remove, id]);
50
50
  return (_jsx("div", { className: "relative flex flex-col gap-y-4", children: _jsx(DetailView, { id: id, locationId: "admins-detail-view", main: {
51
51
  name: 'admin',