mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-11 18:01:59 +00:00
Fix cards view settings (#8437)
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / uitest-workspaces (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / uitest-workspaces (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
1f990867f5
commit
f26b1d3a12
@ -139,23 +139,6 @@ export function createSystemType (
|
||||
type
|
||||
)
|
||||
|
||||
builder.createDoc(view.class.Viewlet, core.space.Model, {
|
||||
attachTo: type,
|
||||
descriptor: view.viewlet.List,
|
||||
viewOptions: {
|
||||
groupBy: ['_class', 'createdBy', 'modifiedBy'],
|
||||
orderBy: [
|
||||
['modifiedOn', SortingOrder.Descending],
|
||||
['rank', SortingOrder.Ascending]
|
||||
],
|
||||
other: []
|
||||
},
|
||||
configOptions: {
|
||||
hiddenKeys: ['content', 'title']
|
||||
},
|
||||
config: listConfig
|
||||
})
|
||||
|
||||
builder.mixin(type, card.class.MasterTag, setting.mixin.Editable, {
|
||||
value: false
|
||||
})
|
||||
@ -173,6 +156,23 @@ export function createSystemType (
|
||||
'modifiedOn'
|
||||
]
|
||||
})
|
||||
|
||||
builder.createDoc(view.class.Viewlet, core.space.Model, {
|
||||
attachTo: type,
|
||||
descriptor: view.viewlet.List,
|
||||
viewOptions: {
|
||||
groupBy: ['_class', 'createdBy', 'modifiedBy'],
|
||||
orderBy: [
|
||||
['modifiedOn', SortingOrder.Descending],
|
||||
['rank', SortingOrder.Ascending]
|
||||
],
|
||||
other: []
|
||||
},
|
||||
configOptions: {
|
||||
hiddenKeys: ['content', 'title']
|
||||
},
|
||||
config: listConfig
|
||||
})
|
||||
}
|
||||
|
||||
export function createModel (builder: Builder): void {
|
||||
|
@ -19,13 +19,12 @@
|
||||
import { EditBox, Label, showPopup, eventToHTMLElement, Button } from '@hcengineering/ui'
|
||||
import EditBoxPopup from './EditBoxPopup.svelte'
|
||||
|
||||
// export let label: IntlString
|
||||
export let placeholder: IntlString
|
||||
export let label: IntlString
|
||||
export let value: number | undefined
|
||||
export let autoFocus: boolean = false
|
||||
// export let maxWidth: string = '10rem'
|
||||
export let onChange: (value: number | undefined) => void
|
||||
export let kind: 'no-border' | 'link' | 'button' = 'no-border'
|
||||
export let kind: 'no-border' | 'link' | 'button' | 'list' = 'no-border'
|
||||
export let readonly = false
|
||||
export let size: ButtonSize = 'small'
|
||||
export let justify: 'left' | 'center' = 'center'
|
||||
@ -41,7 +40,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if kind === 'button' || kind === 'link'}
|
||||
{#if kind === 'button' || kind === 'link' || kind === 'list'}
|
||||
<Button
|
||||
kind={kind === 'button' ? 'regular' : kind}
|
||||
{size}
|
||||
@ -49,7 +48,7 @@
|
||||
{width}
|
||||
on:click={(ev) => {
|
||||
if (!shown && !readonly) {
|
||||
showPopup(EditBoxPopup, { value, format: 'number' }, eventToHTMLElement(ev), (res) => {
|
||||
showPopup(EditBoxPopup, { value, placeholder: label, format: 'number' }, eventToHTMLElement(ev), (res) => {
|
||||
if (Number.isFinite(res)) {
|
||||
value = res
|
||||
onChange(value)
|
||||
@ -63,7 +62,7 @@
|
||||
{#if value != null}
|
||||
<span class="caption-color overflow-label pointer-events-none">{value}</span>
|
||||
{:else}
|
||||
<span class="content-dark-color pointer-events-none"><Label label={placeholder} /></span>
|
||||
<span class="content-dark-color pointer-events-none"><Label {label} /></span>
|
||||
{/if}
|
||||
</svelte:fragment>
|
||||
</Button>
|
||||
@ -71,8 +70,8 @@
|
||||
{#if value != null}
|
||||
<span class="caption-color overflow-label">{value}</span>
|
||||
{:else}
|
||||
<span class="content-dark-color"><Label label={placeholder} /></span>
|
||||
<span class="content-dark-color"><Label {label} /></span>
|
||||
{/if}
|
||||
{:else}
|
||||
<EditBox {placeholder} bind:value format={'number'} {autoFocus} on:change={_onchange} />
|
||||
<EditBox placeholder={label} bind:value format={'number'} {autoFocus} on:change={_onchange} />
|
||||
{/if}
|
||||
|
@ -14,18 +14,18 @@
|
||||
// limitations under the License.
|
||||
-->
|
||||
<script lang="ts">
|
||||
import { IntlString } from '@hcengineering/platform'
|
||||
import NumberEditor from './NumberEditor.svelte'
|
||||
import { getEmbeddedLabel, IntlString } from '@hcengineering/platform'
|
||||
|
||||
export let value: number | undefined
|
||||
export let label: IntlString
|
||||
export let onChange: ((value: number | undefined) => void) | undefined = undefined
|
||||
export let placeholder: IntlString = getEmbeddedLabel(' ')
|
||||
export let kind: 'no-border' | 'link' | 'button' = 'link'
|
||||
export let kind: 'no-border' | 'link' | 'button' | 'list' = 'link'
|
||||
export let readonly = false
|
||||
</script>
|
||||
|
||||
{#if onChange !== undefined && !readonly}
|
||||
<NumberEditor {onChange} {value} {placeholder} {kind} />
|
||||
<NumberEditor {onChange} {value} {label} {kind} />
|
||||
{:else}
|
||||
<span>{value || ''}</span>
|
||||
{/if}
|
||||
|
@ -237,11 +237,13 @@
|
||||
processAttribute(attribute, result)
|
||||
}
|
||||
|
||||
hierarchy.getDescendants(viewlet.attachTo).forEach((it) => {
|
||||
hierarchy.getOwnAttributes(it).forEach((attr) => {
|
||||
const desc = hierarchy.getDescendants(viewlet.attachTo)
|
||||
for (const d of desc) {
|
||||
if (!hierarchy.isMixin(d)) continue
|
||||
hierarchy.getOwnAttributes(d).forEach((attr) => {
|
||||
processAttribute(attr, result, true)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const ancestors = new Set(hierarchy.getAncestors(viewlet.attachTo))
|
||||
const parent = hierarchy.getParentClass(viewlet.attachTo)
|
||||
|
Loading…
Reference in New Issue
Block a user