Skip to content

Commit 815c0c9

Browse files
committed
Add export buttons to lists
1 parent dbcc282 commit 815c0c9

File tree

18 files changed

+51
-21
lines changed

18 files changed

+51
-21
lines changed

client/public/locales/cs/common.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"notAccessTitle": "Nemáte oprávnění k přístupu",
2929
"hideColumns": "Skrýt sloupce",
3030
"clearFilters": "Zrušit filtry",
31-
"saveAndAdd": "Uložit a přidat"
31+
"saveAndAdd": "Uložit a přidat",
32+
"export": "Exportovat"
3233
},
3334
"warnWhenUnsavedChanges": "Jste si jisti, že chcete odejít? Máte neuložené změny.",
3435
"notifications": {

client/public/locales/de/common.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"archive": "Archivieren",
2929
"hideArchived": "Archivierte verstecken",
3030
"unArchive": "Archivieren rückgängig",
31-
"saveAndAdd": "Speichern und hinzufügen"
31+
"saveAndAdd": "Speichern und hinzufügen",
32+
"export": "Export"
3233
},
3334
"warnWhenUnsavedChanges": "Sicher? Nicht gespeicherte Änderungen gehen verloren!",
3435
"notifications": {

client/public/locales/en/common.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"showArchived": "Show Archived",
2929
"notAccessTitle": "You don't have permission to access",
3030
"hideColumns": "Hide Columns",
31-
"clearFilters": "Clear Filters"
31+
"clearFilters": "Clear Filters",
32+
"export": "Export"
3233
},
3334
"warnWhenUnsavedChanges": "Are you sure you want to leave? You have unsaved changes.",
3435
"notifications": {

client/public/locales/es/common.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"notAccessTitle": "No tienes permiso de acceso",
2929
"hideColumns": "Ocultar Columnas",
3030
"clearFilters": "Borrar filtros",
31-
"saveAndAdd": "Guardar y añadir"
31+
"saveAndAdd": "Guardar y añadir",
32+
"export": "Exportar"
3233
},
3334
"warnWhenUnsavedChanges": "Seguro que quieres salir?. Hay cambios sin guardar.",
3435
"notifications": {

client/public/locales/fr/common.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@
154154
"unArchive": "Désarchiver",
155155
"clone": "Cloner",
156156
"clear": "Effacer",
157-
"saveAndAdd": "Sauvegarder et ajouter"
157+
"saveAndAdd": "Sauvegarder et ajouter",
158+
"export": "Exporter"
158159
},
159160
"filament": {
160161
"fields_help": {

client/public/locales/hu/common.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@
152152
"clearFilters": "Szűrők törlése",
153153
"unArchive": "Arhiválás visszavonása",
154154
"clone": "Másolás",
155-
"clear": "Törlés"
155+
"clear": "Törlés",
156+
"export": "Exportálás"
156157
},
157158
"filament": {
158159
"fields_help": {

client/public/locales/it/common.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@
153153
"clearFilters": "Cancella Filtri",
154154
"unArchive": "Ripristina",
155155
"clone": "Clona",
156-
"clear": "Pulisci"
156+
"clear": "Pulisci",
157+
"export": "Esporta"
157158
},
158159
"filament": {
159160
"fields_help": {

client/public/locales/nb-NO/common.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"filter": "Filtrer",
2222
"refresh": "Gjenoppfrisk",
2323
"notAccessTitle": "Du har ikke rettighet til å få tilgang",
24-
"saveAndAdd": "Lagre og legg til"
24+
"saveAndAdd": "Lagre og legg til",
25+
"export": "Eksporter"
2526
},
2627
"filament": {
2728
"fields": {

client/public/locales/nl/common.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"unArchive": "Dearchiveren",
2222
"clone": "Klonen",
2323
"clear": "Wissen",
24-
"saveAndAdd": "Opslaan en Toevoegen"
24+
"saveAndAdd": "Opslaan en Toevoegen",
25+
"export": "Exporteren"
2526
},
2627
"actions": {
2728
"create": "Aanmaken",

client/public/locales/pl/common.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"notAccessTitle": "Nie masz zezwolenia na dostęp",
2929
"hideColumns": "Edytuj kolumny",
3030
"clearFilters": "Wyczyść filtry",
31-
"saveAndAdd": "Zapisz i dodaj"
31+
"saveAndAdd": "Zapisz i dodaj",
32+
"export": "Eksportuj"
3233
},
3334
"spool": {
3435
"titles": {

client/public/locales/ru/common.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"showArchived": "Показать архивные",
2828
"notAccessTitle": "У вас нет разрешения на доступ",
2929
"hideColumns": "Скрыть столбцы",
30-
"clearFilters": "Очистить фильтр"
30+
"clearFilters": "Очистить фильтр",
31+
"export": "Экспорт"
3132
},
3233
"warnWhenUnsavedChanges": "Вы уверены, что хотите выйти? У вас есть несохраненные изменения.",
3334
"notifications": {

client/public/locales/sv/common.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"notAccessTitle": "Du har inte tillgång till denna sida",
2929
"hideColumns": "Dölj kolumner",
3030
"clearFilters": "Rensa filter",
31-
"saveAndAdd": "Spara och Lägg till"
31+
"saveAndAdd": "Spara och Lägg till",
32+
"export": "Exportera"
3233
},
3334
"warnWhenUnsavedChanges": "Är du säker på att du vill lämna sidan? Du har osparade ändringar.",
3435
"notifications": {

client/public/locales/uk/common.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"logout": "Вийти",
2121
"notAccessTitle": "У Вас бракує прав для доступу",
2222
"clone": "Клонувати",
23-
"unArchive": "Розархівувати"
23+
"unArchive": "Розархівувати",
24+
"export": "Експорт"
2425
},
2526
"spool": {
2627
"fields": {

client/public/locales/zh/common.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"showArchived": "显示存档",
2828
"notAccessTitle": "您没有访问权限",
2929
"hideColumns": "隐藏列",
30-
"clearFilters": "清除筛选器"
30+
"clearFilters": "清除筛选器",
31+
"export": "导出到"
3132
},
3233
"warnWhenUnsavedChanges": "您确定要离开吗?您有未保存的更改。",
3334
"notifications": {

client/src/pages/filaments/list.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
2-
import { IResourceComponentsProps, useTranslate, useInvalidate, useNavigation } from "@refinedev/core";
3-
import { useTable, List } from "@refinedev/antd";
2+
import { IResourceComponentsProps, useTranslate, useInvalidate, useNavigation, useExport } from "@refinedev/core";
3+
import { useTable, List, ExportButton } from "@refinedev/antd";
44
import { Table, Button, Dropdown } from "antd";
55
import dayjs from "dayjs";
66
import utc from "dayjs/plugin/utc";
@@ -24,6 +24,7 @@ import {
2424
} from "../../components/otherModels";
2525
import { useLiveify } from "../../components/liveify";
2626
import { removeUndefined } from "../../utils/filtering";
27+
import {IVendor} from "../vendors/model";
2728

2829
dayjs.extend(utc);
2930

@@ -75,6 +76,8 @@ export const FilamentList: React.FC<IResourceComponentsProps> = () => {
7576
// Load initial state
7677
const initialState = useInitialTableState(namespace);
7778

79+
const { triggerExport, exportLoading } = useExport<IVendor>();
80+
7881
// Fetch data from the API
7982
// To provide the live updates, we use a custom solution (useLiveify) instead of the built-in refine "liveMode" feature.
8083
// This is because the built-in feature does not call the liveProvider subscriber with a list of IDs, but instead
@@ -183,6 +186,9 @@ export const FilamentList: React.FC<IResourceComponentsProps> = () => {
183186
</Button>
184187
</Dropdown>
185188
{defaultButtons}
189+
<ExportButton type="dashed" onClick={triggerExport} loading={exportLoading} >
190+
{t("buttons.export")}
191+
</ExportButton>
186192
</>
187193
)}
188194
>

client/src/pages/spools/list.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
2-
import { IResourceComponentsProps, useInvalidate, useNavigation, useTranslate } from "@refinedev/core";
3-
import { useTable, List } from "@refinedev/antd";
2+
import { IResourceComponentsProps, useInvalidate, useNavigation, useTranslate, useExport } from "@refinedev/core";
3+
import { useTable, List, ExportButton } from "@refinedev/antd";
44
import { Table, Button, Dropdown, Modal } from "antd";
55
import dayjs from "dayjs";
66
import utc from "dayjs/plugin/utc";
@@ -98,6 +98,8 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
9898
// State for the switch to show archived spools
9999
const [showArchived, setShowArchived] = useSavedState("spoolList-showArchived", false);
100100

101+
const { triggerExport, exportLoading } = useExport<ISpoolCollapsed>();
102+
101103
// Fetch data from the API
102104
// To provide the live updates, we use a custom solution (useLiveify) instead of the built-in refine "liveMode" feature.
103105
// This is because the built-in feature does not call the liveProvider subscriber with a list of IDs, but instead
@@ -261,6 +263,9 @@ export const SpoolList: React.FC<IResourceComponentsProps> = () => {
261263
</Button>
262264
</Dropdown>
263265
{defaultButtons}
266+
<ExportButton type="dashed" onClick={triggerExport} loading={exportLoading} >
267+
{t("buttons.export")}
268+
</ExportButton>
264269
</>
265270
)}
266271
>

client/src/pages/vendors/list.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
2-
import { IResourceComponentsProps, useTranslate, useInvalidate, useNavigation } from "@refinedev/core";
3-
import { useTable, List } from "@refinedev/antd";
2+
import { IResourceComponentsProps, useTranslate, useInvalidate, useNavigation, useExport } from "@refinedev/core";
3+
import { useTable, List, ExportButton } from "@refinedev/antd";
44
import { Table, Button, Dropdown } from "antd";
55
import dayjs from "dayjs";
66
import utc from "dayjs/plugin/utc";
@@ -24,6 +24,8 @@ export const VendorList: React.FC<IResourceComponentsProps> = () => {
2424
// Load initial state
2525
const initialState = useInitialTableState(namespace);
2626

27+
const { triggerExport, exportLoading } = useExport<IVendor>();
28+
2729
// Fetch data from the API
2830
const { tableProps, sorters, setSorters, filters, setFilters, current, pageSize, setCurrent } = useTable<IVendor>({
2931
syncWithLocation: false,
@@ -120,6 +122,9 @@ export const VendorList: React.FC<IResourceComponentsProps> = () => {
120122
</Button>
121123
</Dropdown>
122124
{defaultButtons}
125+
<ExportButton type="dashed" onClick={triggerExport} loading={exportLoading} >
126+
{t("buttons.export")}
127+
</ExportButton>
123128
</>
124129
)}
125130
>

spoolman/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
)
3838
app.add_middleware(GZipMiddleware)
3939
app.mount("/api/v1", v1_app)
40-
app.mount("/", app=SinglePageApplication(directory="client/dist"), name="client")
40+
# app.mount("/", app=SinglePageApplication(directory="client/dist"), name="client")
4141

4242

4343
# Allow all origins if in debug mode

0 commit comments

Comments
 (0)