Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: 404 route not working on root route '/' #256

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added webapp/openapi.json
Empty file.
20 changes: 10 additions & 10 deletions webapp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,57 +70,57 @@ export default class App extends React.Component<Props> {
<ErrorBoundary>
<Switch>
<Route exact path="/">
<Redirect to="/local?pipeline_index=0" />
<Redirect to="/app/local?pipeline_index=0" />
</Route>
<Route path="/:jobId">
<Route path="/app/:jobId">
<StatusCheck>
<PipelineCheck>
<Switch>
<Route path="/:jobId" exact>
<Route path="/app/:jobId" exact>
<BasicLayout maxWidth="md">
<Dashboard />
</BasicLayout>
</Route>
<Route path="/:jobId/settings" exact>
<Route path="/app/:jobId/settings" exact>
<BasicLayout>
<Settings />
</BasicLayout>
</Route>
<Route
path="/:jobId/dataset_splits/:datasetSplitName"
path="/app/:jobId/dataset_splits/:datasetSplitName"
exact
>
<DatasetSplitRedirect />
</Route>
<Route
path="/:jobId/dataset_splits/:datasetSplitName/:mainView"
path="/app/:jobId/dataset_splits/:datasetSplitName/:mainView"
exact
>
<Exploration />
</Route>
<Route
path="/:jobId/behavioral_testing_summary"
path="/app/:jobId/behavioral_testing_summary"
exact
>
<BasicLayout>
<PerturbationTestingSummary />
</BasicLayout>
</Route>
<Route path="/:jobId/thresholds" exact>
<Route path="/app/:jobId/thresholds" exact>
<BasicLayout>
<Threshold />
</BasicLayout>
</Route>
<Route
path="/:jobId/dataset_class_distribution_analysis"
path="/app/:jobId/dataset_class_distribution_analysis"
exact
>
<BasicLayout>
<WarningsOverview />
</BasicLayout>
</Route>
<Route
path="/:jobId/dataset_splits/:datasetSplitName/utterances/:utteranceId"
path="/app/:jobId/dataset_splits/:datasetSplitName/utterances/:utteranceId"
exact
>
<BasicLayout>
Expand Down
8 changes: 5 additions & 3 deletions webapp/src/components/Analysis/UtterancesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,17 @@ const UtterancesTable: React.FC<Props> = ({
...postprocessing,
page: page + 1,
});
history.push(`/${jobId}/dataset_splits/${datasetSplitName}/utterances${q}`);
history.push(
`/app/${jobId}/dataset_splits/${datasetSplitName}/utterances${q}`
);
};

const handleSortModelChange = ([model]:
| GridSortItem[]
| [GridSortItem]
| []) =>
history.push(
`/${jobId}/dataset_splits/${datasetSplitName}/utterances${constructSearchString(
`/app/${jobId}/dataset_splits/${datasetSplitName}/utterances${constructSearchString(
{
...confusionMatrix,
...filters,
Expand Down Expand Up @@ -366,7 +368,7 @@ const UtterancesTable: React.FC<Props> = ({
const RowLink = (props: RowProps<Row>) => (
<Link
style={{ color: "unset", textDecoration: "unset" }}
to={`/${jobId}/dataset_splits/${datasetSplitName}/utterances/${props.row.id}${searchString}`}
to={`/app/${jobId}/dataset_splits/${datasetSplitName}/utterances/${props.row.id}${searchString}`}
>
<GridRow {...props} />
</Link>
Expand Down
6 changes: 4 additions & 2 deletions webapp/src/components/Controls/Controls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const Controls: React.FC<Props> = ({
datasetSplitName: DatasetSplitName;
mainView?: string;
}>();
const baseUrl = `/${jobId}/dataset_splits/${datasetSplitName}/${mainView}`;
const baseUrl = `/app/${jobId}/dataset_splits/${datasetSplitName}/${mainView}`;

const {
data: countPerFilter,
Expand Down Expand Up @@ -156,7 +156,9 @@ const Controls: React.FC<Props> = ({
});

const handleDatasetSplitChange = (name: DatasetSplitName) =>
history.push(`/${jobId}/dataset_splits/${name}/${mainView}${searchString}`);
history.push(
`/app/${jobId}/dataset_splits/${name}/${mainView}${searchString}`
);

const handlePostprocessingChange = (checked: boolean) =>
history.push(
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/Metrics/PerformanceAnalysis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ const PerformanceAnalysis: React.FC<Props> = ({
const RowLink = (props: RowProps<Row>) => (
<Link
style={{ color: "unset", textDecoration: "unset" }}
to={`/${jobId}/dataset_splits/${selectedDatasetSplit}/performance_overview${constructSearchString(
to={`/app/${jobId}/dataset_splits/${selectedDatasetSplit}/performance_overview${constructSearchString(
{
...(props.row.id !== OVERALL_ROW_ID && {
[selectedMetricPerFilterOption]: [props.row.filterValue],
Expand Down
16 changes: 8 additions & 8 deletions webapp/src/components/PageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,31 +88,31 @@ const PageHeader = () => {
() =>
[
{
pathname: `/${jobId}`,
pathname: `/app/${jobId}`,
name: "Dashboard",
},
{
pathname: `/${jobId}/behavioral_testing_summary`,
pathname: `/app/${jobId}/behavioral_testing_summary`,
name: "Behavioral Testing Summary",
},
{
pathname: `/${jobId}/settings`,
pathname: `/app/${jobId}/settings`,
name: "Settings",
},
{
pathname: `/${jobId}/thresholds`,
pathname: `/app/${jobId}/thresholds`,
name: "Threshold Comparison",
},
{
pathname: `/${jobId}/dataset_class_distribution_analysis`,
pathname: `/app/${jobId}/dataset_class_distribution_analysis`,
name: "Dataset Class Distribution Analysis",
},
{
pathname: `/${jobId}/dataset_splits/${datasetSplitName}/${mainView}`,
pathname: `/app/${jobId}/dataset_splits/${datasetSplitName}/${mainView}`,
name: "Exploration",
},
{
pathname: `/${jobId}/dataset_splits/${datasetSplitName}/utterances/${utteranceId}`,
pathname: `/app/${jobId}/dataset_splits/${datasetSplitName}/utterances/${utteranceId}`,
name: "Utterance Details",
},
]
Expand Down Expand Up @@ -178,7 +178,7 @@ const PageHeader = () => {
component={RouterLink}
size="small"
color="primary"
to={`/${jobId}/settings${searchString}`}
to={`/app/${jobId}/settings${searchString}`}
sx={{
padding: 0,
"&:hover > svg": {
Expand Down
8 changes: 4 additions & 4 deletions webapp/src/pages/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const Dashboard = () => {
color="secondary"
variant="contained"
component={Link}
to={`/${jobId}/dataset_splits/eval/performance_overview${searchString}`}
to={`/app/${jobId}/dataset_splits/eval/performance_overview${searchString}`}
sx={{ gap: 1 }}
>
<Telescope fontSize="large" />
Expand All @@ -69,7 +69,7 @@ const Dashboard = () => {
{datasetInfo?.availableDatasetSplits.train && (
<PreviewCard
title="Dataset Class Distribution Analysis"
to={`/${jobId}/dataset_class_distribution_analysis${searchString}`}
to={`/app/${jobId}/dataset_class_distribution_analysis${searchString}`}
description={
<Description
text="Compare the class distribution of your training and evaluation sets."
Expand Down Expand Up @@ -103,7 +103,7 @@ const Dashboard = () => {
datasetInfo?.perturbationTestingAvailable && (
<PreviewCard
title="Behavioral Testing"
to={`/${jobId}/behavioral_testing_summary${searchString}`}
to={`/app/${jobId}/behavioral_testing_summary${searchString}`}
description={behavioralTestingDescription}
>
<Box height={DEFAULT_PREVIEW_CONTENT_HEIGHT}>
Expand All @@ -119,7 +119,7 @@ const Dashboard = () => {
datasetInfo?.postprocessingEditable?.[pipeline.pipelineIndex] && (
<PreviewCard
title="Post-processing Analysis"
to={`/${jobId}/thresholds${searchString}`}
to={`/app/${jobId}/thresholds${searchString}`}
description={postprocessingDescription}
>
<Box height={DEFAULT_PREVIEW_CONTENT_HEIGHT}>
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/pages/Exploration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const Exploration = () => {

const setMainView = (mainView: MainView) => {
history.push(
`/${jobId}/dataset_splits/${datasetSplitName}/${mainView}${searchString}`
`/app/${jobId}/dataset_splits/${datasetSplitName}/${mainView}${searchString}`
);
};

Expand Down