Skip to content

Commit

Permalink
fix: more tooltips (#6767)
Browse files Browse the repository at this point in the history
  • Loading branch information
aonnikov authored Sep 30, 2024
1 parent 6b68b7f commit 9fac238
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 11 deletions.
5 changes: 4 additions & 1 deletion packages/ui/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
"Selected": "Selected:",
"Submit": "Submit",
"NextStep": "Next step",
"TypeHere": "Type here..."
"TypeHere": "Type here...",
"FullSize": "Full size",
"UseMaxWidth": "Max width",
"Sidebar": "Sidebar"
}
}
5 changes: 4 additions & 1 deletion packages/ui/lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
"Selected": "Seleccionado:",
"Submit": "Enviar",
"NextStep": "Siguiente paso",
"TypeHere": "Escribe aquí..."
"TypeHere": "Escribe aquí...",
"FullSize": "Tamaño completo",
"UseMaxWidth": "Ancho máximo",
"Sidebar": "Barra lateral"
}
}
5 changes: 4 additions & 1 deletion packages/ui/lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
"Selected": "Sélectionné :",
"Submit": "Soumettre",
"NextStep": "Étape suivante",
"TypeHere": "Tapez ici..."
"TypeHere": "Tapez ici...",
"FullSize": "Taille réelle",
"UseMaxWidth": "Largeur maximale",
"Sidebar": "Barre latérale"
}
}
5 changes: 4 additions & 1 deletion packages/ui/lang/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
"Selected": "Selecionado:",
"Submit": "Enviar",
"NextStep": "Seguinte passo",
"TypeHere": "Escreva aqui..."
"TypeHere": "Escreva aqui...",
"FullSize": "Tamanho completo",
"UseMaxWidth": "Largura máxima",
"Sidebar": "Barra lateral"
}
}
5 changes: 4 additions & 1 deletion packages/ui/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
"Selected": "Выбрано:",
"Submit": "Отправить",
"NextStep": "Следующий шаг",
"TypeHere": "Вводите здесь..."
"TypeHere": "Вводите здесь...",
"FullSize": "Полный размер",
"UseMaxWidth": "Максимальная ширина",
"Sidebar": "Боковая панель"
}
}
5 changes: 4 additions & 1 deletion packages/ui/lang/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
"Selected": "已选:",
"Submit": "提交",
"NextStep": "下一步",
"TypeHere": "在此输入..."
"TypeHere": "在此输入...",
"FullSize": "全尺寸",
"UseMaxWidth": "使用最大宽度",
"Sidebar": "侧边栏"
}
}
5 changes: 5 additions & 0 deletions packages/ui/src/components/Panel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import IconScale from './icons/Scale.svelte'
import IconScaleFull from './icons/ScaleFull.svelte'
import plugin from '../plugin'
export let innerWidth: number = 0
export let panelWidth: number = 0
export let isHeader: boolean = true
Expand Down Expand Up @@ -209,6 +211,7 @@
iconProps={{ size: 'medium' }}
kind={'icon'}
selected={useMaxWidth}
showTooltip={{ label: plugin.string.UseMaxWidth, direction: 'bottom' }}
on:click={() => {
useMaxWidth = !useMaxWidth
dispatch('maxWidth', useMaxWidth)
Expand All @@ -222,6 +225,7 @@
iconProps={{ size: 'medium' }}
kind={'icon'}
selected={fullSize}
showTooltip={{ label: plugin.string.FullSize, direction: 'bottom' }}
on:click={() => {
fullSize = !fullSize
dispatch('fullsize')
Expand All @@ -244,6 +248,7 @@
iconProps={{ size: 'medium', filled: asideShown }}
kind={'icon'}
selected={asideShown}
showTooltip={{ label: plugin.string.Sidebar, direction: 'bottom' }}
on:click={handleAside}
/>
{/if}
Expand Down
6 changes: 5 additions & 1 deletion packages/ui/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ export const uis = plugin(uiId, {
Selected: '' as IntlString,
Submit: '' as IntlString,
NextStep: '' as IntlString,
TypeHere: '' as IntlString
TypeHere: '' as IntlString,

FullSize: '' as IntlString,
UseMaxWidth: '' as IntlString,
Sidebar: '' as IntlString
},
metadata: {
DefaultApplication: '' as Metadata<AnyComponent>,
Expand Down
8 changes: 6 additions & 2 deletions plugins/document-resources/src/components/EditDoc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,13 @@
const aside: ButtonItem[] = [
{
id: 'references',
icon: document.icon.References
icon: document.icon.References,
showTooltip: { label: document.string.Backlinks, direction: 'bottom' }
},
{
id: 'activity',
icon: activity.icon.Activity
icon: activity.icon.Activity,
showTooltip: { label: activity.string.Activity, direction: 'bottom' }
}
]
let selectedAside: string | boolean = false
Expand Down Expand Up @@ -282,6 +284,7 @@
icon={IconMoreH}
iconProps={{ size: 'medium' }}
kind={'icon'}
showTooltip={{ label: view.string.MoreActions, direction: 'bottom' }}
on:click={showContextMenu}
/>
{#each actions as action}
Expand Down Expand Up @@ -311,6 +314,7 @@
fill: doc.color !== undefined ? getPlatformColorDef(doc.color, $themeStore.dark).icon : 'currentColor'
}}
disabled={readonly}
showTooltip={{ label: document.string.Icon, direction: 'bottom' }}
on:click={chooseIcon}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import type { Action, AnySvelteComponent } from '@hcengineering/ui'
import { IconMoreH, Menu, navigate, showPopup, NavItem, ButtonIcon } from '@hcengineering/ui'
import { getDocumentLink } from '../../utils'
import view from '@hcengineering/view'
export let doc: Document
export let icon: Asset | AnySvelteComponent | undefined = undefined
Expand Down Expand Up @@ -87,6 +88,7 @@
size={'extra-small'}
pressed={hovered}
dataId={'btnDocMore'}
tooltip={{ label: view.string.MoreActions, direction: 'top' }}
on:click={onMenuClick}
/>
</svelte:fragment>
Expand Down
3 changes: 2 additions & 1 deletion plugins/drive-resources/src/components/FolderBrowser.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import { type Doc, type DocumentQuery, type Ref, type WithLookup } from '@hcengineering/core'
import drive, { type Drive, type Folder } from '@hcengineering/drive'
import { Scroller, SearchInput, Panel, Button, IconMoreH } from '@hcengineering/ui'
import { Viewlet, ViewOptions } from '@hcengineering/view'
import view, { Viewlet, ViewOptions } from '@hcengineering/view'
import {
FilterBar,
FilterButton,
Expand Down Expand Up @@ -83,6 +83,7 @@
icon={IconMoreH}
iconProps={{ size: 'medium' }}
kind={'icon'}
showTooltip={{ label: view.string.MoreActions, direction: 'bottom' }}
on:click={(ev) => {
showMenu(ev, { object })
}}
Expand Down
2 changes: 2 additions & 0 deletions plugins/drive-resources/src/components/GridItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import { type Resource } from '@hcengineering/drive'
import { getClient } from '@hcengineering/presentation'
import { Button, IconMoreH } from '@hcengineering/ui'
import view from '@hcengineering/view'
import { ObjectPresenter, TimestampPresenter, openDoc, showMenu } from '@hcengineering/view-resources'
import { createEventDispatcher } from 'svelte'
Expand Down Expand Up @@ -71,6 +72,7 @@
icon={IconMoreH}
kind="ghost"
size="medium"
showTooltip={{ label: view.string.MoreActions, direction: 'bottom' }}
on:click={(evt) => {
hovered = true
showMenu(evt, { object }, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
NavGroup,
ButtonIcon
} from '@hcengineering/ui'
import view from '@hcengineering/view'
export let _id: Ref<Doc> | string | undefined = undefined
export let icon: Asset | AnySvelteComponent | undefined = undefined
Expand Down Expand Up @@ -115,6 +116,7 @@
icon={action.icon ?? ActionIcon}
size={'extra-small'}
kind={'tertiary'}
tooltip={{ label: action.label, direction: 'top' }}
on:click={(ev) => onInlineClick(ev, action)}
/>
{/each}
Expand All @@ -131,7 +133,14 @@
}}
/>
{:else if popupMenuActions.length > 0}
<ButtonIcon icon={IconMoreH} size={'extra-small'} kind={'tertiary'} {pressed} on:click={onMenuClick} />
<ButtonIcon
icon={IconMoreH}
size={'extra-small'}
kind={'tertiary'}
tooltip={{ label: view.string.MoreActions, direction: 'top' }}
{pressed}
on:click={onMenuClick}
/>
{/if}
</svelte:fragment>
<svelte:fragment slot="visible"><slot name="visible" /></svelte:fragment>
Expand Down Expand Up @@ -170,6 +179,7 @@
icon={action.icon ?? ActionIcon}
size={'extra-small'}
kind={'tertiary'}
tooltip={{ label: action.label, direction: 'bottom' }}
on:click={(ev) => onInlineClick(ev, action)}
/>
{/each}
Expand Down

0 comments on commit 9fac238

Please sign in to comment.