Skip to content

Commit

Permalink
Merge pull request #129 from open-schools/feature/SCHOOL-828/current-…
Browse files Browse the repository at this point in the history
…ticket-page

Edits for the ticket page
  • Loading branch information
levil664 authored May 7, 2024
2 parents 451d3ac + 9832e24 commit 5cf8374
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions apps/schools/domains/common/constants/Enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ export enum StatusesEnum {
IN_PROGRESS = 'IN_PROGRESS',
DECLINED = 'DECLINED',
CANCELED = 'CANCELED',
CLOSED = 'CLOSED',
}
16 changes: 9 additions & 7 deletions apps/schools/domains/ticket/components/currentTicket/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import router from 'next/router'
import { AppRoutes, RoutePath } from '@domains/common/constants/routerEnums'
import { useOrganization } from '@domains/organization/providers/organizationProvider'
import {
ACCEPTED_FILTER_COLOR,
CLOSED_FILTER_COLOR,
IN_PROGRESS_FILTER_COLOR,
SENT_FILTER_COLOR,
} from '@domains/ticket/components/ticketList/styles/styles'
Expand Down Expand Up @@ -98,11 +98,13 @@ const CurrentTicket = () => {

const SendComment = () => {
setIsButtonDisabled(true)
handleCreateComment(uuid[0], mutationCreateComment, text, data?.results[0].id, isInternal).then(() => {
handleCreateComment(uuid[0], mutationCreateComment, text, data?.results[0].id, isInternal).then((success) => {
if (success) {
setIsInternal(false)
setText('')
handleChange
}
setIsButtonDisabled(false)
setIsInternal(false)
setText('')
handleChange
})
}

Expand All @@ -128,9 +130,9 @@ const CurrentTicket = () => {
translate: 'Открыто',
color: IN_PROGRESS_FILTER_COLOR,
},
ACCEPTED: {
CLOSED: {
translate: 'Закрыто',
color: ACCEPTED_FILTER_COLOR,
color: CLOSED_FILTER_COLOR,
},
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { StatusesEnum } from '@domains/common/constants/Enums'
import type { LiteralUnion } from 'antd/lib/_util/type'
import type { PresetColorType, PresetStatusColorType } from 'antd/lib/_util/colors'
import { ACCEPTED_FILTER_COLOR, IN_PROGRESS_FILTER_COLOR, SENT_FILTER_COLOR } from './styles/styles'
import { CLOSED_FILTER_COLOR, IN_PROGRESS_FILTER_COLOR, SENT_FILTER_COLOR } from './styles/styles'

export const searchTicketsColumns = ['family__name', 'ticket_comment__value']

Expand All @@ -14,5 +14,5 @@ interface TagType {
export const StatusDictionary: { [key: string]: TagType } = {
[StatusesEnum.SENT]: { text: 'Новое', color: SENT_FILTER_COLOR, antdColor: 'red' },
[StatusesEnum.IN_PROGRESS]: { text: 'Открыто', color: IN_PROGRESS_FILTER_COLOR, antdColor: 'blue' },
[StatusesEnum.ACCEPTED]: { text: 'Закрыто', color: ACCEPTED_FILTER_COLOR, antdColor: 'green' },
[StatusesEnum.CLOSED]: { text: 'Закрыто', color: CLOSED_FILTER_COLOR, antdColor: 'green' },
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const IN_PROGRESS_FILTER_COLOR = '#2F54EB'
export const SENT_FILTER_COLOR = '#EB3468'
export const ACCEPTED_FILTER_COLOR = '#52C41A'
export const CLOSED_FILTER_COLOR = '#52C41A'
4 changes: 3 additions & 1 deletion apps/schools/domains/ticket/handlers/createComment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export async function handleCreateComment(
) {
if (value.length === 0) {
message.error(NeedConfirmComment)
return
return false
}

let response = await withLoadingMessage(LoadingMsg, mutation, {
Expand All @@ -29,5 +29,7 @@ export async function handleCreateComment(

if ('data' in response) {
message.success(SuccessCreateCommentMsg)
return true
}
return false
}
1 change: 1 addition & 0 deletions apps/schools/store/middlewares.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const errorCodes: ErrorCodes = {
EmailServiceUnavailable: 'Сервис отправки электронной почты недоступен',
AlreadyExists: 'Объект с такими параметрами уже существует',
MapServiceUnavailable: 'Сервис карт недоступен',
TicketIsClosed: 'Не удалось выполнить действие, так как тикет закрыт',
},
401: 'Вы не аутентифицированы. Пожалуйста, выполните вход для доступа к запрашиваемому ресурсу',
403: 'Недостаточно прав для выполнения операции. Обратитесь к администратору для получения необходимых разрешений',
Expand Down

0 comments on commit 5cf8374

Please sign in to comment.