Fix minor issues (#2426)

Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
Andrey Sobolev 2022-12-07 14:21:39 +07:00 committed by GitHub
parent 8436d226ea
commit 231f04f6a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 114 additions and 87 deletions

View File

@ -37,6 +37,7 @@
export let floatAside = false
export let allowClose = true
export let useMaxWidth = false
export let isFullSize = false
</script>
<Panel
@ -48,7 +49,8 @@
on:close
{allowClose}
{floatAside}
{useMaxWidth}
bind:useMaxWidth
{isFullSize}
>
<svelte:fragment slot="navigator">
{#if $$slots.navigator}

View File

@ -231,6 +231,11 @@ input.search {
.flex-gap-2 { gap: .5rem; }
.flex-gap-1 { gap: .25rem; }
.flex-break {
flex-basis: 100%;
height: 0;
}
.flex-presenter, .inline-presenter {
flex-wrap: nowrap;
cursor: pointer;

View File

@ -84,6 +84,7 @@
flex-direction: column;
margin: 0 1rem .75rem;
color: var(--theme-caption-color);
flex-wrap: wrap;
&__separator {
margin: 1rem 0;

View File

@ -36,21 +36,41 @@
const dispatch = createEventDispatcher()
let asideFloat: boolean = false
let asideShown: boolean = false
let fullSize: boolean = false
let asideShown: boolean = true
$: twoRows = $deviceInfo.minWidth
let oldWidth = ''
let hideTimer: number | undefined
const checkPanel = (): void => {
const k = `${panelWidth}-${asideFloat}`
if (oldWidth === k) {
return
}
oldWidth = k
if (floatAside) {
asideFloat = true
} else if (panelWidth <= 900 && !asideFloat) asideFloat = true
else if (panelWidth > 900 && asideFloat) {
asideFloat = false
asideShown = false
} else if (panelWidth <= 900 && !asideFloat) {
asideFloat = true
if (asideShown) {
asideShown = false
}
} else if (panelWidth > 900) {
if (asideFloat) {
asideFloat = false
}
if (!asideShown) {
asideShown = true
}
}
}
afterUpdate(() => {
checkPanel()
if (hideTimer) {
clearTimeout(hideTimer)
}
hideTimer = setTimeout(() => {
checkPanel()
}, 500)
})
</script>
@ -80,7 +100,7 @@
<div class="buttons-group xsmall-gap">
<slot name="utils" />
{#if isFullSize || (asideFloat && $$slots.aside && isAside)}<div class="buttons-divider" />{/if}
{#if asideFloat && $$slots.aside && isAside}
{#if $$slots.aside && isAside}
<Button
icon={IconDetails}
kind={'transparent'}
@ -93,12 +113,12 @@
{/if}
{#if isFullSize}
<Button
icon={fullSize ? IconScale : IconScaleFull}
icon={useMaxWidth ? IconScale : IconScaleFull}
kind={'transparent'}
size={'medium'}
selected={fullSize}
selected={useMaxWidth}
on:click={() => {
fullSize = !fullSize
useMaxWidth = !useMaxWidth
dispatch('fullsize')
}}
/>
@ -141,7 +161,7 @@
<slot />
</div>
{/if}
{#if $$slots.aside && isAside}
{#if $$slots.aside && isAside && asideShown}
<div class="popupPanel-body__aside" class:float={asideFloat} class:shown={asideShown}>
<slot name="aside" />
</div>

View File

@ -135,6 +135,7 @@
on:close={(ev) => _close(ev?.detail)}
on:fullsize={() => {
fullSize = !fullSize
fitPopup()
}}
on:changeContent={() => {
fitPopup()

View File

@ -380,7 +380,9 @@
isAside={true}
isSub={false}
bind:innerWidth
floatAside={true}
floatAside={false}
useMaxWidth={true}
isFullSize={true}
on:close={() => dispatch('close')}
>
<svelte:fragment slot="navigator">

View File

@ -512,30 +512,33 @@
}}
/>
{#if skills.length > 0}
<Component
is={tags.component.TagsEditor}
props={{
disabled: loading,
focusIndex: 102,
items: skills,
key,
targetClass: recruit.mixin.Candidate,
showTitle: false,
elements,
newElements,
countLabel: recruit.string.NumberSkills
}}
on:open={(evt) => {
addTagRef(evt.detail)
}}
on:delete={(evt) => {
skills = skills.filter((it) => it._id !== evt.detail)
}}
on:change={(evt) => {
evt.detail.tag.weight = evt.detail.weight
skills = skills
}}
/>
<div class="flex-break" />
<div class="antiComponent antiEmphasized flex-grow mt-2">
<Component
is={tags.component.TagsEditor}
props={{
disabled: loading,
focusIndex: 102,
items: skills,
key,
targetClass: recruit.mixin.Candidate,
showTitle: false,
elements,
newElements,
countLabel: recruit.string.NumberSkills
}}
on:open={(evt) => {
addTagRef(evt.detail)
}}
on:delete={(evt) => {
skills = skills.filter((it) => it._id !== evt.detail)
}}
on:change={(evt) => {
evt.detail.tag.weight = evt.detail.weight
skills = skills
}}
/>
</div>
{/if}
</svelte:fragment>

View File

@ -105,8 +105,14 @@
</div>
{/if}
<ShowMore ignore={!showTitle}>
<div class:tags-container={showTitle} class:mt-3={showTitle} class:empty={items.length === 0}>
<div class="tag-items-container" class:tag-items-scroll={!showTitle}>
<div
class:tags-container={showTitle}
class:antiComponent={showTitle}
class:antiEmphasized={showTitle}
class:mt-3={showTitle}
class:empty={items.length === 0}
>
<div class="flex flex-grow flex-col" class:tag-items-scroll={!showTitle}>
{#if items.length === 0}
{#if keyLabel}
<div class="text-sm dark-color w-full flex-center">
@ -120,7 +126,7 @@
<Label label={cat.label} />
</div>
{/if}
<div class="tag-items">
<div class="flex flex-grow flex-wrap">
{#each cat.items as tag}
<TagItem
{tag}
@ -154,26 +160,10 @@
<style lang="scss">
.tags-container {
padding: 0.5rem;
color: var(--accent-color);
background-color: var(--board-bg-color);
border: 1px solid var(--divider-color);
border-radius: 0.75rem;
&.empty {
background-color: transparent;
}
}
.tag-items-container {
flex-grow: 1;
display: flex;
flex-direction: column;
}
.tag-items {
flex-grow: 1;
display: flex;
flex-wrap: wrap;
}
.tag-items-scroll {
overflow-y: scroll;
max-height: 20rem;

View File

@ -692,18 +692,20 @@
<ParentIssue issue={parentIssue} on:close={clearParentIssue} />
{/if}
<EditBox bind:value={object.title} placeholder={tracker.string.IssueTitlePlaceholder} kind={'large-style'} focus />
<AttachmentStyledBox
bind:this={descriptionBox}
{objectId}
_class={tracker.class.Issue}
space={_space}
alwaysEdit
showButtons={false}
emphasized
bind:content={object.description}
placeholder={tracker.string.IssueDescriptionPlaceholder}
on:changeSize={() => dispatch('changeContent')}
/>
{#key objectId}
<AttachmentStyledBox
bind:this={descriptionBox}
{objectId}
_class={tracker.class.Issue}
space={_space}
alwaysEdit
showButtons={false}
emphasized
bind:content={object.description}
placeholder={tracker.string.IssueDescriptionPlaceholder}
on:changeSize={() => dispatch('changeContent')}
/>
{/key}
<IssueTemplateChilds bind:children={subIssues} sprint={object.sprint} project={object.project} isScrollable />
<svelte:fragment slot="pool">
{#if issueStatuses}

View File

@ -41,7 +41,7 @@
let labels: TagReference[] = []
let descriptionBox: AttachmentStyledBox
const objectId: Ref<Issue> = generateId()
let objectId: Ref<Issue> = generateId()
const key: KeyedAttribute = {
key: 'labels',
attr: client.getHierarchy().getAttribute(tracker.class.Issue, 'labels')
@ -73,6 +73,7 @@
newIssue = getIssueDefaults()
labels = []
focusIssueTitle?.()
objectId = generateId()
}
function getTitle (value: string) {
@ -191,19 +192,21 @@
focus
/>
<div class="mt-4">
<AttachmentStyledBox
bind:this={descriptionBox}
{objectId}
refContainer={thisRef}
_class={tracker.class.Issue}
space={currentTeam._id}
alwaysEdit
showButtons
maxHeight={'20vh'}
bind:content={newIssue.description}
placeholder={tracker.string.IssueDescriptionPlaceholder}
on:changeSize={() => dispatch('changeContent')}
/>
{#key objectId}
<AttachmentStyledBox
bind:this={descriptionBox}
{objectId}
refContainer={thisRef}
_class={tracker.class.Issue}
space={currentTeam._id}
alwaysEdit
showButtons
maxHeight={'20vh'}
bind:content={newIssue.description}
placeholder={tracker.string.IssueDescriptionPlaceholder}
on:changeSize={() => dispatch('changeContent')}
/>
{/key}
</div>
</div>
</div>

View File

@ -220,7 +220,7 @@
$: updateStatusCategories()
</script>
<Panel isHeader={false} isAside={false} isFullSize on:fullsize on:close={() => dispatch('close')}>
<Panel isHeader={false} isAside={false} on:fullsize on:close={() => dispatch('close')}>
<svelte:fragment slot="title">
<div class="antiTitle icon-wrapper">
<div class="wrapped-icon">

View File

@ -94,9 +94,7 @@
m.kind === ClassifierKind.MIXIN &&
!ignoreMixins.has(m._id) &&
(hierarchy.hasMixin(object, m._id) ||
(showAllMixins &&
// hierarchy.isDerived(hierarchy.getBaseClass(m._id), realObjectClass)
hierarchy.isDerived(realObjectClass, hierarchy.getBaseClass(m._id))))
(showAllMixins && hierarchy.isDerived(realObjectClass, hierarchy.getBaseClass(m._id))))
)
}