diff --git a/i18n/core/en.json b/i18n/core/en.json index f0b95562..bce90285 100644 --- a/i18n/core/en.json +++ b/i18n/core/en.json @@ -21,6 +21,7 @@ "deputy.session.section.close": "Archive section", "deputy.session.section.closeComments": "Archiving comments", "deputy.session.section.closeHelp": "Your signature will automatically be included.", + "deputy.session.section.closeWarning": "Some revisions remain unassessed. You may want to mark these revisions as assessed before archiving this section.", "deputy.session.section.closeWarn": "You have unsaved changes. Close the section without saving?", "deputy.session.section.stop": "Stop session", diff --git a/src/css/deputy.css b/src/css/deputy.css index f0e8a825..17b46889 100644 --- a/src/css/deputy.css +++ b/src/css/deputy.css @@ -265,6 +265,10 @@ body.mediawiki.rtl .dp-cs-row-head > :not(:first-child):not(:last-child) { margin-bottom: 8px; } +.dp-cs-section-unfinishedWarning { + margin-top: 8px; +} + .dp-cs-row-closeComments { font-family: monospace, monospace; font-size: small; diff --git a/src/ui/root/DeputyContributionSurveyRow.tsx b/src/ui/root/DeputyContributionSurveyRow.tsx index 12e8d011..b4eeb3bf 100644 --- a/src/ui/root/DeputyContributionSurveyRow.tsx +++ b/src/ui/root/DeputyContributionSurveyRow.tsx @@ -517,7 +517,7 @@ export default class DeputyContributionSurveyRow implements DeputyUIElement { this.unfinishedMessageBox = new OO.ui.MessageWidget( { classes: [ 'dp-cs-row-unfinishedWarning' ], - type: 'warn', + type: 'warning', label: mw.msg( 'deputy.session.row.unfinishedWarning' ) } ); this.unfinishedMessageBox.toggle( false ); diff --git a/src/ui/root/DeputyContributionSurveySection.tsx b/src/ui/root/DeputyContributionSurveySection.tsx index eefd1027..590a5ec8 100644 --- a/src/ui/root/DeputyContributionSurveySection.tsx +++ b/src/ui/root/DeputyContributionSurveySection.tsx @@ -18,6 +18,7 @@ import { ContributionSurveyRowSigningBehavior } from '../../models/ContributionSurveyRowSigningBehavior'; import { generateTrace } from '../../models/DeputyTrace'; +import DeputyMessageWidget from '../shared/DeputyMessageWidget'; /** * The contribution survey section UI element. This includes a list of revisions @@ -519,6 +520,13 @@ export default class DeputyContributionSurveySection implements DeputyUIElement this.setDisabled( false ); } ); + const closingWarning = DeputyMessageWidget( { + classes: [ 'dp-cs-section-unfinishedWarning' ], + type: 'warning', + label: mw.msg( 'deputy.session.section.closeWarning' ) + } ); + closingWarning.toggle( false ); + const closingCommentsField = new OO.ui.FieldLayout( this.closingComments, { align: 'top', label: 'Closing comments', @@ -537,6 +545,7 @@ export default class DeputyContributionSurveySection implements DeputyUIElement this.closingCheckbox.on( 'change', ( v: boolean ) => { this.closed = v; closingCommentsField.toggle( v ); + closingWarning.toggle( v && this.rows.some( ( row ) => !row.completed ) ); this.toggleClosingComments( v ); } ); this.closingComments.on( 'change', ( v: string ) => { @@ -561,6 +570,7 @@ export default class DeputyContributionSurveySection implements DeputyUIElement align: 'inline', label: mw.msg( 'deputy.session.section.close' ) } ) ) } + { unwrapWidget( closingWarning ) } { unwrapWidget( closingCommentsField ) }