Skip to content

Commit

Permalink
TSK-1489: fixed Components, Milestones, IssueTemplates layout (#3220)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Platov <sas_lord@mail.ru>
  • Loading branch information
SasLord authored May 19, 2023
1 parent f9d2ce4 commit 2b329bd
Show file tree
Hide file tree
Showing 11 changed files with 119 additions and 48 deletions.
59 changes: 44 additions & 15 deletions models/tracker/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,14 +710,33 @@ export function createModel (builder: Builder): void {
{
key: '',
presenter: tracker.component.ComponentEditor,
props: { kind: 'list', size: 'small', shape: 'round', shouldShowPlaceholder: false }
props: {
kind: 'list',
size: 'small',
shouldShowPlaceholder: false,
listProps: { optional: true, compression: true }
}
},
{
key: '',
presenter: tracker.component.MilestoneEditor,
props: { kind: 'list', size: 'small', shape: 'round', shouldShowPlaceholder: false }
props: {
kind: 'list',
size: 'small',
shouldShowPlaceholder: false,
listProps: { optional: true, compression: true }
}
},
{
key: '',
presenter: tracker.component.TemplateEstimationEditor,
props: {
kind: 'list',
size: 'small',
listProps: { optional: true, compression: true }
}
},
{ key: '', presenter: tracker.component.TemplateEstimationEditor, props: { kind: 'list', size: 'small' } },
{ key: '', presenter: view.component.DividerPresenter, props: { type: 'divider' } },
{
key: 'modifiedOn',
presenter: tracker.component.ModificationDatePresenter,
Expand Down Expand Up @@ -1846,30 +1865,40 @@ export function createModel (builder: Builder): void {
descriptor: view.viewlet.List,
viewOptions: componentListViewOptions,
config: [
{ key: '', presenter: tracker.component.IconPresenter },
{ key: '', presenter: tracker.component.ComponentStatusPresenter, props: { kind: 'list', size: 'small' } },
{
key: '',
presenter: tracker.component.ComponentPresenter,
props: { kind: 'list', shouldShowAvatar: false }
props: { kind: 'list' }
},
{ key: '', presenter: view.component.GrowPresenter, props: { type: 'grow' } },
{
key: '$lookup.lead',
presenter: tracker.component.LeadPresenter,
props: { _class: tracker.class.Component, defaultClass: contact.class.Employee, shouldShowLabel: false }
},
{
key: '',
presenter: contact.component.MembersPresenter,
props: {
kind: 'link',
kind: 'list',
size: 'small',
intlTitle: tracker.string.ComponentMembersTitle,
intlSearchPh: tracker.string.ComponentMembersSearchPlaceholder
intlSearchPh: tracker.string.ComponentMembersSearchPlaceholder,
listProps: { optional: true, compression: true }
}
},
{ key: '', presenter: tracker.component.TargetDatePresenter },
{ key: '', presenter: tracker.component.ComponentStatusPresenter, props: { width: 'min-content' } },
{ key: '', presenter: tracker.component.DeleteComponentPresenter }
{
key: '',
presenter: tracker.component.TargetDatePresenter,
props: { listProps: { optional: true, compression: true } }
},
{ key: '', presenter: view.component.DividerPresenter, props: { type: 'divider' } },
{
key: '$lookup.lead',
presenter: tracker.component.LeadPresenter,
props: { _class: tracker.class.Component, defaultClass: contact.class.Employee, shouldShowLabel: false }
},
{
key: '',
presenter: tracker.component.DeleteComponentPresenter,
props: { kind: 'transparent', size: 'small' }
}
]
},
tracker.viewlet.ComponentList
Expand Down
14 changes: 11 additions & 3 deletions packages/theme/styles/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -741,10 +741,18 @@
.list-container .listitems-container,
.list-container .listitems-container:hover,
.list-container .button.list,
.list-container .button.list:hover {
.list-container .button.list:hover,
.list-container .datetime-button,
.list-container .datetime-button:hover {
background-color: var(--theme-list-button-color) !important;
.icon { color: var(--theme-halfcontent-color) !important; }
.label { color: var(--theme-halfcontent-color) !important; }
.icon {
margin-right: .5rem;
color: var(--theme-halfcontent-color) !important;
}
.label {
font-size: 0.8125rem !important;
color: var(--theme-halfcontent-color) !important;
}
}

/* Kanban - global style */
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/Button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
</div>
{/if}
{#if label}
<span class="overflow-label disabled pointer-events-none" class:ml-2={loading}>
<span class="overflow-label label disabled pointer-events-none" class:ml-2={loading}>
<Label {label} params={labelParams} />
</span>
{/if}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
export let intlTitle: IntlString
export let intlSearchPh: IntlString
export let retrieveMembers: (doc: Doc) => Ref<Employee>[]
export let shouldShowLabel: boolean = true
const client = getClient()
Expand Down Expand Up @@ -81,6 +82,8 @@
{size}
{width}
{justify}
label={shouldShowLabel ? contact.string.NumberMembers : undefined}
labelParams={shouldShowLabel ? { count: members.length } : {}}
title={buttonTitle}
icon={contact.icon.ComponentMembers}
on:click={handleMembersEditorOpened}
Expand Down
1 change: 0 additions & 1 deletion plugins/contact-resources/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export default mergeIds(contactId, contact, {
ViewFullProfile: '' as IntlString,
Member: '' as IntlString,
Members: '' as IntlString,
NumberMembers: '' as IntlString,
NoMembers: '' as IntlString,
AddMember: '' as IntlString,
KickEmployee: '' as IntlString,
Expand Down
1 change: 1 addition & 0 deletions plugins/contact/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ export const contactPlugin = plugin(contactId, {
PersonFirstNamePlaceholder: '' as IntlString,
PersonLastNamePlaceholder: '' as IntlString,
DisplayName: '' as IntlString,
NumberMembers: '' as IntlString,
Position: '' as IntlString
},
viewlet: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
-->
<script lang="ts">
import { ComponentStatus } from '@hcengineering/tracker'
import { Button, showPopup, SelectPopup, eventToHTMLElement } from '@hcengineering/ui'
import { Button, showPopup, SelectPopup, eventToHTMLElement, Icon } from '@hcengineering/ui'
import type { ButtonKind, ButtonSize, LabelAndProps } from '@hcengineering/ui'
import tracker from '../../plugin'
import { defaultComponentStatuses, componentStatusAssets } from '../../utils'
Expand Down Expand Up @@ -60,14 +60,24 @@
}
</script>

<Button
{kind}
{size}
{width}
{justify}
disabled={!isEditable}
icon={selectedStatusIcon}
label={selectedStatusLabel}
{showTooltip}
on:click={handleComponentStatusEditorOpened}
/>
{#if kind === 'list'}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class="flex-no-shrink clear-mins cursor-pointer content-pointer-events-none"
on:click={handleComponentStatusEditorOpened}
>
<Icon icon={selectedStatusIcon} {size} />
</div>
{:else}
<Button
{kind}
{size}
{width}
{justify}
disabled={!isEditable}
icon={selectedStatusIcon}
label={selectedStatusLabel}
{showTooltip}
on:click={handleComponentStatusEditorOpened}
/>
{/if}
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
-->
<script lang="ts">
import view from '@hcengineering/view'
import { Button, ButtonSize, LabelAndProps, showPopup } from '@hcengineering/ui'
import { Button, ButtonSize, ButtonKind, LabelAndProps, showPopup } from '@hcengineering/ui'
import { getClient, MessageBox } from '@hcengineering/presentation'
import type { Component } from '@hcengineering/tracker'
import { createEventDispatcher } from 'svelte'
import tracker from '../../plugin'
export let value: Component
export let kind: ButtonKind = 'secondary'
export let size: ButtonSize = 'medium'
export let justify: 'left' | 'center' = 'center'
export let width: string | undefined = 'min-content'
Expand Down Expand Up @@ -52,5 +53,13 @@
</script>

{#if value}
<Button {size} {width} {justify} {showTooltip} icon={view.icon.Delete} on:click={() => showConfirmationDialog()} />
<Button
{kind}
{size}
{width}
{justify}
{showTooltip}
icon={view.icon.Delete}
on:click={() => showConfirmationDialog()}
/>
{/if}
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<div class="ac-header__wrap-title mr-3">
<span class="ac-header__title"><Label {label} /></span>
<span class="componentTitle">
› <Label label={title} />
&nbsp;› <Label label={title} />
</span>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
import { getClient } from '@hcengineering/presentation'
import { Milestone } from '@hcengineering/tracker'
import { DatePresenter } from '@hcengineering/ui'
import { DatePresenter, ButtonSize } from '@hcengineering/ui'
export let value: Milestone
export let field = 'targetDate'
export let kind: 'transparent' | 'primary' | 'link' | 'list' = 'primary'
export let size: ButtonSize | 'x-small' = 'small'
const client = getClient()
Expand All @@ -44,5 +45,6 @@
shouldShowLabel={true}
icon={'normal'}
{kind}
{size}
on:change={handleDateChanged}
/>
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
-->
<script lang="ts">
import { MilestoneStatus } from '@hcengineering/tracker'
import { Button, showPopup, SelectPopup, eventToHTMLElement } from '@hcengineering/ui'
import { Button, showPopup, SelectPopup, eventToHTMLElement, Icon } from '@hcengineering/ui'
import type { ButtonKind, ButtonSize, LabelAndProps } from '@hcengineering/ui'
import tracker from '../../plugin'
import { defaultMilestoneStatuses, milestoneStatusAssets } from '../../utils'
Expand Down Expand Up @@ -60,14 +60,24 @@
}
</script>

<Button
{kind}
{size}
{width}
{justify}
disabled={!isEditable}
icon={selectedStatusIcon}
label={selectedStatusLabel}
{showTooltip}
on:click={handleMilestoneStatusEditorOpened}
/>
{#if kind === 'list'}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div
class="flex-no-shrink clear-mins cursor-pointer content-pointer-events-none"
on:click={handleMilestoneStatusEditorOpened}
>
<Icon icon={selectedStatusIcon} {size} />
</div>
{:else}
<Button
{kind}
{size}
{width}
{justify}
disabled={!isEditable}
icon={selectedStatusIcon}
label={selectedStatusLabel}
{showTooltip}
on:click={handleMilestoneStatusEditorOpened}
/>
{/if}

0 comments on commit 2b329bd

Please sign in to comment.