saleor-dashboard/src/config.ts

99 lines
2.6 KiB
TypeScript
Raw Normal View History

2019-11-25 16:23:52 +00:00
import packageInfo from "../package.json";
2019-11-20 10:24:42 +00:00
import { SearchVariables } from "./hooks/makeSearch";
import { ListSettings, ListViews, Pagination } from "./types";
2019-06-19 14:40:52 +00:00
2020-05-25 23:38:52 +00:00
export const APP_MOUNT_URI = process.env.APP_MOUNT_URI;
export const API_URI = process.env.API_URI;
2019-06-19 14:40:52 +00:00
2019-11-20 10:24:42 +00:00
export const DEFAULT_INITIAL_SEARCH_DATA: SearchVariables = {
2019-06-19 14:40:52 +00:00
after: null,
2019-10-16 09:27:42 +00:00
first: 20,
2019-06-19 14:40:52 +00:00
query: ""
};
export const DEFAULT_INITIAL_PAGINATION_DATA: Pagination = {
after: undefined,
before: undefined
};
2019-06-19 14:40:52 +00:00
export const PAGINATE_BY = 20;
2019-08-09 11:14:35 +00:00
export type ProductListColumns = "productType" | "isPublished" | "price";
export interface AppListViewSettings {
Apps (#599) * create Apps view * create more app components, generate types and messages * apps refactor, update snapshots * show error message in tooltip when app installation fail * update apps components and view, add apps list to storybook * update defaultMessages * create app details view * update AppListPage with Skeleton component * create app activate/deactivate dialogs, create app details stories * add AppHeader to AppDetailsPage * update defaultMessages * update AppDetails view and components after review * create custom app details view * refactor webhooks * update webhooks fixtures * update WebhookDetailsPage story * update strings * create CustomAppCreate view and components * update AppListPage story * create AppInstall view and page * handle errors in AppInstall view * update defaultMessages * add AppInstallPage to storybook * add status prop to MessageManager * update defaultMessages * remove service account section * remove service account routes * remove as operator from notify status * add notifications for app installations * update styles for deactivated app * update app installations with local storage * update defaultMessages * AppInstall update * dd delete button to ongoin installations table * fix active installations condition * fix error messages in AppsList * update defaultMessages * add iframe to AppDetailsPage * create AppDetailsSettingsPage * install macaw-ui * apps styles clean up * update schema, fixtures * few apps updates * WebhookCreate - fix onBack button name * WebhookCreatePage story update * rename apps table from external to thirdparty * update defaultMessages * fix test, update snapshots * AppDetailsSettings - add token to headers * fix first number in local apps query * app details settings - use shop domain host * add onSettingsRowClick to InstalledApps * resolve conflicts * update changelog and messages * add noopener noreferrer do app privacy link * update snapshots * update snapshots * updates after review * update defaultMessages * CustomAppDetails - add missing notify status
2020-07-22 10:54:15 +00:00
[ListViews.APPS_LIST]: ListSettings;
2019-08-09 11:14:35 +00:00
[ListViews.CATEGORY_LIST]: ListSettings;
[ListViews.COLLECTION_LIST]: ListSettings;
[ListViews.CUSTOMER_LIST]: ListSettings;
[ListViews.DRAFT_LIST]: ListSettings;
[ListViews.NAVIGATION_LIST]: ListSettings;
[ListViews.ORDER_LIST]: ListSettings;
[ListViews.PAGES_LIST]: ListSettings;
2019-08-27 12:36:19 +00:00
[ListViews.PLUGINS_LIST]: ListSettings;
2019-08-09 11:14:35 +00:00
[ListViews.PRODUCT_LIST]: ListSettings<ProductListColumns>;
[ListViews.SALES_LIST]: ListSettings;
[ListViews.SHIPPING_METHODS_LIST]: ListSettings;
[ListViews.STAFF_MEMBERS_LIST]: ListSettings;
[ListViews.PERMISSION_GROUP_LIST]: ListSettings;
2019-08-09 11:14:35 +00:00
[ListViews.VOUCHER_LIST]: ListSettings;
2020-01-30 11:46:35 +00:00
[ListViews.WAREHOUSE_LIST]: ListSettings;
[ListViews.WEBHOOK_LIST]: ListSettings;
2019-08-09 11:14:35 +00:00
}
export const defaultListSettings: AppListViewSettings = {
Apps (#599) * create Apps view * create more app components, generate types and messages * apps refactor, update snapshots * show error message in tooltip when app installation fail * update apps components and view, add apps list to storybook * update defaultMessages * create app details view * update AppListPage with Skeleton component * create app activate/deactivate dialogs, create app details stories * add AppHeader to AppDetailsPage * update defaultMessages * update AppDetails view and components after review * create custom app details view * refactor webhooks * update webhooks fixtures * update WebhookDetailsPage story * update strings * create CustomAppCreate view and components * update AppListPage story * create AppInstall view and page * handle errors in AppInstall view * update defaultMessages * add AppInstallPage to storybook * add status prop to MessageManager * update defaultMessages * remove service account section * remove service account routes * remove as operator from notify status * add notifications for app installations * update styles for deactivated app * update app installations with local storage * update defaultMessages * AppInstall update * dd delete button to ongoin installations table * fix active installations condition * fix error messages in AppsList * update defaultMessages * add iframe to AppDetailsPage * create AppDetailsSettingsPage * install macaw-ui * apps styles clean up * update schema, fixtures * few apps updates * WebhookCreate - fix onBack button name * WebhookCreatePage story update * rename apps table from external to thirdparty * update defaultMessages * fix test, update snapshots * AppDetailsSettings - add token to headers * fix first number in local apps query * app details settings - use shop domain host * add onSettingsRowClick to InstalledApps * resolve conflicts * update changelog and messages * add noopener noreferrer do app privacy link * update snapshots * update snapshots * updates after review * update defaultMessages * CustomAppDetails - add missing notify status
2020-07-22 10:54:15 +00:00
[ListViews.APPS_LIST]: {
rowNumber: 10
},
2019-08-09 11:14:35 +00:00
[ListViews.CATEGORY_LIST]: {
rowNumber: PAGINATE_BY
},
[ListViews.COLLECTION_LIST]: {
rowNumber: PAGINATE_BY
},
[ListViews.CUSTOMER_LIST]: {
rowNumber: PAGINATE_BY
},
[ListViews.DRAFT_LIST]: {
rowNumber: PAGINATE_BY
},
[ListViews.NAVIGATION_LIST]: {
rowNumber: PAGINATE_BY
},
[ListViews.ORDER_LIST]: {
rowNumber: PAGINATE_BY
},
[ListViews.PAGES_LIST]: {
rowNumber: PAGINATE_BY
},
2019-08-27 12:36:19 +00:00
[ListViews.PLUGINS_LIST]: {
rowNumber: PAGINATE_BY
},
2019-08-09 11:14:35 +00:00
[ListViews.PRODUCT_LIST]: {
columns: ["isPublished", "price", "productType"],
rowNumber: PAGINATE_BY
},
[ListViews.SALES_LIST]: {
rowNumber: PAGINATE_BY
},
[ListViews.SHIPPING_METHODS_LIST]: {
rowNumber: PAGINATE_BY
},
[ListViews.STAFF_MEMBERS_LIST]: {
rowNumber: PAGINATE_BY
},
[ListViews.PERMISSION_GROUP_LIST]: {
rowNumber: PAGINATE_BY
},
2019-08-09 11:14:35 +00:00
[ListViews.VOUCHER_LIST]: {
rowNumber: PAGINATE_BY
},
2020-01-30 11:46:35 +00:00
[ListViews.WAREHOUSE_LIST]: {
rowNumber: PAGINATE_BY
},
[ListViews.WEBHOOK_LIST]: {
rowNumber: PAGINATE_BY
2019-08-09 11:14:35 +00:00
}
};
2019-11-25 16:23:52 +00:00
export const APP_VERSION = packageInfo.version;
2020-05-25 23:38:52 +00:00
export const DEMO_MODE = process.env.DEMO_MODE === "true";
export const GTM_ID = process.env.GTM_ID;