Commit 14b55ce4 authored by Patrik Kotucek's avatar Patrik Kotucek
Browse files

fix: moving button and translation

parent 5d98ea86
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@ import { DownloadLogsButton } from './DownloadLogsButton'
import { start, useLoadingState } from './mutations'
import { OnDemandExerciseButtons } from './OnDemandExerciseButtons'
import { SynchronousExerciseButtons } from './SynchronousExerciseButtons'
import { DownloadTraineesButton } from './TraineesButton/DownloadTraineesButton'

interface ManagingExerciseButtonsProps {
  exercise: ExerciseSimple
@@ -104,15 +103,6 @@ export const ManagingExerciseButtons: FC<ManagingExerciseButtonsProps> = ({
          rightIcon: undefined,
        }}
      />
      <DownloadTraineesButton
        exerciseId={exercise.id}
        buttonProps={{
          intent,
          title: t('exerciseList.downloadAssignees'),
          text: undefined,
          rightIcon: undefined,
        }}
      />
    </>
  )
}
+8 −3
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ import type { ButtonProps } from '@blueprintjs/core'
import { Button } from '@blueprintjs/core'
import type { Team } from '@inject/graphql'
import { GetExercise, useClient } from '@inject/graphql'
import { useTranslationFrontend } from '@inject/locale'
import { pdf } from '@react-pdf/renderer'
import { useState, type FC } from 'react'
import { AssigneesPDF } from './TraineesPDF'
@@ -13,9 +14,10 @@ interface DownloadTraineesButtonProps {

export const DownloadTraineesButton: FC<DownloadTraineesButtonProps> = ({
  exerciseId,
  buttonProps,
}) => {
  const [isLoading, setIsLoading] = useState(false)
  const { t } = useTranslationFrontend()

  const client = useClient()

  const handleExportPDF = async () => {
@@ -61,10 +63,13 @@ export const DownloadTraineesButton: FC<DownloadTraineesButtonProps> = ({

  return (
    <Button
      icon='archive'
      icon='download'
      loading={isLoading}
      onClick={handleExportPDF}
      {...buttonProps}
      alignText='left'
      fill
      minimal
      text={t('sidebar.downloadAssignees')}
    />
  )
}
+2 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import type { FC } from 'react'
import { Suspense, useMemo } from 'react'
import { ExerciseStatus, ExitButton, MoveTimeButton } from '../../components'
import { AssessmentOverlay } from '../../components/Assessment/AssessmentOverlay'
import { DownloadTraineesButton } from '../../components/ExerciseList/ExerciseButtons/TraineesButton/DownloadTraineesButton'
import InstructorEmailFormOverlay from '../../email/EmailFormOverlay/InstructorEmailFormOverlay'
import useMailToRef from '../../hooks/useMailToRef'
import { EnableTraineeOverview } from '../../instructor/EnableTraineeOverview'
@@ -155,6 +156,7 @@ export const InstructorView: FC<InstructorViewProps> = ({
              params: { exerciseId },
            }}
          />
          <DownloadTraineesButton exerciseId={exerciseId} />
          <ExitButton
            exitRoute={{ to: RootRoute.to }}
            hideLabel={hideLeftBar}
+1 −1
Original line number Diff line number Diff line
@@ -233,6 +233,7 @@
    "traineeOverview": "Povolit trainee přehled",
    "selectTeams": "Vybrat týmy",
    "instructorNotes": "Poznámky pro instruktory",
    "downloadAssignees": "Stáhnout zoznam cvičícich (PDF)",
    "teamOverview": {
      "label": "Týmový přehled",
      "title": "Přehled vybraného týmu"
@@ -877,7 +878,6 @@
    "deleteConfirmation": "Opravdu chcete smazat vybrané cvičení?",
    "deleteConfirmationBold": "Tato akce je nevratná.",
    "downloadLogs": "Stáhnout logy",
    "downloadAssignees": "Stáhnout zoznam cvičícich",
    "standard": "Standardní",
    "anonymized": "Anonymizované",
    "start": "Spustit",
+1 −1
Original line number Diff line number Diff line
@@ -233,6 +233,7 @@
    "traineeOverview": "Enable trainee overview",
    "selectTeams": "Select teams",
    "instructorNotes": "Instructor notes",
    "downloadAssignees": "Download trainees list (PDF)",
    "teamOverview": {
      "label": "Team Overview",
      "title": "Selected team overview"
@@ -877,7 +878,6 @@
    "deleteConfirmation": "Are you sure you want to delete the selected exercise?",
    "deleteConfirmationBold": "This action is irreversible.",
    "downloadLogs": "Download logs",
    "downloadAssignees": "Download list of trainees",
    "standard": "Standard",
    "anonymized": "Anonymized",
    "start": "Start",