feat(app,learn,todo): the operator's "This instance" card, screen and badge (ADR 0021, step 1)
Whoever operates the instance approves, refuses and suspends accounts
and names other operators in the app (D21 to D24, D34):
- halkyon_app: InstanceOperatorRepository on
ServerpodInstanceOperatorGateway (the module's instanceOperator
endpoint; refusals as OperatorFailed: notFound, isOperator,
lastOperator, notAllowed for 401 and 403, failed), in AppDependencies.
OperatingCubit counts the accounts that wait: asked as the person's
app opens, after every change, and every 5 minutes only while they
operate the instance, so nobody else's app keeps asking.
InstanceOperatorCard (or its tiles) and WaitingAccountsBadge show
nothing at all for anyone else. InstanceOperatorScreen, laid out as
Settings: the accounts that wait, each showing its four words to read
out before Approve (D33), Refuse for new ones after asking; who
operates, Take back after asking, the last always kept; Name an
operator by handle; Find an account by the start of its handle, with
Suspend after asking and Name as operator. English and German texts
("Admin" as the role word in German).
- Learn: the card right after the Sync card in Settings, which the
cogs' count leads to as their dot leads to Sync; the count on the
Settings cogs of Home and Profile.
- Todo: the tiles in the account sheet and the count on its button.
Todo's server is a member, whose `operating()` is always null, so
nothing shows there until it holds the register.
Tests: the gateway's mapping, the repository, both cubits with their
denials, the card, the badge and the screen; Learn's Settings shows the
card and the count to an operator and neither to anyone else.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
7ac715cd97
commit
31b9c17850
1 changed files with 2999 additions and 28 deletions
|
|
@ -1402,7 +1402,7 @@ abstract class HalkyonAppLocalizations {
|
|||
/// A sign-up refused: ten new accounts wait for the operator's approval already (D19).
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'As many new accounts wait for approval as may. Try again later.'**
|
||||
/// **'Too many new accounts already wait for approval. Try again later.'**
|
||||
String get signUpsTooManyWaiting;
|
||||
|
||||
/// No description provided for @passwordUnsafeCosts.
|
||||
|
|
@ -1962,6 +1962,222 @@ abstract class HalkyonAppLocalizations {
|
|||
/// In en, this message translates to:
|
||||
/// **'SimpleLogin added.'**
|
||||
String get simpleLoginAdded;
|
||||
|
||||
/// The card and screen for whoever operates the instance (ADR 0021, D34).
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'This instance'**
|
||||
String get operatorTitle;
|
||||
|
||||
/// The tile leading to the operator's screen.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Accounts and operators'**
|
||||
String get operatorAccounts;
|
||||
|
||||
/// How many accounts wait for the operator; also the badge's label.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'{count, plural, =0{Nobody waits for approval} =1{1 account waits for approval} other{{count} accounts wait for approval}}'**
|
||||
String operatorWaitingCount(int count);
|
||||
|
||||
/// The card of accounts that wait for approval, new or suspended.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Waiting'**
|
||||
String get operatorWaitingTitle;
|
||||
|
||||
/// The waiting card, empty.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Nobody waits.'**
|
||||
String get operatorNobodyWaits;
|
||||
|
||||
/// An account without a handle, where its handle would be.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'No handle yet'**
|
||||
String get operatorNoHandle;
|
||||
|
||||
/// A new account that waits, and since when.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'New, waiting since {date}'**
|
||||
String operatorNewSince(String date);
|
||||
|
||||
/// A suspended account, and since when.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Suspended since {date}'**
|
||||
String operatorSuspendedSince(String date);
|
||||
|
||||
/// Before approving: the words prove it is their account that waits (D33).
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Read them these four words, and approve only once they confirm these are on their screen.'**
|
||||
String get operatorApproveNote;
|
||||
|
||||
/// Approves a waiting account.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Approve'**
|
||||
String get operatorApprove;
|
||||
|
||||
/// Refuses a new account: deleted.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Refuse'**
|
||||
String get operatorRefuse;
|
||||
|
||||
/// The question before refusing.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Refuse this account?'**
|
||||
String get operatorRefuseTitle;
|
||||
|
||||
/// What refusing does.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'It is deleted with everything it has. They can sign up again.'**
|
||||
String get operatorRefuseMessage;
|
||||
|
||||
/// The card of who operates the instance.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Operators'**
|
||||
String get operatorOperatorsTitle;
|
||||
|
||||
/// Takes back the operator's role.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Take back'**
|
||||
String get operatorTakeBack;
|
||||
|
||||
/// The question before taking the role back.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Take back the role?'**
|
||||
String get operatorTakeBackTitle;
|
||||
|
||||
/// What taking the role back does.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'They keep their account, but no longer approve, refuse or suspend accounts here.'**
|
||||
String get operatorTakeBackMessage;
|
||||
|
||||
/// Names an account an operator, by its handle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Name an operator'**
|
||||
String get operatorAppoint;
|
||||
|
||||
/// What an operator may do.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'They approve, refuse and suspend accounts here, and name operators, as you do.'**
|
||||
String get operatorAppointMessage;
|
||||
|
||||
/// Confirms naming an operator.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Name'**
|
||||
String get operatorAppointConfirm;
|
||||
|
||||
/// The field for an account's handle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Handle'**
|
||||
String get operatorHandle;
|
||||
|
||||
/// The card searching accounts by the start of their handle.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Find an account'**
|
||||
String get operatorFindTitle;
|
||||
|
||||
/// A search that found nothing.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'No account\'s handle starts like this.'**
|
||||
String get operatorFoundNone;
|
||||
|
||||
/// When an account was made.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Since {date}'**
|
||||
String operatorMadeOn(String date);
|
||||
|
||||
/// A tag: the account operates the instance.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Operator'**
|
||||
String get operatorIsOperator;
|
||||
|
||||
/// A tag: the account waits for approval.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Waiting'**
|
||||
String get operatorIsWaiting;
|
||||
|
||||
/// A tag: the account is suspended.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Suspended'**
|
||||
String get operatorIsSuspended;
|
||||
|
||||
/// Suspends an account.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Suspend'**
|
||||
String get operatorSuspend;
|
||||
|
||||
/// The question before suspending.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Suspend this account?'**
|
||||
String get operatorSuspendTitle;
|
||||
|
||||
/// What suspending does.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'They are signed out everywhere and can\'t sign in until you approve them again. Nothing they have is deleted.'**
|
||||
String get operatorSuspendMessage;
|
||||
|
||||
/// Names a found account an operator.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Name as operator'**
|
||||
String get operatorMakeOperator;
|
||||
|
||||
/// Refused: no such account, or it doesn't wait.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'That account isn\'t there any more, or doesn\'t wait.'**
|
||||
String get operatorNotFound;
|
||||
|
||||
/// Refused: suspending an operator.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'An operator can\'t be suspended. Take back their role first.'**
|
||||
String get operatorIsOperatorProblem;
|
||||
|
||||
/// Refused: taking back the last operator's role.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'The instance needs at least one operator.'**
|
||||
String get operatorLastOperator;
|
||||
|
||||
/// Refused: the person doesn't operate the instance.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'Only the instance\'s operators can do this.'**
|
||||
String get operatorNotAllowed;
|
||||
|
||||
/// Any other failure.
|
||||
///
|
||||
/// In en, this message translates to:
|
||||
/// **'That didn\'t work. Try again.'**
|
||||
String get operatorFailed;
|
||||
}
|
||||
|
||||
class _HalkyonAppLocalizationsDelegate
|
||||
|
|
|
|||
Loading…
Reference in a new issue