Skip to content

Commit

Permalink
Fixed blinking notification (#2200)
Browse files Browse the repository at this point in the history
* Fixed blinking notification

* Updated CHANGELOG
  • Loading branch information
bsekachev authored Sep 21, 2020
1 parent 4d869c3 commit 8330015
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 26 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed CVAT format import for frame stepped tasks (<https://github.com/openvinotoolkit/cvat/pull/2151>)
- Fixed unnecessary pyhash dependency (<https://github.com/openvinotoolkit/cvat/pull/2170>)
- Fixed Data is not getting cleared, even after deleting the Task from Django Admin App(<https://github.com/openvinotoolkit/cvat/issues/1925>)
- Fixed blinking message: "Some tasks have not been showed because they do not have any data" (<https://github.com/openvinotoolkit/cvat/pull/2200>)
- Fixed case when a task with 0 jobs is shown as "Completed" in UI (<https://github.com/openvinotoolkit/cvat/pull/2200>)

### Security
-

Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/src/components/tasks-page/task-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class TaskItemComponent extends React.PureComponent<TaskItemProps & RouteCompone
// Progress appearence depends on number of jobs
let progressColor = null;
let progressText = null;
if (numOfCompleted === numOfJobs) {
if (numOfCompleted && numOfCompleted === numOfJobs) {
progressColor = 'cvat-task-completed-progress';
progressText = <Text strong className={progressColor}>Completed</Text>;
} else if (numOfCompleted) {
Expand Down
48 changes: 23 additions & 25 deletions cvat-ui/src/components/tasks-page/tasks-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,7 @@ function updateQuery(previousQuery: TasksQuery, searchString: string): TasksQuer

class TasksPageComponent extends React.PureComponent<TasksPageProps & RouteComponentProps> {
public componentDidMount(): void {
const {
gettingQuery,
location,
onGetTasks,
} = this.props;

const { gettingQuery, location, onGetTasks } = this.props;
const query = updateQuery(gettingQuery, location.search);
onGetTasks(query);
}
Expand All @@ -90,8 +85,9 @@ class TasksPageComponent extends React.PureComponent<TasksPageProps & RouteCompo
const {
location,
gettingQuery,
onGetTasks,
tasksFetching,
numberOfHiddenTasks,
onGetTasks,
hideEmptyTasks,
} = this.props;

Expand All @@ -103,24 +99,26 @@ class TasksPageComponent extends React.PureComponent<TasksPageProps & RouteCompo
return;
}

if (numberOfHiddenTasks) {
message.destroy();
message.info(
<>
<Text>
Some tasks have not been showed because they do not have any data.
</Text>
<Button
type='link'
onClick={(): void => {
hideEmptyTasks(false);
message.destroy();
}}
>
Show all
</Button>
</>, 7,
);
if (prevProps.tasksFetching && !tasksFetching) {
if (numberOfHiddenTasks) {
message.destroy();
message.info(
<>
<Text>
Some tasks are temporary hidden since they are without any data
</Text>
<Button
type='link'
onClick={(): void => {
hideEmptyTasks(false);
message.destroy();
}}
>
Show all
</Button>
</>, 5,
);
}
}
}

Expand Down

0 comments on commit 8330015

Please sign in to comment.