mirror of
https://github.com/hcengineering/platform.git
synced 2025-05-14 03:10:27 +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
|
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, {
|
builder.mixin(type, card.class.MasterTag, setting.mixin.Editable, {
|
||||||
value: false
|
value: false
|
||||||
})
|
})
|
||||||
@ -173,6 +156,23 @@ export function createSystemType (
|
|||||||
'modifiedOn'
|
'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 {
|
export function createModel (builder: Builder): void {
|
||||||
|
@ -19,13 +19,12 @@
|
|||||||
import { EditBox, Label, showPopup, eventToHTMLElement, Button } from '@hcengineering/ui'
|
import { EditBox, Label, showPopup, eventToHTMLElement, Button } from '@hcengineering/ui'
|
||||||
import EditBoxPopup from './EditBoxPopup.svelte'
|
import EditBoxPopup from './EditBoxPopup.svelte'
|
||||||
|
|
||||||
// export let label: IntlString
|
export let label: IntlString
|
||||||
export let placeholder: IntlString
|
|
||||||
export let value: number | undefined
|
export let value: number | undefined
|
||||||
export let autoFocus: boolean = false
|
export let autoFocus: boolean = false
|
||||||
// export let maxWidth: string = '10rem'
|
// export let maxWidth: string = '10rem'
|
||||||
export let onChange: (value: number | undefined) => void
|
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 readonly = false
|
||||||
export let size: ButtonSize = 'small'
|
export let size: ButtonSize = 'small'
|
||||||
export let justify: 'left' | 'center' = 'center'
|
export let justify: 'left' | 'center' = 'center'
|
||||||
@ -41,7 +40,7 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if kind === 'button' || kind === 'link'}
|
{#if kind === 'button' || kind === 'link' || kind === 'list'}
|
||||||
<Button
|
<Button
|
||||||
kind={kind === 'button' ? 'regular' : kind}
|
kind={kind === 'button' ? 'regular' : kind}
|
||||||
{size}
|
{size}
|
||||||
@ -49,7 +48,7 @@
|
|||||||
{width}
|
{width}
|
||||||
on:click={(ev) => {
|
on:click={(ev) => {
|
||||||
if (!shown && !readonly) {
|
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)) {
|
if (Number.isFinite(res)) {
|
||||||
value = res
|
value = res
|
||||||
onChange(value)
|
onChange(value)
|
||||||
@ -63,7 +62,7 @@
|
|||||||
{#if value != null}
|
{#if value != null}
|
||||||
<span class="caption-color overflow-label pointer-events-none">{value}</span>
|
<span class="caption-color overflow-label pointer-events-none">{value}</span>
|
||||||
{:else}
|
{: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}
|
{/if}
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</Button>
|
</Button>
|
||||||
@ -71,8 +70,8 @@
|
|||||||
{#if value != null}
|
{#if value != null}
|
||||||
<span class="caption-color overflow-label">{value}</span>
|
<span class="caption-color overflow-label">{value}</span>
|
||||||
{:else}
|
{:else}
|
||||||
<span class="content-dark-color"><Label label={placeholder} /></span>
|
<span class="content-dark-color"><Label {label} /></span>
|
||||||
{/if}
|
{/if}
|
||||||
{:else}
|
{:else}
|
||||||
<EditBox {placeholder} bind:value format={'number'} {autoFocus} on:change={_onchange} />
|
<EditBox placeholder={label} bind:value format={'number'} {autoFocus} on:change={_onchange} />
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -14,18 +14,18 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
-->
|
-->
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { IntlString } from '@hcengineering/platform'
|
||||||
import NumberEditor from './NumberEditor.svelte'
|
import NumberEditor from './NumberEditor.svelte'
|
||||||
import { getEmbeddedLabel, IntlString } from '@hcengineering/platform'
|
|
||||||
|
|
||||||
export let value: number | undefined
|
export let value: number | undefined
|
||||||
|
export let label: IntlString
|
||||||
export let onChange: ((value: number | undefined) => void) | undefined = undefined
|
export let onChange: ((value: number | undefined) => void) | undefined = undefined
|
||||||
export let placeholder: IntlString = getEmbeddedLabel(' ')
|
export let kind: 'no-border' | 'link' | 'button' | 'list' = 'link'
|
||||||
export let kind: 'no-border' | 'link' | 'button' = 'link'
|
|
||||||
export let readonly = false
|
export let readonly = false
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if onChange !== undefined && !readonly}
|
{#if onChange !== undefined && !readonly}
|
||||||
<NumberEditor {onChange} {value} {placeholder} {kind} />
|
<NumberEditor {onChange} {value} {label} {kind} />
|
||||||
{:else}
|
{:else}
|
||||||
<span>{value || ''}</span>
|
<span>{value || ''}</span>
|
||||||
{/if}
|
{/if}
|
||||||
|
@ -237,11 +237,13 @@
|
|||||||
processAttribute(attribute, result)
|
processAttribute(attribute, result)
|
||||||
}
|
}
|
||||||
|
|
||||||
hierarchy.getDescendants(viewlet.attachTo).forEach((it) => {
|
const desc = hierarchy.getDescendants(viewlet.attachTo)
|
||||||
hierarchy.getOwnAttributes(it).forEach((attr) => {
|
for (const d of desc) {
|
||||||
|
if (!hierarchy.isMixin(d)) continue
|
||||||
|
hierarchy.getOwnAttributes(d).forEach((attr) => {
|
||||||
processAttribute(attr, result, true)
|
processAttribute(attr, result, true)
|
||||||
})
|
})
|
||||||
})
|
}
|
||||||
|
|
||||||
const ancestors = new Set(hierarchy.getAncestors(viewlet.attachTo))
|
const ancestors = new Set(hierarchy.getAncestors(viewlet.attachTo))
|
||||||
const parent = hierarchy.getParentClass(viewlet.attachTo)
|
const parent = hierarchy.getParentClass(viewlet.attachTo)
|
||||||
|
Loading…
Reference in New Issue
Block a user