saleor-dashboard/src/apps/components/AppsListPage/AppsListPage.tsx

77 lines
2.4 KiB
TypeScript
Raw Normal View History

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
import Container from "@saleor/components/Container";
import PageHeader from "@saleor/components/PageHeader";
import { sectionNames } from "@saleor/intl";
import { ListProps } from "@saleor/types";
import React from "react";
import { useIntl } from "react-intl";
import { AppsInstallations } from "../../types/AppsInstallations";
import { AppsList_apps_edges } from "../../types/AppsList";
import AppsInProgress from "../AppsInProgress/AppsInProgress";
import CustomApps from "../CustomApps/CustomApps";
import InstalledApps from "../InstalledApps/InstalledApps";
import Marketplace from "../Marketplace";
export interface AppsListPageProps extends ListProps {
installedAppsList: AppsList_apps_edges[];
customAppsList: AppsList_apps_edges[];
appsInProgressList?: AppsInstallations;
loadingAppsInProgress: boolean;
navigateToCustomApp: (id: string) => () => void;
navigateToCustomAppCreate: () => void;
onInstalledAppRemove: (id: string) => void;
onCustomAppRemove: (id: string) => void;
onAppInProgressRemove: (id: string) => void;
onAppInstallRetry: (id: string) => void;
onSettingsRowClick: (id: string) => () => void;
}
const AppsListPage: React.FC<AppsListPageProps> = ({
appsInProgressList,
customAppsList,
installedAppsList,
loadingAppsInProgress,
navigateToCustomApp,
navigateToCustomAppCreate,
onInstalledAppRemove,
onCustomAppRemove,
onAppInProgressRemove,
onAppInstallRetry,
onSettingsRowClick,
...listProps
}) => {
const intl = useIntl();
const appsInProgress = appsInProgressList?.appsInstallations;
return (
<Container>
<PageHeader title={intl.formatMessage(sectionNames.apps)} />
{!!appsInProgress?.length && (
<AppsInProgress
appsList={appsInProgress}
disabled={loadingAppsInProgress}
onAppInstallRetry={onAppInstallRetry}
onRemove={onAppInProgressRemove}
/>
)}
<InstalledApps
appsList={installedAppsList}
onRemove={onInstalledAppRemove}
onSettingsRowClick={onSettingsRowClick}
{...listProps}
/>
<CustomApps
appsList={customAppsList}
navigateToCustomApp={navigateToCustomApp}
navigateToCustomAppCreate={navigateToCustomAppCreate}
onRemove={onCustomAppRemove}
/>
<Marketplace />
</Container>
);
};
AppsListPage.displayName = "AppsListPage";
export default AppsListPage;