Commit 16948441 authored by Filip Šenk's avatar Filip Šenk Committed by Marek Veselý
Browse files

Resolve "Chore: New version of Backend - v3.9.0"

parent 11baaa59
Loading
Loading
Loading
Loading
Compare 6865e97e to eea95582
Original line number Diff line number Diff line
Subproject commit 6865e97e38bccc1e6216825c473bcfdb8a8b03dc
Subproject commit eea9558227041bb9b0fd1b46b9b9253ba14cc4dd
+1 −1
Original line number Diff line number Diff line
{
  "name": "@inject/codegen",
  "version": "3.8.0",
  "version": "3.9.0",
  "description": "GraphQL API Codegen Setup for the Inject Backend",
  "main": "index.js",
  "license": "MIT",
+1 −1
Original line number Diff line number Diff line
{
  "name": "@inject/frontend",
  "version": "3.8.0",
  "version": "3.9.0",
  "description": "Main wrapper for rendering INJECT Frontend",
  "main": "index.js",
  "license": "MIT",
+29 −45
Original line number Diff line number Diff line
import FileViewRedirectButton from '@/components/FileViewRedirectButton'
import RenderedContent from '@/components/RenderedContent'
import type { ActionLog } from '@inject/graphql'
import type { FC } from 'react'
import { useContext } from 'react'
import ExerciseContext from '../ExerciseContext'
import useFormatTimestamp from '../useFormatTimestamp'
import { AttachmentsRow } from './AttachmentsRow'
import { td, th } from './detailStyles'

const getContent = (actionLog: ActionLog, exerciseId: string) => {
@@ -28,23 +28,19 @@ const getContent = (actionLog: ActionLog, exerciseId: string) => {
            <th className={th}>Content</th>
            <td className={td}>
              <RenderedContent
                exerciseId={exerciseId}
                renderedContent={details.content.rendered}
                teamId={actionLog.team.id}
                inInstructor
              />
            </td>
          </tr>
          {details.content.fileInfo && (
            <tr>
              <th className={th}>Attached file</th>
              <td className={td}>
                <FileViewRedirectButton
                  fileInfo={details.content.fileInfo}
                  teamId={actionLog.team.id}
          {details.content.attachments && (
            <AttachmentsRow
              attachments={details.content.attachments}
              exerciseId={exerciseId}
              teamId={actionLog.team.id}
            />
              </td>
            </tr>
          )}
        </>
      )
@@ -56,23 +52,19 @@ const getContent = (actionLog: ActionLog, exerciseId: string) => {
            <th className={th}>Content</th>
            <td className={td}>
              <RenderedContent
                exerciseId={exerciseId}
                renderedContent={details.content.rendered}
                teamId={actionLog.team.id}
                inInstructor
              />
            </td>
          </tr>
          {details.content.fileInfo && (
            <tr>
              <th className={th}>Attached file</th>
              <td className={td}>
                <FileViewRedirectButton
                  fileInfo={details.content.fileInfo}
                  teamId={actionLog.team.id}
          {details.content.attachments && (
            <AttachmentsRow
              attachments={details.content.attachments}
              exerciseId={exerciseId}
              teamId={actionLog.team.id}
            />
              </td>
            </tr>
          )}
        </>
      )
@@ -94,23 +86,19 @@ const getContent = (actionLog: ActionLog, exerciseId: string) => {
            <th className={th}>Response</th>
            <td className={td}>
              <RenderedContent
                exerciseId={exerciseId}
                renderedContent={details.content.rendered}
                teamId={actionLog.team.id}
                inInstructor
              />
            </td>
          </tr>
          {details.content.fileInfo && (
            <tr>
              <th className={th}>Attached file</th>
              <td className={td}>
                <FileViewRedirectButton
                  fileInfo={details.content.fileInfo}
                  teamId={actionLog.team.id}
          {details.content.attachments && (
            <AttachmentsRow
              attachments={details.content.attachments}
              exerciseId={exerciseId}
              teamId={actionLog.team.id}
            />
              </td>
            </tr>
          )}
        </>
      )
@@ -135,23 +123,19 @@ const getContent = (actionLog: ActionLog, exerciseId: string) => {
              <th className={th}>Content</th>
              <td className={td}>
                <RenderedContent
                  exerciseId={exerciseId}
                  renderedContent={details.content.rendered}
                  teamId={actionLog.team.id}
                  inInstructor
                />
              </td>
            </tr>
            {details.content.fileInfo && (
              <tr>
                <th className={th}>Attached file</th>
                <td className={td}>
                  <FileViewRedirectButton
                    fileInfo={details.content.fileInfo}
                    teamId={actionLog.team.id}
            {details.content.attachments && (
              <AttachmentsRow
                attachments={details.content.attachments}
                exerciseId={exerciseId}
                teamId={actionLog.team.id}
              />
                </td>
              </tr>
            )}
          </tr>
        </>
+24 −0
Original line number Diff line number Diff line
import FileViewRedirectButton from '@/components/FileViewRedirectButton'
import type { FileInfo } from '@inject/graphql'
import { td, th } from './detailStyles'

type Props = {
  attachments: FileInfo[]
  teamId: string
  exerciseId: string
}
export const AttachmentsRow = ({ attachments, exerciseId, teamId }: Props) => (
  <tr>
    <th className={th}>Attached files</th>
    <td className={td}>
      {attachments.map(oneAttachment => (
        <FileViewRedirectButton
          key={oneAttachment.id}
          fileId={oneAttachment.id}
          teamId={teamId}
          exerciseId={exerciseId}
        />
      ))}
    </td>
  </tr>
)
Loading