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

Show sticky toast if progress report request fails #2955

Merged
merged 4 commits into from
Jul 24, 2018
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.md).
- Reduced the number of scenarios in which segmentation-related warnings are shown (e.g, not for skeleton tracings when there are multiple resolutions for segmentations anyway). [#2715](https://github.com/scalableminds/webknossos/pull/2715)
- Email addresses for notifications about new users and about task overtime are no longer specified instance-wide but once per organization. [#2939](https://github.com/scalableminds/webknossos/pull/2939)
- Improved tracing view page load performance by decreasing WebGL shader compilation time. [#2709](https://github.com/scalableminds/webknossos/pull/2709)
- Improved error reporting for project progress page. [#2955](https://github.com/scalableminds/webknossos/pull/2955)
- Redesigned the user task list to make it easier to read the whole task description. [#2861](https://github.com/scalableminds/webknossos/pull/2861)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import Loop from "components/loop";
import { getProjectProgressReport } from "admin/admin_rest_api";
import type { APIProjectProgressReportType, APITeamType } from "admin/api_flow_types";
import FormattedDate from "components/formatted_date";
import Toast from "libs/toast";
import messages from "messages";
import TeamSelectionForm from "./team_selection_form";

const { Column, ColumnGroup } = Table;
Expand Down Expand Up @@ -36,11 +38,16 @@ class ProjectProgressReportView extends React.PureComponent<{}, State> {
if (team == null) {
this.setState({ data: [] });
} else if (suppressLoadingState) {
const errorToastKey = "progress-report-failed-to-refresh";
try {
const progessData = await getProjectProgressReport(team.id);
this.setState({ data: progessData, updatedAt: Date.now() });
Toast.close(errorToastKey);
} catch (err) {
// Fail silently
Toast.error(messages["project.report.failed_to_refresh"], {
sticky: true,
key: errorToastKey,
});
}
} else {
this.setState({ isLoading: true });
Expand Down
2 changes: 2 additions & 0 deletions app/assets/javascripts/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,6 @@ In order to restore the current window, a reload is necessary.`,
"mapping.too_few_textures":
"Not enough textures available to support mappings. Mappings are disabled.",
"mapping.unsupported_layer": "Mappings can only be enabled for segmentation layers.",
"project.report.failed_to_refresh":
"The project report page could not be refreshed. Please try to reload the page.",
};