Skip to content

Commit 731b44f

Browse files
chrisbobbegnprice
authored andcommitted
action_sheet: Implement resolve/unresolve in topic action sheet
Fixes: #744
1 parent 2412fbc commit 731b44f

14 files changed

+359
-10
lines changed

assets/l10n/app_en.arb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,22 @@
9292
"@actionSheetOptionUnfollowTopic": {
9393
"description": "Label for unfollowing a topic on action sheet."
9494
},
95+
"actionSheetOptionResolveTopic": "Mark as resolved",
96+
"@actionSheetOptionResolveTopic": {
97+
"description": "Label for the 'Mark as resolved' button on the topic action sheet."
98+
},
99+
"actionSheetOptionUnresolveTopic": "Mark as unresolved",
100+
"@actionSheetOptionUnresolveTopic": {
101+
"description": "Label for the 'Mark as unresolved' button on the topic action sheet."
102+
},
103+
"errorResolveTopicFailedTitle": "Failed to mark topic as resolved",
104+
"@errorResolveTopicFailedTitle": {
105+
"description": "Error title when marking a topic as resolved failed."
106+
},
107+
"errorUnresolveTopicFailedTitle": "Failed to mark topic as unresolved",
108+
"@errorUnresolveTopicFailedTitle": {
109+
"description": "Error title when marking a topic as unresolved failed."
110+
},
95111
"actionSheetOptionCopyMessageText": "Copy message text",
96112
"@actionSheetOptionCopyMessageText": {
97113
"description": "Label for copy message text button on action sheet."

lib/api/model/model.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,12 @@ extension type const TopicName(String _value) {
695695
/// The key to use for "same topic as" comparisons.
696696
String canonicalize() => apiName.toLowerCase();
697697

698+
/// Whether the topic starts with [resolvedTopicPrefix].
699+
bool get isResolved => _value.startsWith(resolvedTopicPrefix);
700+
701+
/// This [TopicName] plus the [resolvedTopicPrefix] prefix.
702+
TopicName resolve() => TopicName(resolvedTopicPrefix + _value);
703+
698704
/// A [TopicName] with [resolvedTopicPrefixRegexp] stripped if present.
699705
TopicName unresolve() =>
700706
TopicName(_value.replaceFirst(resolvedTopicPrefixRegexp, ''));

lib/generated/l10n/zulip_localizations.dart

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,30 @@ abstract class ZulipLocalizations {
243243
/// **'Unfollow topic'**
244244
String get actionSheetOptionUnfollowTopic;
245245

246+
/// Label for the 'Mark as resolved' button on the topic action sheet.
247+
///
248+
/// In en, this message translates to:
249+
/// **'Mark as resolved'**
250+
String get actionSheetOptionResolveTopic;
251+
252+
/// Label for the 'Mark as unresolved' button on the topic action sheet.
253+
///
254+
/// In en, this message translates to:
255+
/// **'Mark as unresolved'**
256+
String get actionSheetOptionUnresolveTopic;
257+
258+
/// Error title when marking a topic as resolved failed.
259+
///
260+
/// In en, this message translates to:
261+
/// **'Failed to mark topic as resolved'**
262+
String get errorResolveTopicFailedTitle;
263+
264+
/// Error title when marking a topic as unresolved failed.
265+
///
266+
/// In en, this message translates to:
267+
/// **'Failed to mark topic as unresolved'**
268+
String get errorUnresolveTopicFailedTitle;
269+
246270
/// Label for copy message text button on action sheet.
247271
///
248272
/// In en, this message translates to:

lib/generated/l10n/zulip_localizations_ar.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
7979
@override
8080
String get actionSheetOptionUnfollowTopic => 'Unfollow topic';
8181

82+
@override
83+
String get actionSheetOptionResolveTopic => 'Mark as resolved';
84+
85+
@override
86+
String get actionSheetOptionUnresolveTopic => 'Mark as unresolved';
87+
88+
@override
89+
String get errorResolveTopicFailedTitle => 'Failed to mark topic as resolved';
90+
91+
@override
92+
String get errorUnresolveTopicFailedTitle => 'Failed to mark topic as unresolved';
93+
8294
@override
8395
String get actionSheetOptionCopyMessageText => 'Copy message text';
8496

lib/generated/l10n/zulip_localizations_en.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
7979
@override
8080
String get actionSheetOptionUnfollowTopic => 'Unfollow topic';
8181

82+
@override
83+
String get actionSheetOptionResolveTopic => 'Mark as resolved';
84+
85+
@override
86+
String get actionSheetOptionUnresolveTopic => 'Mark as unresolved';
87+
88+
@override
89+
String get errorResolveTopicFailedTitle => 'Failed to mark topic as resolved';
90+
91+
@override
92+
String get errorUnresolveTopicFailedTitle => 'Failed to mark topic as unresolved';
93+
8294
@override
8395
String get actionSheetOptionCopyMessageText => 'Copy message text';
8496

lib/generated/l10n/zulip_localizations_ja.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
7979
@override
8080
String get actionSheetOptionUnfollowTopic => 'Unfollow topic';
8181

82+
@override
83+
String get actionSheetOptionResolveTopic => 'Mark as resolved';
84+
85+
@override
86+
String get actionSheetOptionUnresolveTopic => 'Mark as unresolved';
87+
88+
@override
89+
String get errorResolveTopicFailedTitle => 'Failed to mark topic as resolved';
90+
91+
@override
92+
String get errorUnresolveTopicFailedTitle => 'Failed to mark topic as unresolved';
93+
8294
@override
8395
String get actionSheetOptionCopyMessageText => 'Copy message text';
8496

lib/generated/l10n/zulip_localizations_nb.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
7979
@override
8080
String get actionSheetOptionUnfollowTopic => 'Unfollow topic';
8181

82+
@override
83+
String get actionSheetOptionResolveTopic => 'Mark as resolved';
84+
85+
@override
86+
String get actionSheetOptionUnresolveTopic => 'Mark as unresolved';
87+
88+
@override
89+
String get errorResolveTopicFailedTitle => 'Failed to mark topic as resolved';
90+
91+
@override
92+
String get errorUnresolveTopicFailedTitle => 'Failed to mark topic as unresolved';
93+
8294
@override
8395
String get actionSheetOptionCopyMessageText => 'Copy message text';
8496

lib/generated/l10n/zulip_localizations_pl.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
7979
@override
8080
String get actionSheetOptionUnfollowTopic => 'Nie śledź wątku';
8181

82+
@override
83+
String get actionSheetOptionResolveTopic => 'Mark as resolved';
84+
85+
@override
86+
String get actionSheetOptionUnresolveTopic => 'Mark as unresolved';
87+
88+
@override
89+
String get errorResolveTopicFailedTitle => 'Failed to mark topic as resolved';
90+
91+
@override
92+
String get errorUnresolveTopicFailedTitle => 'Failed to mark topic as unresolved';
93+
8294
@override
8395
String get actionSheetOptionCopyMessageText => 'Skopiuj tekst wiadomości';
8496

lib/generated/l10n/zulip_localizations_ru.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
7979
@override
8080
String get actionSheetOptionUnfollowTopic => 'Не отслеживать тему';
8181

82+
@override
83+
String get actionSheetOptionResolveTopic => 'Mark as resolved';
84+
85+
@override
86+
String get actionSheetOptionUnresolveTopic => 'Mark as unresolved';
87+
88+
@override
89+
String get errorResolveTopicFailedTitle => 'Failed to mark topic as resolved';
90+
91+
@override
92+
String get errorUnresolveTopicFailedTitle => 'Failed to mark topic as unresolved';
93+
8294
@override
8395
String get actionSheetOptionCopyMessageText => 'Скопировать текст сообщения';
8496

lib/generated/l10n/zulip_localizations_sk.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,18 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
7979
@override
8080
String get actionSheetOptionUnfollowTopic => 'Prestať sledovať tému';
8181

82+
@override
83+
String get actionSheetOptionResolveTopic => 'Mark as resolved';
84+
85+
@override
86+
String get actionSheetOptionUnresolveTopic => 'Mark as unresolved';
87+
88+
@override
89+
String get errorResolveTopicFailedTitle => 'Failed to mark topic as resolved';
90+
91+
@override
92+
String get errorUnresolveTopicFailedTitle => 'Failed to mark topic as unresolved';
93+
8294
@override
8395
String get actionSheetOptionCopyMessageText => 'Skopírovať text správy';
8496

0 commit comments

Comments
 (0)