Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edits for the ticket page #129

Merged
merged 1 commit into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading