File tree Expand file tree Collapse file tree
hwproj.front/src/components/Tasks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ const CourseTaskEditor: FC<{
135135 }
136136
137137 const isDisabled = hasErrors || ! isLoaded
138+ const isNewHomework = taskData . task . homeworkId ! < 0
138139
139140 const homeworkPublicationDateIsSet = ! homework . publicationDateNotSet
140141
@@ -229,11 +230,11 @@ const CourseTaskEditor: FC<{
229230 </ Grid >
230231 }
231232 </ Grid >
232- { taskData . task . homeworkId ! > 0 && < CardActions >
233- { publicationDate && new Date ( ) >= new Date ( publicationDate ) && < ActionOptionsUI
233+ < CardActions >
234+ { ! isNewHomework && publicationDate && new Date ( ) >= new Date ( publicationDate ) && < ActionOptionsUI
234235 disabled = { isDisabled || handleSubmitLoading }
235236 onChange = { value => setEditOptions ( value ) } /> }
236- < LoadingButton
237+ { ! isNewHomework && < LoadingButton
237238 fullWidth
238239 onClick = { handleSubmit }
239240 color = "primary"
@@ -247,17 +248,17 @@ const CourseTaskEditor: FC<{
247248 >
248249 { isNewTask && "Добавить задачу" }
249250 { ! isNewTask && "Редактировать задачу " + ( editOptions . sendNotification ? "с уведомлением" : "без уведомления" ) }
250- </ LoadingButton >
251+ </ LoadingButton > }
251252 < IconButton aria-label = "delete" color = "error" onClick = { ( ) => setShowDeleteConfirmation ( true ) } >
252253 < DeleteIcon />
253254 </ IconButton >
254- </ CardActions > }
255+ </ CardActions >
255256 < DeletionConfirmation
256257 onCancel = { ( ) => setShowDeleteConfirmation ( false ) }
257258 onSubmit = { deleteTask }
258259 isOpen = { showDeleteConfirmation }
259260 dialogTitle = { 'Удаление задачи' }
260- dialogContentText = { `Вы точно хотите удалить задачу ${ title || "" } ?` }
261+ dialogContentText = { `Вы точно хотите удалить задачу ' ${ title || "" } ' ?` }
261262 confirmationWord = { '' }
262263 confirmationText = { '' }
263264 />
You can’t perform that action at this time.
0 commit comments