forked from cvat-ai/cvat
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
53 changed files
with
569 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion
2
...ribute-annotation-workspace/attribute-annotation-sidebar/attribute-annotation-sidebar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/issues-list.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
cvat-ui/src/components/annotation-page/standard-workspace/objects-side-bar/labels-list.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
cvat-ui/src/components/annotation-page/top-bar/player-buttons.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
cvat-ui/src/components/annotation-page/top-bar/quick-statistics.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (C) 2022 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
import React from 'react'; | ||
import { Row, Col } from 'antd/lib/grid'; | ||
import QuickStatistic from 'components/gamification/statistics/quick-statistics-component'; | ||
import ProgressBar from 'components/gamification/progressbar-component'; | ||
|
||
function QuickStatisticsPanel(): JSX.Element { | ||
return ( | ||
<div className='cvat-annotation-header-quick-statistics'> | ||
<Row> | ||
<Col span={8}> | ||
<QuickStatistic id={1} /> | ||
</Col> | ||
<Col span={8}> | ||
<QuickStatistic id={2} /> | ||
</Col> | ||
<Col span={8}> | ||
<QuickStatistic id={3} /> | ||
</Col> | ||
</Row> | ||
<Row> | ||
<Col span={24}> | ||
<ProgressBar /> | ||
</Col> | ||
</Row> | ||
</div> | ||
); | ||
} | ||
// TODO: include React.memo where appropriate | ||
export default React.memo(QuickStatisticsPanel); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
cvat-ui/src/components/create-task-page/advanced-configuration-form.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
cvat-ui/src/components/create-task-page/basic-configuration-form.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
cvat-ui/src/components/create-task-page/create-task-content.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
cvat-ui/src/components/create-task-page/project-search-field.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
cvat-ui/src/components/create-task-page/project-subset-field.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
cvat-ui/src/components/gamification/badges/badge-details.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Copyright (C) 2022 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
import '../gamif-styles.scss'; | ||
import React from 'react'; | ||
|
||
export default function BadgeDetails(): JSX.Element { | ||
return ( | ||
<>Badge Details</> | ||
); | ||
} |
108 changes: 108 additions & 0 deletions
108
cvat-ui/src/components/gamification/badges/badge-overview.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
// Copyright (C) 2022 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
import '../gamif-styles.scss'; | ||
import React from 'react'; | ||
import { BadgeIcon, BadgeGreyIcon } from 'icons'; | ||
import { | ||
Row, | ||
Col, | ||
Progress, | ||
Button, | ||
Tabs, | ||
} from 'antd'; | ||
|
||
type Badge = { | ||
title: string; | ||
instruction: string; | ||
progress: number; | ||
goal: number; | ||
goalunit: string; | ||
got: boolean; | ||
}; | ||
|
||
interface Props { | ||
// visible: boolean; | ||
allBadges: Badge[]; | ||
currentBadge?: Badge; | ||
} | ||
|
||
const showBadges = (badges: Badge[]): JSX.Element => ( | ||
<Row> | ||
{badges.map((badge: Badge) => ( | ||
<Col span={4}> | ||
<Button | ||
icon={badge.got ? <BadgeIcon /> : <BadgeGreyIcon />} | ||
onClick={(): void => { | ||
// TODO: Change selectedBadge through reducer | ||
}} | ||
/> | ||
</Col> | ||
))} | ||
</Row> | ||
); | ||
|
||
const showSelectedBadge = (badge: Badge): JSX.Element => ( | ||
<> | ||
<div className='gamif-badge-icon'> | ||
{badge.got ? <BadgeIcon /> : <BadgeGreyIcon />} | ||
</div> | ||
<div className='gamif-badge-details'> | ||
<strong>{badge.title}</strong> | ||
{badge.instruction} | ||
<Progress percent={badge.progress / badge.goal} /> | ||
{`Current Progress: ${badge.progress} / ${badge.goal} ${badge.goalunit}`} | ||
</div> | ||
</> | ||
); | ||
|
||
export default function BadgeOverview(props: Props): JSX.Element { | ||
let { allBadges, currentBadge } = props; | ||
const badge1: Badge = { | ||
title: 'Badge 1', | ||
instruction: 'Annotate 5 livers', | ||
progress: 5, | ||
goal: 5, | ||
goalunit: 'Livers', | ||
got: true, | ||
}; | ||
const badge2: Badge = { | ||
title: 'Badge 2', | ||
instruction: 'Annotate ten images', | ||
progress: 1, | ||
goal: 10, | ||
goalunit: 'Images', | ||
got: false, | ||
}; | ||
|
||
allBadges = [badge1, badge2]; | ||
currentBadge = badge1; | ||
|
||
return ( | ||
<Tabs type='card' defaultActiveKey='1' className='badge-overview-tabs'> | ||
<Tabs.TabPane tab='Permanent Badges' key='1'> | ||
<div className='gamif-badge-overview-container'> | ||
<div className='gamif-badge-overview-header' /> | ||
<div className='gamif-badge-overview-content'> | ||
{showBadges(allBadges)} | ||
</div> | ||
<div className='gamif-badge-detail-view'> | ||
{showSelectedBadge(currentBadge)} | ||
</div> | ||
</div> | ||
</Tabs.TabPane> | ||
{ /* TODO: Refactor */} | ||
<Tabs.TabPane tab='Seasonal Badges' key='2'> | ||
<div className='gamif-badge-overview-container'> | ||
<div className='gamif-badge-overview-header' /> | ||
<div className='gamif-badge-overview-content'> | ||
{showBadges(allBadges)} | ||
</div> | ||
<div className='gamif-badge-detail-view'> | ||
{showSelectedBadge(currentBadge)} | ||
</div> | ||
</div> | ||
</Tabs.TabPane> | ||
</Tabs> | ||
); | ||
} |
16 changes: 16 additions & 0 deletions
16
cvat-ui/src/components/gamification/badges/badgeprofile.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (C) 2022 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
import React from 'react'; | ||
import BadgeOverview from './badge-overview'; | ||
import BadgeDetails from './badge-details'; | ||
|
||
export default function BadgeProfile(): JSX.Element { | ||
return ( | ||
<div style={{ width: 300, height: 300 }}> | ||
{/* TODO: Seasonal/Permanent Badge Tabs */} | ||
<BadgeOverview /> | ||
<BadgeDetails /> | ||
</div> | ||
); | ||
} |
18 changes: 18 additions & 0 deletions
18
cvat-ui/src/components/gamification/challenges/challenge-component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright (C) 2022 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
import React from 'react'; | ||
|
||
interface Props { | ||
id: number; | ||
} | ||
|
||
export default function Challenge(props: Props): JSX.Element { | ||
const x = props; | ||
return ( | ||
<div> | ||
{`Cool Challenge ${x.id}`} | ||
</div> | ||
); | ||
} |
23 changes: 23 additions & 0 deletions
23
cvat-ui/src/components/gamification/challenges/challengelist-component.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (C) 2022 Intel Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
import React from 'react'; | ||
import { Row } from 'antd'; | ||
import Challenge from './challenge-component'; | ||
|
||
export default function ChallengeList(): JSX.Element { | ||
return ( | ||
<> | ||
<Row> | ||
<Challenge id={1} /> | ||
</Row> | ||
<Row> | ||
<Challenge id={2} /> | ||
</Row> | ||
<Row> | ||
<Challenge id={3} /> | ||
</Row> | ||
</> | ||
); | ||
} |
Oops, something went wrong.