Skip to content

Commit

Permalink
Tweak default credentials dialog
Browse files Browse the repository at this point in the history
- Remove "Don't show on open" checkbox (now the checkbox "Don't show
again" is only visible when you click the app icon directly. Once you
enable it, there's no way to revert the setting)
- Add a note explaining that the user can access these credentials any
time in the future when they enable the checkbox
- Text tweak
  • Loading branch information
mayankchhabra authored and lukechilds committed Nov 25, 2024
1 parent 1dcfec6 commit 21b38c0
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 30 deletions.
2 changes: 1 addition & 1 deletion packages/ui/public/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"default-credentials.close": "Verstanden",
"default-credentials.description": "Hier sind die Anmeldeinformationen, die du benötigst, um dich bei der App anzumelden.",
"default-credentials.dont-show-again": "Nicht mehr anzeigen",
"default-credentials.dont-show-on-open": "Beim Öffnen nicht anzeigen",
"default-credentials.dont-show-again-notice": "Du kannst diese Anmeldedaten jederzeit zukünftig abrufen, indem du mit der rechten Maustaste auf das App-Symbol klickst.",
"default-credentials.open": "{{app}} öffnen",
"default-credentials.password": "Standardpasswort",
"default-credentials.title": "Anmeldeinformationen für {{app}}",
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/public/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@
"cpu-core-count": "{{cores}} threads",
"create-user": "Create user",
"default-credentials.close": "Got it",
"default-credentials.description": "Here are credentials you'll need to log into the app.",
"default-credentials.description": "Here are the default credentials you will need to log into the app.",
"default-credentials.dont-show-again": "Don't show this again",
"default-credentials.dont-show-on-open": "Don't show on open",
"default-credentials.dont-show-again-notice": "You can access these credentials at any time in the future by right-clicking on the app icon.",
"default-credentials.open": "Open {{app}}",
"default-credentials.password": "Default password",
"default-credentials.title": "Credentials for {{app}}",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/public/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"default-credentials.close": "Entendido",
"default-credentials.description": "Aquí tienes las credenciales que necesitarás para iniciar sesión en la aplicación.",
"default-credentials.dont-show-again": "No mostrar esto nuevamente",
"default-credentials.dont-show-on-open": "No mostrar al abrir",
"default-credentials.dont-show-again-notice": "Puedes acceder a estas credenciales en cualquier momento en el futuro haciendo clic derecho en el icono de la aplicación.",
"default-credentials.open": "Abrir {{app}}",
"default-credentials.password": "Contraseña por defecto",
"default-credentials.title": "Credenciales para {{app}}",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/public/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"default-credentials.close": "Compris",
"default-credentials.description": "Voici les identifiants dont vous aurez besoin pour vous connecter à l'application.",
"default-credentials.dont-show-again": "Ne plus afficher",
"default-credentials.dont-show-on-open": "Ne pas afficher à l'ouverture",
"default-credentials.dont-show-again-notice": "Vous pouvez accéder à ces identifiants à tout moment dans le futur en cliquant avec le bouton droit sur l'icône de l'application.",
"default-credentials.open": "Ouvrir {{app}}",
"default-credentials.password": "Mot de passe par défaut",
"default-credentials.title": "Identifiants pour {{app}}",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/public/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"default-credentials.close": "Rendben",
"default-credentials.description": "Itt találod a bejelentkezéshez szükséges hitelesítési adatokat.",
"default-credentials.dont-show-again": "Ne mutasd újra ezt",
"default-credentials.dont-show-on-open": "Ne mutassa meg nyitáskor",
"default-credentials.dont-show-again-notice": "A jövőben bármikor hozzáférhetsz ezekhez a hitelesítő adatokhoz az alkalmazás ikonra jobb egérgombbal kattintva.",
"default-credentials.open": "Nyisd meg a(z) {{app}} alkalmazást",
"default-credentials.password": "Alapértelmezett jelszó",
"default-credentials.title": "{{app}} hitelesítési adatai",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/public/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"default-credentials.close": "Capito",
"default-credentials.description": "Ecco le credenziali che ti serviranno per accedere all'app.",
"default-credentials.dont-show-again": "Non mostrare di nuovo",
"default-credentials.dont-show-on-open": "Non mostrare all'apertura",
"default-credentials.dont-show-again-notice": "Puoi accedere a queste credenziali in qualsiasi momento in futuro facendo clic con il tasto destro sull'icona dell'app.",
"default-credentials.open": "Apri {{app}}",
"default-credentials.password": "Password predefinita",
"default-credentials.title": "Credenziali per {{app}}",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/public/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"default-credentials.close": "了解",
"default-credentials.description": "アプリにログインするために必要な資格情報です。",
"default-credentials.dont-show-again": "これを再度表示しない",
"default-credentials.dont-show-on-open": "開いたときに表示しない",
"default-credentials.dont-show-again-notice": "将来いつでもアプリアイコンを右クリックすることで、これらの資格情報にアクセスできます。",
"default-credentials.open": "{{app}}を開く",
"default-credentials.password": "デフォルトパスワード",
"default-credentials.title": "{{app}}の資格情報",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/public/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"default-credentials.close": "Begrepen",
"default-credentials.description": "Hier zijn de inloggegevens die je nodig hebt om in te loggen op de app.",
"default-credentials.dont-show-again": "Niet meer tonen",
"default-credentials.dont-show-on-open": "Niet tonen bij openen",
"default-credentials.dont-show-again-notice": "Je kunt deze inloggegevens op elk moment in de toekomst inzien door met de rechtermuisknop op het app-pictogram te klikken.",
"default-credentials.open": "Open {{app}}",
"default-credentials.password": "Standaard wachtwoord",
"default-credentials.title": "Inloggegevens voor {{app}}",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/public/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"default-credentials.close": "Entendi",
"default-credentials.description": "Aqui estão as credenciais que você precisará para fazer login no aplicativo.",
"default-credentials.dont-show-again": "Não mostrar isso novamente",
"default-credentials.dont-show-on-open": "Não mostrar ao abrir",
"default-credentials.dont-show-again-notice": "Você pode acessar estas credenciais a qualquer momento no futuro clicando com o botão direito no ícone do app.",
"default-credentials.open": "Abrir {{app}}",
"default-credentials.password": "Senha padrão",
"default-credentials.title": "Credenciais para {{app}}",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/public/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"default-credentials.close": "Anladım",
"default-credentials.description": "Uygulamaya giriş yapmak için gerekli kimlik bilgileri burada.",
"default-credentials.dont-show-again": "Bunu bir daha gösterme",
"default-credentials.dont-show-on-open": "Açıldığında gösterme",
"default-credentials.dont-show-again-notice": "Bu kimlik bilgilerine gelecekte herhangi bir zamanda uygulama simgesine sağ tıklayarak erişebilirsiniz.",
"default-credentials.open": "{{app}}'i aç",
"default-credentials.password": "Varsayılan şifre",
"default-credentials.title": "{{app}} için kimlik bilgileri",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/public/locales/uk.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"default-credentials.close": "Зрозуміло",
"default-credentials.description": "Ось облікові дані, які вам знадобляться для входу в програму.",
"default-credentials.dont-show-again": "Більше не показувати це",
"default-credentials.dont-show-on-open": "Не показувати при відкритті",
"default-credentials.dont-show-again-notice": "Ви можете отримати доступ до цих облікових даних у будь-який час, натиснувши правою кнопкою миші на значок програми.",
"default-credentials.open": "Відкрити {{app}}",
"default-credentials.password": "Пароль за замовчуванням",
"default-credentials.title": "Облікові дані для {{app}}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,16 @@ export function DefaultCredentialsDialog() {
)}
<Separator />
<div className='flex items-center justify-between'>
<ShowCredentialsBeforeOpenCheckbox appId={appId} direct={direct} />
{direct && <ShowCredentialsBeforeOpenCheckbox appId={appId} />}
{direct ? (
<Button
variant='primary'
size='dialog'
className='w-auto'
onClick={() => launchApp(appId, {direct: true})}
onClick={() => {
launchApp(appId, {direct: true})
dialogProps.onOpenChange(false)
}}
>
{t('default-credentials.open', {app: appName})}
</Button>
Expand All @@ -103,7 +106,7 @@ export function DefaultCredentialsDialog() {
)
}

function ShowCredentialsBeforeOpenCheckbox({appId, direct}: {appId: string; direct: boolean}) {
function ShowCredentialsBeforeOpenCheckbox({appId}: {appId: string}) {
const checkboxId = useId()
const {app, isLoading} = useUserApp(appId)

Expand All @@ -120,23 +123,28 @@ function ShowCredentialsBeforeOpenCheckbox({appId, direct}: {appId: string; dire
}

return (
<div
className={cn(
checkboxContainerClass,
// prevent interaction when loading
(isLoading || hideCredentialsBeforeOpenMut.isLoading) && 'pointer-events-none',
<div className='flex flex-col'>
<div
className={cn(
checkboxContainerClass,
// prevent interaction when loading
(isLoading || hideCredentialsBeforeOpenMut.isLoading) && 'pointer-events-none',
)}
>
<Checkbox
id={checkboxId}
checked={!showCredentials}
onCheckedChange={(checked) => handleHideCredentialsBeforeOpenChange(!!checked)}
/>
<label htmlFor={checkboxId} className={cn(checkboxLabelClass, 'text-13')}>
{t('default-credentials.dont-show-again')}
</label>
</div>
{!showCredentials && (
<div className='pr-2 pt-2 text-xs text-white/40'>{t('default-credentials.dont-show-again-notice')}</div>
)}
>
<Checkbox
id={checkboxId}
checked={!showCredentials}
onCheckedChange={(checked) => handleHideCredentialsBeforeOpenChange(!!checked)}
/>
<label htmlFor={checkboxId} className={cn(checkboxLabelClass, 'text-13')}>
{direct ? t('default-credentials.dont-show-again') : t('default-credentials.dont-show-on-open')}
</label>
</div>
)
}

const textClass = tw`text-13 font-normal text-white/40`
const textClass = tw`text-13 font-normal text-white/40 block pb-1`

0 comments on commit 21b38c0

Please sign in to comment.