Skip to content

Commit

Permalink
conditional tooltip & label for missing permission
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Oct 17, 2024
1 parent 460b3fa commit f9eda5c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/components/VaultList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

<Menu as="div" class="relative inline-block text-left">
<div>
<MenuButton :disabled="isLicenseViolated || !canCreateVaults" class="inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-primary hover:bg-primary-d1 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary disabled:cursor-not-allowed disabled:opacity-50">
<MenuButton :disabled="isLicenseViolated || !canCreateVaults" class="inline-flex items-center px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-primary hover:bg-primary-d1 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary disabled:cursor-not-allowed disabled:opacity-50" :title="isLicenseViolated ? t('vaultList.addVault.disabled.licenseViolation') : canCreateVaults ? undefined : t('vaultList.addVault.disabled.missingPermission')">
{{ t('vaultList.addVault') }}
<ChevronDownIcon class="-mr-1 ml-2 h-5 w-5" aria-hidden="true" />
</MenuButton>
Expand Down Expand Up @@ -98,7 +98,7 @@
<path vector-effect="non-scaling-stroke" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 10.5v6m3-3H9m4.06-7.19l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z" />
</svg>
<h3 class="mt-2 text-sm font-medium text-gray-900">{{ t('vaultList.empty.title') }}</h3>
<p class="mt-1 text-sm text-gray-500">{{ t('vaultList.empty.description') }}</p>
<p v-if="canCreateVaults" class="mt-1 text-sm text-gray-500">{{ t('vaultList.empty.description') }}</p>
</div>
<div v-else-if="query !== '' && filteredVaults != null && filteredVaults.length == 0" class="mt-3 text-center">
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/i18n/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@
"vaultList.empty.title": "Keine Tresore",
"vaultList.empty.description": "Beginne mit der Erstellung eines neuen Tresors.",
"vaultList.addVault": "Hinzufügen",
"vaultList.addVault.disabled.licenseViolation": "Lizenz überschritten.",
"vaultList.addVault.disabled.missingPermission": "Die fehlt die Berechtigung zur Erstellung von Tresoren.",
"vaultList.addVault.create": "Neu erstellen",
"vaultList.addVault.recover": "Wiederherstellen",
"vaultList.filter": "Filter",
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/i18n/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@
"vaultList.empty.title": "No vaults",
"vaultList.empty.description": "Get started by creating a new vault.",
"vaultList.addVault": "Add",
"vaultList.addVault.disabled.licenseViolation": "License limit exceeded.",
"vaultList.addVault.disabled.missingPermission": "You don't have permission to create a vault.",
"vaultList.addVault.create": "Create New",
"vaultList.addVault.recover": "Recover Existing",
"vaultList.filter": "Filter",
Expand Down

0 comments on commit f9eda5c

Please sign in to comment.