Skip to content

Commit

Permalink
added container action dialogs
Browse files Browse the repository at this point in the history
  • Loading branch information
frankmer committed Oct 15, 2024
1 parent 0e9785f commit 082f0bc
Show file tree
Hide file tree
Showing 17 changed files with 269 additions and 118 deletions.
4 changes: 2 additions & 2 deletions lib/l10n/app_cs.arb
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
"@isPiTokenQuestion": {
"description": "Label for the question if the token is a privacyIDEA token."
},
"@issuer": {
"@issuerLabel": {
"description": "Label for the issuer of the token, container... etc.",
"placeholders": {
"name": {
Expand Down Expand Up @@ -808,7 +808,7 @@
"invalidValueIn": "Typ {type} \"{value}\" není platná pro \"{parameter}\" v \"{map}\".",
"isExpotableQuestion": "Lze exportovat?",
"isPiTokenQuestion": "Je to token privacyIDEA?",
"issuer": "Issuer: {name}",
"issuerLabel": "Issuer: {name}",
"language": "Jazyk",
"legacySigningErrorMessage": "Token byl vytvořen v zastaralé verzi aplikace, což může vést k problémům při jeho používání.\nPokud problém přetrvává, doporučujeme vytvořit nový push token!",
"legacySigningErrorTitle": "Při použití staršího tokenu došlo k chybě: {tokenLabel}",
Expand Down
4 changes: 2 additions & 2 deletions lib/l10n/app_de.arb
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
"@isPiTokenQuestion": {
"description": "Label for the question if the token is a privacyIDEA token."
},
"@issuer": {
"@issuerLabel": {
"description": "Label for the issuer of the token, container... etc.",
"placeholders": {
"name": {
Expand Down Expand Up @@ -808,7 +808,7 @@
"invalidValueIn": "Der {type} \"{value}\" ist nicht gültig für \"{parameter}\" in \"{map}\"",
"isExpotableQuestion": "Ist exportierbar?",
"isPiTokenQuestion": "Ist ein privacyIDEA-Token?",
"issuer": "Issuer: {name}",
"issuerLabel": "Issuer: {name}",
"language": "Sprache",
"legacySigningErrorMessage": "Der Token wurde in einer veralteten Version der App erstellt, was zu Problemen bei der Verwendung führen kann. Es wird empfohlen, einen neuen Push-Token zu erstellen, wenn das Problem weiterhin besteht!",
"legacySigningErrorTitle": "Bei der Verwendung des veralteten Tokens ist ein Fehler aufgetreten: {tokenLabel}",
Expand Down
44 changes: 16 additions & 28 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
"@container": {
"description": "Title for the container view."
},
"@containerSerial": {
"description": "description"
},
"@continueButton": {
"description": "description"
},
Expand Down Expand Up @@ -194,9 +197,6 @@
"@deviceCredentialsRequiredTitle": {
"description": "Message showed as a title in a dialog which indicates the user has not set up credentials authentication on their device. It is used on Android side. Maximum 60 characters."
},
"@deviceCredentialsSetupDescription": {
"description": "Message advising the user to go to the settings and configure device credentials on their device. It shows in a dialog on Android side."
},
"@digits": {
"description": "Title of the dropdown button where the number of digits for the opt value is selected."
},
Expand Down Expand Up @@ -399,9 +399,6 @@
"@goToSettingsButton": {
"description": "Message showed on a button that the user can click to go to settings pages from the current dialog. It is used on both Android and iOS side. Maximum 30 characters."
},
"@goToSettingsDescription": {
"description": "Message advising the user to go to the settings and configure device credentials or biometrics on their device."
},
"@grantCameraPermissionDialogButton": {
"description": "description"
},
Expand All @@ -411,9 +408,6 @@
"@grantCameraPermissionDialogTitle": {
"description": "description"
},
"@guide": {
"description": "Button to open the guide screen."
},
"@handshakeFailed": {
"description": "Error message when the handshake failed."
},
Expand Down Expand Up @@ -606,7 +600,7 @@
"@isExpotableQuestion": {
"description": "Label for the question if the token is exportable."
},
"@issuer": {
"@issuerLabel": {
"description": "Label for the issuer of the token, container... etc.",
"placeholders": {
"name": {
Expand Down Expand Up @@ -634,9 +628,6 @@
"@licensesAndVersion": {
"description": "description"
},
"@lightTheme": {
"description": "The light theme."
},
"@linkedContainer": {
"description": "Label for the linked container serial number."
},
Expand Down Expand Up @@ -727,14 +718,6 @@
"@ok": {
"description": "Button to confirm an action."
},
"@onBoardingTitle1": {
"description": "description",
"placeholders": {
"appName": {
"example": "privacyIDEA Authenticator"
}
}
},
"@oneMore": {
"description": "description"
},
Expand Down Expand Up @@ -927,9 +910,6 @@
"@requestTriggerdByUserQuestion": {
"description": "description"
},
"@retry": {
"description": "Label for e.g. a button. Something is tried to be done again."
},
"@retryRollout": {
"description": "description"
},
Expand Down Expand Up @@ -1068,9 +1048,6 @@
"@synchronizingTokens": {
"description": "Title of the push synchronization dialog."
},
"@systemTheme": {
"description": "The systems theme."
},
"@theSecretDoesNotFitTheCurrentEncoding": {
"description": "Hint telling the user that the secret does not fit the selected encoding."
},
Expand Down Expand Up @@ -1222,6 +1199,8 @@
"confirmation": "Confirmation",
"connectionFailed": "Connection failed.",
"container": "Container",
"containerSerial": "Container Serial",
"containerSyncUrl": "Container Sync Url",
"continueButton": "Continue",
"copyOTPToClipboard": "Copy OTP to clipboard",
"couldNotConnectToServer": "Could not connect to server",
Expand All @@ -1243,12 +1222,14 @@
"deleteContainerDialogContent": "If you delete this container, the smartphone is disconnected from the privacyIDEA server and the tokens of this container become unusable. Before deleting, make sure that the corresponding tokens are no longer required!",
"deleteContainerDialogTitle": "Deleting Container {serial}",
"deleteLockedToken": "Please authenticate to delete the locked token.",
"details": "Details",
"deviceCredentialsRequiredTitle": "Device credentials not set up",
"deviceCredentialsSetupDescription": "Setup device credentials in the device's settings",
"digits": "Digits",
"dismiss": "Dismiss",
"done": "Done",
"edit": "Edit",
"editContainer": "Edit Container",
"editLockedToken": "Please authenticate to edit the locked token.",
"editToken": "Edit Token",
"enablePolling": "Enable polling",
Expand Down Expand Up @@ -1292,6 +1273,7 @@
"feedbackSentTitle": "Feedback sent",
"feedbackTitle": "Your feedback is always welcome!",
"fileSavedToDownloadsFolder": "File saved to Downloads folder",
"finalizationState": "Finalization State",
"finalizeContainerFailed": "Finalize Container Failed",
"findingQrCodeInImage": "Looking for QR code in image...",
"firebaseToken": "Firebase Token",
Expand Down Expand Up @@ -1345,7 +1327,8 @@
"invalidValueIn": "The {type} \"{value}\" is not valid for \"{parameter}\" in \"{map}\"",
"isExpotableQuestion": "Is exportable?",
"isPiTokenQuestion": "It's a privacyIDEA token?",
"issuer": "Issuer: {name}",
"issuer": "Issuer",
"issuerLabel": "Issuer: {name}",
"language": "Language",
"legacySigningErrorMessage": "The token was enrolled in a old version of this app, which may cause trouble using it.\nIt is suggested to enroll a new push token if the problem persist!",
"legacySigningErrorTitle": "An error occured while using the legacy token: {tokenLabel}",
Expand Down Expand Up @@ -1474,6 +1457,11 @@
"sync": "Sync",
"syncContainerFailed": "Container synchronization failed",
"syncFbTokenFailed": "Synchronization failed for the following tokens, please try again:",
"syncState": "Sync State",
"syncStateCompletedName": "Sync Completed",
"syncStateFailedName": "Sync Failed",
"syncStateNotStartedName": "Sync not started",
"syncStateSyncingName": "Currently Syncing",
"synchronizePushTokens": "Synchronize push tokens",
"synchronizesTokensWithServer": "Synchronizes tokens with the privacyIDEA server.",
"synchronizingTokens": "Synchronizing tokens.",
Expand Down
8 changes: 6 additions & 2 deletions lib/l10n/app_es.arb
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
"@container": {
"description": "Title for the container view."
},
"@containerSerial": {
"description": "description"
},
"@couldNotSignMessage": {
"description": "Tells the user that the message could not be signed."
},
Expand Down Expand Up @@ -282,7 +285,7 @@
"@isPiTokenQuestion": {
"description": "Label for the question if the token is a privacyIDEA token."
},
"@issuer": {
"@issuerLabel": {
"description": "Label for the issuer of the token, container... etc.",
"placeholders": {
"name": {
Expand Down Expand Up @@ -689,6 +692,7 @@
"confirmation": "confirmación",
"connectionFailed": "Conexión fallida.",
"container": "Contenedor",
"containerSerial": "Container Serial",
"continueButton": "Continue",
"copyOTPToClipboard": "Copiar OTP al portapapeles",
"couldNotConnectToServer": "No se ha podido conectar con el servidor.",
Expand Down Expand Up @@ -808,7 +812,7 @@
"invalidValueIn": "untranslated",
"isExpotableQuestion": "¿Es exportable?",
"isPiTokenQuestion": "¿Es un token de privacyIDEA?",
"issuer": "Issuer: {name}",
"issuerLabel": "Issuer: {name}",
"language": "Language",
"legacySigningErrorMessage": "El token se creó en una versión obsoleta de la aplicación, lo que puede provocar problemas al utilizarlo.\nSe recomienda crear un nuevo token push si el problema persiste.",
"legacySigningErrorTitle": "Se ha producido un error al utilizar el token obsoleto: {tokenLabel}",
Expand Down
4 changes: 2 additions & 2 deletions lib/l10n/app_fr.arb
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
"@isPiTokenQuestion": {
"description": "Label for the question if the token is a privacyIDEA token."
},
"@issuer": {
"@issuerLabel": {
"description": "Label for the issuer of the token, container... etc.",
"placeholders": {
"name": {
Expand Down Expand Up @@ -808,7 +808,7 @@
"invalidValueIn": "untranslated",
"isExpotableQuestion": "Est exportable ?",
"isPiTokenQuestion": "C'est un jeton privacyIDEA ?",
"issuer": "Issuer: {name}",
"issuerLabel": "Issuer: {name}",
"language": "Langue",
"legacySigningErrorMessage": "Le token a été créé dans une version obsolète de l'application, ce qui peut entraîner des problèmes d'utilisation.\nIl est recommandé de créer un nouveau token push si le problème persiste !",
"legacySigningErrorTitle": "Une erreur s'est produite lors de l'utilisation du jeton obsolète : {tokenLabel}",
Expand Down
4 changes: 2 additions & 2 deletions lib/l10n/app_nl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@
"@isPiTokenQuestion": {
"description": "Label for the question if the token is a privacyIDEA token."
},
"@issuer": {
"@issuerLabel": {
"description": "Label for the issuer of the token, container... etc.",
"placeholders": {
"name": {
Expand Down Expand Up @@ -802,7 +802,7 @@
"invalidValueIn": "untranslated",
"isExpotableQuestion": "Is exporteerbaar?",
"isPiTokenQuestion": "Is het een privacyIDEA token?",
"issuer": "Issuer: {name}",
"issuerLabel": "Issuer: {name}",
"language": "Taal",
"legacySigningErrorMessage": "Het token is aangemaakt in een verouderde versie van de app, wat kan leiden tot problemen bij het gebruik ervan.\nHet wordt aanbevolen om een nieuw push token aan te maken als het probleem zich blijft voordoen!",
"legacySigningErrorTitle": "Er is een fout opgetreden bij het gebruik van het verouderde token: {tokenLabel}",
Expand Down
4 changes: 2 additions & 2 deletions lib/l10n/app_pl.arb
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
"@isPiTokenQuestion": {
"description": "Label for the question if the token is a privacyIDEA token."
},
"@issuer": {
"@issuerLabel": {
"description": "Label for the issuer of the token, container... etc.",
"placeholders": {
"name": {
Expand Down Expand Up @@ -802,7 +802,7 @@
"invalidValueIn": "untranslated",
"isExpotableQuestion": "Czy można eksportować?",
"isPiTokenQuestion": "To jest token privacyIDEA?",
"issuer": "Issuer: {name}",
"issuerLabel": "Issuer: {name}",
"language": "Język",
"legacySigningErrorMessage": "Token został utworzony w nieaktualnej wersji aplikacji, co może prowadzić do problemów podczas korzystania z niego.\nZaleca się utworzenie nowego tokena push, jeśli problem nadal występuje!",
"legacySigningErrorTitle": "Wystąpił błąd podczas korzystania z przestarzałego tokena: {tokenLabel}",
Expand Down
25 changes: 25 additions & 0 deletions lib/model/enums/sync_state.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* privacyIDEA Authenticator
*
* Author: Frank Merkel <[email protected]>
*
* Copyright (c) 2024 NetKnights GmbH
*
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
enum SyncState {
notStarted,
syncing,
completed,
failed,
}
32 changes: 32 additions & 0 deletions lib/model/extensions/enums/sync_state_extension.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* privacyIDEA Authenticator
*
* Author: Frank Merkel <[email protected]>
*
* Copyright (c) 2024 NetKnights GmbH
*
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import 'package:privacyidea_authenticator/l10n/app_localizations.dart';

import '../../enums/sync_state.dart';

extension SyncStateX on SyncState {
String localizedName(AppLocalizations localization) => switch (this) {
SyncState.notStarted => localization.syncStateNotStartedName,
SyncState.syncing => localization.syncStateSyncingName,
SyncState.completed => localization.syncStateCompletedName,
SyncState.failed => localization.syncStateFailedName,
};
}
5 changes: 1 addition & 4 deletions lib/model/token_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import '../utils/logger.dart';
import '../utils/object_validator.dart';
import 'enums/rollout_state.dart';
import 'enums/ec_key_algorithm.dart';
import 'enums/sync_state.dart';
import 'enums/token_origin_source_type.dart';
import 'token_import/token_origin_data.dart';

Expand Down Expand Up @@ -197,10 +198,6 @@ class TokenContainer with _$TokenContainer {
),
);
}
//be99ff65b1c38ae8a7d6caf8799a0cce3749fe0e|2024-08-27 14:30:58.371312Z|http://192.168.0.230:5000/container/register/finalize|SMPH0000D49C
//be99ff65b1c38ae8a7d6caf8799a0cce3749fe0e|2024-08-27T14:30:58.371312+00:00|http://192.168.0.230:5000/container/register/finalize|SMPH0000D49C

enum SyncState { notStarted, syncing, completed, failed }

class SyncStateJsonConverter extends JsonConverter<SyncState?, String?> {
const SyncStateJsonConverter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import '../../../../interfaces/repo/token_container_repository.dart';
import '../../../../l10n/app_localizations.dart';
import '../../../../model/api_results/pi_server_results/pi_server_result_value.dart';
import '../../../../model/enums/rollout_state.dart';
import '../../../../model/enums/sync_state.dart';
import '../../../../model/pi_server_response.dart';
import '../../../../model/riverpod_states/token_container_state.dart';
import '../../../../model/riverpod_states/token_state.dart';
Expand Down
Loading

0 comments on commit 082f0bc

Please sign in to comment.