Skip to content

Commit

Permalink
Show sticky toast if progress report request fails (#2955)
Browse files Browse the repository at this point in the history
* show sticky toast if progress report request fails

* fix linting

* update changelog
  • Loading branch information
philippotto authored Jul 24, 2018
1 parent 327fbff commit 207a2fb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
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.",
};

0 comments on commit 207a2fb

Please sign in to comment.