File tree Expand file tree Collapse file tree 3 files changed +10
-6
lines changed
manager-dashboard/app/views/NewTutorial Expand file tree Collapse file tree 3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 99
1010import TextInput from '#components/TextInput' ;
1111import Button from '#components/Button' ;
12- import MarkdownEditor from '#components/MarkdownEditor' ;
1312import InformationPagePreview from './InformationPagePreview' ;
1413
1514import { InformationPagesType } from '../utils' ;
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ import {
7676 InformationPagesType ,
7777 colorKeyToColorMap ,
7878 InformationPageTemplateKey ,
79- infoPageTemplateoptions ,
79+ infoPageTemplateOptions ,
8080 infoPageBlocksMap ,
8181 tileServerUrls ,
8282 ColorKey ,
@@ -565,14 +565,19 @@ function NewTutorial(props: Props) {
565565 popupContentClassName = { styles . newInfoButtonPopup }
566566 disabled = { submissionPending || projectTypeEmpty }
567567 >
568- { infoPageTemplateoptions . map ( ( infoPageTemplate ) => (
568+ { infoPageTemplateOptions . map ( ( infoPageTemplate ) => (
569569 < Button
570570 className = { styles . popupItem }
571571 name = { infoPageTemplate . key }
572572 key = { infoPageTemplate . key }
573573 onClick = { handleAddInformationPage }
574574 variant = "transparent"
575- disabled = { submissionPending || projectTypeEmpty }
575+ disabled = { (
576+ submissionPending
577+ || projectTypeEmpty
578+ || ( value . informationPages
579+ && value . informationPages . length >= 10 )
580+ ) }
576581 >
577582 { infoPageTemplate . label }
578583 </ Button >
Original file line number Diff line number Diff line change @@ -170,7 +170,7 @@ export interface InformationPageOption {
170170 label : string ;
171171}
172172
173- export const infoPageTemplateoptions : InformationPageOption [ ] = [
173+ export const infoPageTemplateOptions : InformationPageOption [ ] = [
174174 {
175175 key : '1-picture' ,
176176 label : 'With 1 picture' ,
@@ -429,7 +429,7 @@ export const tutorialFormSchema: TutorialFormSchema = {
429429 } ,
430430 informationPages : {
431431 validation : ( info ) => {
432- if ( info && info . length >= 10 ) {
432+ if ( info && info . length > 10 ) {
433433 return 'Information page cannot be more than 10' ;
434434 }
435435 return undefined ;
You can’t perform that action at this time.
0 commit comments