Add titles for IconButtons (#1245)

This commit is contained in:
Lukas 2022-10-08 19:06:53 +02:00 committed by GitHub
parent c7fd1eb9d4
commit 9871b3cc8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 68 additions and 14 deletions

View file

@ -9,6 +9,9 @@
"username": "Username", "username": "Username",
"password": "Password", "password": "Password",
"url": "URL", "url": "URL",
"back": "Back",
"color_scheme_light": "Switch between dark and light mode (currently light mode)",
"color_scheme_dark": "Switch between dark and light mode (currently dark mode)",
"unknown_error": "An unknown error occurred", "unknown_error": "An unknown error occurred",
"not_found": { "not_found": {
"not_found": "Whoa 404, either we broke something or you had a typing mishap :-/", "not_found": "Whoa 404, either we broke something or you had a typing mishap :-/",
@ -116,7 +119,9 @@
"events": { "events": {
"events": "Available at following events", "events": "Available at following events",
"pr_warning": "Please be careful with this option as a bad actor can submit a malicious pull request that exposes your secrets." "pr_warning": "Please be careful with this option as a bad actor can submit a malicious pull request that exposes your secrets."
} },
"edit": "Edit secret",
"delete":"Delete secret"
}, },
"registries": { "registries": {
"registries": "Registries", "registries": "Registries",
@ -132,7 +137,9 @@
"address": { "address": {
"address": "Address", "address": "Address",
"placeholder": "Registry Address (e.g. docker.io)" "placeholder": "Registry Address (e.g. docker.io)"
} },
"edit": "Edit registry",
"delete":"Delete registry"
}, },
"crons": { "crons": {
"crons": "Crons", "crons": "Crons",
@ -157,7 +164,9 @@
"schedule": { "schedule": {
"title": "Schedule (based on UTC)", "title": "Schedule (based on UTC)",
"placeholder": "Schedule" "placeholder": "Schedule"
} },
"edit": "Edit cron",
"delete": "Delete cron"
}, },
"badge": { "badge": {
"badge": "Badge", "badge": "Badge",

View file

@ -3,6 +3,8 @@
:disabled="disabled" :disabled="disabled"
class="relative flex items-center justify-center text-color px-1 py-1 rounded-full bg-transparent hover:bg-gray-200 hover:text-gray-700 dark:hover:bg-gray-600 dark:hover:text-gray-700 cursor-pointer transition-all duration-150 focus:outline-none overflow-hidden disabled:opacity-50 disabled:cursor-not-allowed" class="relative flex items-center justify-center text-color px-1 py-1 rounded-full bg-transparent hover:bg-gray-200 hover:text-gray-700 dark:hover:bg-gray-600 dark:hover:text-gray-700 cursor-pointer transition-all duration-150 focus:outline-none overflow-hidden disabled:opacity-50 disabled:cursor-not-allowed"
type="button" type="button"
:title="title"
:aria-label="title"
@click="doClick" @click="doClick"
> >
<Icon :name="icon" /> <Icon :name="icon" />
@ -48,6 +50,11 @@ export default defineComponent({
isLoading: { isLoading: {
type: Boolean, type: Boolean,
}, },
title: {
type: String,
required: true,
},
}, },
setup(props) { setup(props) {

View file

@ -22,6 +22,7 @@
<IconButton <IconButton
:icon="darkMode ? 'dark' : 'light'" :icon="darkMode ? 'dark' : 'light'"
class="!text-white !dark:text-gray-500 navbar-icon" class="!text-white !dark:text-gray-500 navbar-icon"
:title="darkMode ? $t('color_scheme_dark') : $t('color_scheme_light')"
@click="darkMode = !darkMode" @click="darkMode = !darkMode"
/> />
<!-- Admin Settings --> <!-- Admin Settings -->
@ -29,6 +30,7 @@
v-if="user?.admin" v-if="user?.admin"
icon="settings" icon="settings"
class="!text-white !dark:text-gray-500 navbar-icon" class="!text-white !dark:text-gray-500 navbar-icon"
:title="$t('admin.settings.settings')"
:to="{ name: 'admin-settings' }" :to="{ name: 'admin-settings' }"
/> />
<!-- Active Builds Indicator --> <!-- Active Builds Indicator -->

View file

@ -31,11 +31,17 @@
{{ $t('repo.settings.crons.next_exec') }}: {{ date.toLocaleString(new Date(cron.next_exec * 1000)) }}</span {{ $t('repo.settings.crons.next_exec') }}: {{ date.toLocaleString(new Date(cron.next_exec * 1000)) }}</span
> >
<span v-else class="ml-auto">{{ $t('repo.settings.crons.not_executed_yet') }}</span> <span v-else class="ml-auto">{{ $t('repo.settings.crons.not_executed_yet') }}</span>
<IconButton icon="edit" class="ml-auto w-8 h-8" @click="selectedCron = cron" /> <IconButton
icon="edit"
class="ml-auto w-8 h-8"
:title="$t('repo.settings.crons.edit')"
@click="selectedCron = cron"
/>
<IconButton <IconButton
icon="trash" icon="trash"
class="w-8 h-8 hover:text-red-400 hover:dark:text-red-500" class="w-8 h-8 hover:text-red-400 hover:dark:text-red-500"
:is-loading="isDeleting" :is-loading="isDeleting"
:title="$t('repo.settings.crons.delete')"
@click="deleteCron(cron)" @click="deleteCron(cron)"
/> />
</ListItem> </ListItem>

View file

@ -27,11 +27,17 @@
<div v-if="!selectedRegistry" class="space-y-4 text-color"> <div v-if="!selectedRegistry" class="space-y-4 text-color">
<ListItem v-for="registry in registries" :key="registry.id" class="items-center"> <ListItem v-for="registry in registries" :key="registry.id" class="items-center">
<span>{{ registry.address }}</span> <span>{{ registry.address }}</span>
<IconButton icon="edit" class="ml-auto w-8 h-8" @click="selectedRegistry = registry" /> <IconButton
icon="edit"
class="ml-auto w-8 h-8"
:title="$t('repo.settings.registries.edit')"
@click="selectedRegistry = registry"
/>
<IconButton <IconButton
icon="trash" icon="trash"
class="w-8 h-8 hover:text-red-400 hover:dark:text-red-500" class="w-8 h-8 hover:text-red-400 hover:dark:text-red-500"
:is-loading="isDeleting" :is-loading="isDeleting"
:title="$t('repo.settings.registries.delete')"
@click="deleteRegistry(registry)" @click="deleteRegistry(registry)"
/> />
</ListItem> </ListItem>

View file

@ -11,11 +11,17 @@
{{ event }} {{ event }}
</span> </span>
</div> </div>
<IconButton icon="edit" class="ml-2 w-8 h-8" @click="editSecret(secret)" /> <IconButton
icon="edit"
class="ml-2 w-8 h-8"
:title="$t('repo.settings.secrets.edit')"
@click="editSecret(secret)"
/>
<IconButton <IconButton
icon="trash" icon="trash"
class="ml-2 w-8 h-8 hover:text-red-400 hover:dark:text-red-500" class="ml-2 w-8 h-8 hover:text-red-400 hover:dark:text-red-500"
:is-loading="isDeleting" :is-loading="isDeleting"
:title="$t('repo.settings.secrets.delete')"
@click="deleteSecret(secret)" @click="deleteSecret(secret)"
/> />
</ListItem> </ListItem>

View file

@ -1,7 +1,7 @@
<template> <template>
<FluidContainer class="flex flex-col"> <FluidContainer class="flex flex-col">
<div class="flex flex-row border-b mb-4 pb-4 items-center dark:border-dark-200"> <div class="flex flex-row border-b mb-4 pb-4 items-center dark:border-dark-200">
<IconButton :to="{ name: 'repos' }" icon="back" /> <IconButton :to="{ name: 'repos' }" :title="$t('back')" icon="back" />
<h1 class="text-xl ml-2 text-color">{{ $t('repo.add') }}</h1> <h1 class="text-xl ml-2 text-color">{{ $t('repo.add') }}</h1>
<TextField v-model="search" class="w-auto ml-auto" :placeholder="$t('search')" /> <TextField v-model="search" class="w-auto ml-auto" :placeholder="$t('search')" />
<Button <Button

View file

@ -3,7 +3,13 @@
<div class="flex flex-row flex-wrap md:grid md:grid-cols-3 border-b pb-4 mb-4 dark:border-dark-200"> <div class="flex flex-row flex-wrap md:grid md:grid-cols-3 border-b pb-4 mb-4 dark:border-dark-200">
<h1 class="text-xl text-color">{{ repoOwner }}</h1> <h1 class="text-xl text-color">{{ repoOwner }}</h1>
<TextField v-model="search" class="w-auto md:ml-auto md:mr-auto" :placeholder="$t('search')" /> <TextField v-model="search" class="w-auto md:ml-auto md:mr-auto" :placeholder="$t('search')" />
<IconButton v-if="orgPermissions.admin" icon="settings" :to="{ name: 'org-settings' }" class="ml-auto" /> <IconButton
v-if="orgPermissions.admin"
icon="settings"
:to="{ name: 'org-settings' }"
:title="$t('org.settings.settings')"
class="ml-auto"
/>
</div> </div>
<div class="space-y-4"> <div class="space-y-4">

View file

@ -1,7 +1,7 @@
<template> <template>
<FluidContainer> <FluidContainer>
<div class="flex border-b items-center pb-4 mb-4 dark:border-gray-600"> <div class="flex border-b items-center pb-4 mb-4 dark:border-gray-600">
<IconButton icon="back" @click="goBack" /> <IconButton icon="back" :title="$t('back')" @click="goBack" />
<h1 class="text-xl ml-2 text-color">{{ $t('admin.settings.settings') }}</h1> <h1 class="text-xl ml-2 text-color">{{ $t('admin.settings.settings') }}</h1>
</div> </div>

View file

@ -1,7 +1,7 @@
<template> <template>
<FluidContainer> <FluidContainer>
<div class="flex border-b items-center pb-4 mb-4 dark:border-gray-600"> <div class="flex border-b items-center pb-4 mb-4 dark:border-gray-600">
<IconButton icon="back" @click="goBack" /> <IconButton icon="back" :title="$t('back')" @click="goBack" />
<h1 class="text-xl ml-2 text-color">{{ $t('org.settings.settings') }}</h1> <h1 class="text-xl ml-2 text-color">{{ $t('org.settings.settings') }}</h1>
</div> </div>

View file

@ -4,7 +4,13 @@
<h1 class="text-xl text-color w-full md:w-auto text-center mb-4 md:mb-0"> <h1 class="text-xl text-color w-full md:w-auto text-center mb-4 md:mb-0">
{{ org.name }} {{ org.name }}
</h1> </h1>
<IconButton v-if="orgPermissions.admin" class="ml-2" :to="{ name: 'repo-settings' }" icon="settings" /> <IconButton
v-if="orgPermissions.admin"
class="ml-2"
:to="{ name: 'repo-settings' }"
:title="$t('org.settings.settings')"
icon="settings"
/>
</div> </div>
<router-view /> <router-view />

View file

@ -1,7 +1,7 @@
<template> <template>
<FluidContainer> <FluidContainer>
<div class="flex border-b items-center pb-4 mb-4 dark:border-gray-600"> <div class="flex border-b items-center pb-4 mb-4 dark:border-gray-600">
<IconButton icon="back" @click="goBack" /> <IconButton icon="back" :title="$t('back')" @click="goBack" />
<h1 class="text-xl ml-2 text-color">{{ $t('repo.settings.settings') }}</h1> <h1 class="text-xl ml-2 text-color">{{ $t('repo.settings.settings') }}</h1>
</div> </div>

View file

@ -21,7 +21,13 @@
<Icon v-else-if="forge === 'bitbucket' || forge === 'stash'" name="bitbucket" /> <Icon v-else-if="forge === 'bitbucket' || forge === 'stash'" name="bitbucket" />
<Icon v-else name="repo" /> <Icon v-else name="repo" />
</a> </a>
<IconButton v-if="repoPermissions.admin" class="ml-2" :to="{ name: 'repo-settings' }" icon="settings" /> <IconButton
v-if="repoPermissions.admin"
class="ml-2"
:to="{ name: 'repo-settings' }"
:title="$t('repo.settings.settings')"
icon="settings"
/>
</div> </div>
<div class="flex flex-wrap gap-y-2 items-center justify-between"> <div class="flex flex-wrap gap-y-2 items-center justify-between">
<Tabs v-model="activeTab" disable-hash-mode class="mb-4"> <Tabs v-model="activeTab" disable-hash-mode class="mb-4">

View file

@ -2,7 +2,7 @@
<template v-if="build && repo"> <template v-if="build && repo">
<FluidContainer class="flex flex-col min-w-0 dark:border-gray-600"> <FluidContainer class="flex flex-col min-w-0 dark:border-gray-600">
<div class="flex mb-2 items-center <md:flex-wrap"> <div class="flex mb-2 items-center <md:flex-wrap">
<IconButton icon="back" class="flex-shrink-0" @click="goBack" /> <IconButton icon="back" :title="$t('back')" class="flex-shrink-0" @click="goBack" />
<h1 <h1
class="order-3 w-full <md:flex-wrap md:order-none md:w-auto md:ml-2 flex text-center text-xl text-color whitespace-nowrap overflow-hidden overflow-ellipsis" class="order-3 w-full <md:flex-wrap md:order-none md:w-auto md:ml-2 flex text-center text-xl text-color whitespace-nowrap overflow-hidden overflow-ellipsis"