Skip to content

Commit

Permalink
Merge pull request #2 from Waschbaerkebab/SurveyText
Browse files Browse the repository at this point in the history
Survey text
  • Loading branch information
Siluky authored Oct 25, 2023
2 parents 0a643b5 + 1bf94a0 commit 2cb1bd5
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions cvat-ui/src/components/annotation-page/top-bar/annotation-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ import { MenuInfo } from 'rc-menu/lib/interface';
import CVATTooltip from 'components/common/cvat-tooltip';
import LoadSubmenu from 'components/actions-menu/load-submenu';
import getCore from 'cvat-core-wrapper';
import { JobStage } from 'reducers/interfaces';
import { CombinedState, JobStage } from 'reducers/interfaces';
import Button from 'antd/lib/button';
import { useSelector } from 'react-redux';

const core = getCore();

Expand Down Expand Up @@ -46,6 +48,9 @@ export enum Actions {
}

function AnnotationMenuComponent(props: Props & RouteComponentProps): JSX.Element {
const udata = useSelector((state: CombinedState) => state.gamifuserdata);
const { userId } = udata;
const SURVEY_URL = `https://www.soscisurvey.de/cvat_eval/?act=SenrPcnqaSDDmONMFEefpjXN&r=${userId}-4`;
const {
loaders,
loadActivity,
Expand Down Expand Up @@ -161,7 +166,25 @@ function AnnotationMenuComponent(props: Props & RouteComponentProps): JSX.Elemen
} else if (params.key === Actions.FINISH_JOB) {
Modal.confirm({
title: 'The job stage is going to be switched',
content: 'Stage will be changed to "acceptance". Would you like to continue?',
content: (
<div>
<p>Stage will be changed to &quot;acceptance&quot;. Would you like to continue?</p>
<p><b>Please remember to fill out the survey if this is your last job for this day.</b></p>
<Button
className='gamif-energizer-popup-start-energizer-button'
type='link'
href={SURVEY_URL}
onClick={(event: React.MouseEvent): void => {
event.preventDefault();
// false alarm
// eslint-disable-next-line security/detect-non-literal-fs-filename
window.open(SURVEY_URL, '_blank');
}}
>
Go to Survey
</Button>
</div>
),
okText: 'Continue',
cancelText: 'Cancel',
className: 'cvat-modal-content-finish-job',
Expand Down

0 comments on commit 2cb1bd5

Please sign in to comment.