2023-01-16 09:45:12 +00:00
|
|
|
import WebhooksRoutes from "@dashboard/custom-apps";
|
|
|
|
import { sectionNames } from "@dashboard/intl";
|
2020-07-22 10:54:15 +00:00
|
|
|
import { parse as parseQs } from "qs";
|
|
|
|
import React from "react";
|
|
|
|
import { useIntl } from "react-intl";
|
|
|
|
import { Route, RouteComponentProps, Switch } from "react-router-dom";
|
|
|
|
|
|
|
|
import { WindowTitle } from "../components/WindowTitle";
|
|
|
|
import {
|
|
|
|
appInstallPath,
|
|
|
|
AppInstallUrlQueryParams,
|
|
|
|
AppListUrlQueryParams,
|
|
|
|
appsListPath,
|
|
|
|
} from "./urls";
|
|
|
|
import AppInstallView from "./views/AppInstall";
|
|
|
|
import AppsListView from "./views/AppsList";
|
|
|
|
|
|
|
|
const AppInstall: React.FC<RouteComponentProps> = props => {
|
|
|
|
const qs = parseQs(location.search.substr(1));
|
|
|
|
const params: AppInstallUrlQueryParams = qs;
|
|
|
|
|
|
|
|
return <AppInstallView params={params} {...props} />;
|
|
|
|
};
|
|
|
|
|
|
|
|
const AppsList: React.FC<RouteComponentProps> = () => {
|
|
|
|
const qs = parseQs(location.search.substr(1));
|
|
|
|
const params: AppListUrlQueryParams = qs;
|
|
|
|
|
|
|
|
return <AppsListView params={params} />;
|
|
|
|
};
|
|
|
|
const Component = () => {
|
|
|
|
const intl = useIntl();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<WindowTitle title={intl.formatMessage(sectionNames.apps)} />
|
|
|
|
<Switch>
|
|
|
|
<Route exact path={appsListPath} component={AppsList} />
|
|
|
|
<Route exact path={appInstallPath} component={AppInstall} />
|
|
|
|
<WebhooksRoutes />
|
|
|
|
</Switch>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Component;
|