Skip to content

Commit ccdf2ca

Browse files
authored
feat: updating closing submission dialog (#2785)
1 parent c511d74 commit ccdf2ca

File tree

5 files changed

+52
-36
lines changed

5 files changed

+52
-36
lines changed

catalyst_voices/apps/voices/lib/common/formatters/date_formatter.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,16 @@ abstract class DateFormatter {
8181
return DateFormat('d MMM, yyyy - HH:mm').format(dateTime);
8282
}
8383

84-
/// Formats full date and time.
84+
/// Formats full date and time in 24 format with leading day of week.
8585
/// If [timeOnNewline] is true then the time will be placed on a new line.
8686
///
8787
/// Example:
88-
/// - Thu, 6 June 2024 10:00 am
88+
/// - Thu, 6 June 2024 10:00
8989
static String formatFullDateTime(
9090
DateTime dateTime, {
9191
bool timeOnNewline = false,
9292
}) {
93-
final format = timeOnNewline ? 'EEE, d MMMM yyyy\nh:mm a' : 'EEE, d MMMM yyyy h:mm a';
93+
final format = timeOnNewline ? 'EEE, d MMMM yyyy\nHH:mm' : 'EEE, d MMMM yyyy, HH:mm';
9494
return DateFormat(format).format(dateTime);
9595
}
9696

catalyst_voices/apps/voices/lib/pages/workspace/submission_closing_warning_dialog.dart

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -113,20 +113,15 @@ class _Header extends StatelessWidget {
113113

114114
class _HeadsUpInfo extends StatelessWidget {
115115
final String text;
116-
final bool isBold;
117116

118-
const _HeadsUpInfo(
119-
this.text, {
120-
this.isBold = false,
121-
});
117+
const _HeadsUpInfo(this.text);
122118

123119
@override
124120
Widget build(BuildContext context) {
125121
return Text(
126-
text.withBullet(),
122+
text.withBullet().withIndent(),
127123
style: context.textTheme.bodyLarge?.copyWith(
128124
color: context.colors.textOnPrimaryLevel1,
129-
fontWeight: isBold ? FontWeight.w700 : null,
130125
),
131126
);
132127
}
@@ -202,12 +197,11 @@ class _RightSide extends StatelessWidget {
202197
const SizedBox(height: 12),
203198
ProposalSubmissionClosesText(dateTime: date),
204199
const SizedBox(height: 12),
205-
_HeadsUpInfo(context.l10n.submitProposalBeforeClosing),
200+
_Text(context.l10n.stepsToDoBeforeAppCloses),
206201
_HeadsUpInfo(context.l10n.checkMaxProposal(ProposalDocument.maxSubmittedProposalsPerUser)),
207-
_HeadsUpInfo(
208-
context.l10n.catalystAppNotAvailableAfterSubmissionCloses,
209-
isBold: true,
210-
),
202+
_HeadsUpInfo(context.l10n.moveFinalProposalsToReviewStage),
203+
const SizedBox(height: 20),
204+
_Text(context.l10n.importCatalystAppUnavailableAfterDeadline),
211205
const Spacer(),
212206
_Countdown(date: date),
213207
const SizedBox(height: 10),
@@ -223,3 +217,19 @@ class _RightSide extends StatelessWidget {
223217
);
224218
}
225219
}
220+
221+
class _Text extends StatelessWidget {
222+
final String stepsToDoBeforeAppCloses;
223+
224+
const _Text(this.stepsToDoBeforeAppCloses);
225+
226+
@override
227+
Widget build(BuildContext context) {
228+
return Text(
229+
stepsToDoBeforeAppCloses,
230+
style: context.textTheme.bodyLarge?.copyWith(
231+
color: context.colors.textOnPrimaryLevel1,
232+
),
233+
);
234+
}
235+
}

catalyst_voices/apps/voices/lib/widgets/text/proposal_submission_closes_text.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ProposalSubmissionClosesText extends StatelessWidget {
1818
return TimezoneDateTimeTextTheme(
1919
data: TimezoneDateTimeTextThemeData(
2020
timestampTextStyle: WidgetStatePropertyAll<TextStyle>(
21-
context.textTheme.titleLarge ?? const TextStyle(),
21+
context.textTheme.titleMedium ?? const TextStyle(),
2222
),
2323
foregroundColor: WidgetStatePropertyAll(context.colors.textOnPrimaryLevel1),
2424
),

catalyst_voices/packages/internal/catalyst_voices_localization/lib/l10n/intl_en.arb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,7 +2541,7 @@
25412541
"@dontShowAgain": {
25422542
"description": "Action to not show again"
25432543
},
2544-
"proposalSubmissionWindowClosesAt": "The proposal submission window closes {date}",
2544+
"proposalSubmissionWindowClosesAt": "The proposal submission window closes on {date}",
25452545
"@proposalSubmissionWindowClosesAt": {
25462546
"description": "Description for the proposal submission window closes at",
25472547
"placeholders": {
@@ -2550,11 +2550,11 @@
25502550
}
25512551
}
25522552
},
2553-
"submitProposalBeforeClosing": "Submit your final proposals to Review stage well before the App closes.",
2554-
"@submitProposalBeforeClosing": {
2555-
"description": "Information for user to submit proposal before the submission window closes"
2553+
"moveFinalProposalsToReviewStage": "Move your Final proposals into the Review stage.",
2554+
"@moveFinalProposalsToReviewStage": {
2555+
"description": "Information for user to to move their final proposals to review stage before submission window closes"
25562556
},
2557-
"checkMaxProposal": "Check your finals (max {count}) in My proposals.",
2557+
"checkMaxProposal": "Submit no more than {count} {count, plural, =1{proposal} other{proposals}} as Final.",
25582558
"@checkMaxProposal": {
25592559
"description": "Information for user to check their final proposals before submission window closes",
25602560
"placeholders": {
@@ -2563,10 +2563,6 @@
25632563
}
25642564
}
25652565
},
2566-
"catalystAppNotAvailableAfterSubmissionCloses": "The Catalyst App won’t be available after submission close.",
2567-
"@catalystAppNotAvailableAfterSubmissionCloses": {
2568-
"description": "Information that app won't be available after submission closes"
2569-
},
25702566
"wantToBackUpProposals": "Want to back up your proposals?",
25712567
"@wantToBackUpProposals": {
25722568
"description": "Title for section informing user that they can backup their proposals"
@@ -3005,5 +3001,13 @@
30053001
"reviewTimelineHeader": "Community review:",
30063002
"@reviewTimelineHeader": {
30073003
"description": "Header for the review timeline"
3004+
},
3005+
"stepsToDoBeforeAppCloses": "Before the Catalyst app closes, make sure to:",
3006+
"@stepsToDoBeforeAppCloses": {
3007+
"description": "Title for the steps to do before the app closes"
3008+
},
3009+
"importCatalystAppUnavailableAfterDeadline": "IMPORTANT: The Catalyst app won’t be accessible after the deadline.",
3010+
"@importCatalystAppUnavailableAfterDeadline": {
3011+
"description": "note for user that app will not be available after submission deadline"
30083012
}
30093013
}

catalyst_voices/packages/internal/catalyst_voices_shared/lib/src/utils/string_ext.dart

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,6 @@ extension StringExt on String {
2020
return toLowerCase() == other?.toLowerCase();
2121
}
2222

23-
String replaceAllMappedIndexed(
24-
Pattern from,
25-
String Function(Match match, int index) replace,
26-
) {
27-
var index = 0;
28-
return replaceAllMapped(
29-
from,
30-
(match) => replace(match, index++),
31-
);
32-
}
33-
3423
// TODO(dtscalac): temporary solution to format dynamic strings as plural,
3524
// after F14 the document schema must be altered to support
3625
// other languages than English.
@@ -61,6 +50,17 @@ extension StringExt on String {
6150
return this;
6251
}
6352

53+
String replaceAllMappedIndexed(
54+
Pattern from,
55+
String Function(Match match, int index) replace,
56+
) {
57+
var index = 0;
58+
return replaceAllMapped(
59+
from,
60+
(match) => replace(match, index++),
61+
);
62+
}
63+
6464
String starred({
6565
bool leading = true,
6666
bool isEnabled = true,
@@ -74,6 +74,8 @@ extension StringExt on String {
7474

7575
String withBullet() => withPrefix('• ');
7676

77+
String withIndent() => ' $this';
78+
7779
String withPrefix(String value) => '$value$this';
7880

7981
String withSuffix(

0 commit comments

Comments
 (0)