Commit decadfff authored by Marek Veselý's avatar Marek Veselý
Browse files

Merge branch '592-fix-channel-highlighting' into 'main'

Resolve "Fix channel/thread highlighting"

Closes #592

See merge request inject/frontend!507
parents bf66b2bc d2db9d01
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ const ThreadLogCard: FC<ThreadLogCardProps> = ({
    const needle = emailThread.readReceipt.find(
      readReceipt => readReceipt.teamId === teamId
    )
    return needle?.isUnread
    return !!needle?.isUnread
  }, [emailThread.readReceipt, teamId])

  return (
+16 −25
Original line number Diff line number Diff line
import { useNavigate } from '@/router'
import { Button } from '@blueprintjs/core'
import LinkButton from '@/components/LinkButton'
import type { FC } from 'react'
import { useMatch } from 'react-router-dom'

@@ -7,33 +6,25 @@ const OverviewButton: FC<{
  hideLabel?: boolean
  exerciseId?: string
}> = ({ hideLabel, exerciseId }) => {
  const nav = useNavigate()
  const active = useMatch(`/instructor/${exerciseId}`)

  /*
   * Button should work when team is enabled, or in exceptional cases when exerciseId is known
   *
   */

  return (
    <Button
      active={!!active}
      icon='feed'
      alignText='left'
      fill
      minimal
      title='Overview all teams'
      disabled={!exerciseId}
      onClick={() => {
        // eslint-disable-next-line @typescript-eslint/no-unused-expressions
        !!exerciseId &&
          nav('/instructor/:exerciseId', {
            params: {
              exerciseId,
            },
          })
    <LinkButton
      link={
        exerciseId
          ? ['/instructor/:exerciseId', { params: { exerciseId } }]
          : undefined
      }
      button={{
        active: !!active,
        icon: 'feed',
        alignText: 'left',
        fill: true,
        minimal: true,
        title: 'Overview all teams',
        disabled: !exerciseId,
        text: !hideLabel && 'Overview',
      }}
      text={!hideLabel && 'Overview'}
    />
  )
}
+1 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@ export type Confirmation = FragmentOf<typeof allFragments['Confirmation']>;
export type Config = FragmentOf<typeof allFragments['Config']>;
export type ExerciseDefinition = FragmentOf<typeof allFragments['ExerciseDefinition']>;
export type ActionLogSimple = FragmentOf<typeof allFragments['ActionLogSimple']>;
export type ActionLogLookup = FragmentOf<typeof allFragments['ActionLogLookup']>;
export type FileInfo = FragmentOf<typeof allFragments['FileInfo']>;
export type Milestone = FragmentOf<typeof allFragments['Milestone']>;
export type Overlay = FragmentOf<typeof allFragments['Overlay']>;
+48 −0
Original line number Diff line number Diff line
@@ -96,6 +96,54 @@ export const ActionLogSimple = graphql(
  []
)

export const ActionLogLookup = graphql(
  `
    fragment ActionLogLookup on ActionLogType @_unmask {
      id
      type
      team {
        id
      }
      channel {
        id
      }
      readReceipt
      details {
        __typename
        ... on ToolDetailsType {
          id
        }
        ... on InjectDetailsType {
          id
          overlay {
            id
          }
        }
        ... on CustomInjectDetailsType {
          id
          overlay {
            id
          }
        }
        ... on EmailType {
          id
          readReceipt
          overlay {
            id
          }
          thread {
            id
          }
        }
        ... on TeamQuestionnaireStateType {
          id
        }
      }
    }
  `,
  []
)

export const FileInfo = graphql(
  `
    fragment FileInfo on FileInfoType @_unmask {
+32 −32

File changed.

Preview size limit exceeded, changes collapsed.

Loading