Update DatePicker. Add and update presenters. Fix Activity layout. (#1162)

Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
Alexander Platov
2022-03-18 11:58:10 +07:00
committed by GitHub
parent 773022cfae
commit 92c9732b52
28 changed files with 312 additions and 158 deletions
@@ -20,23 +20,27 @@
<div class="flex-row-center flex-grow flex-wrap content">
{#each filterTx([tx, ...tx.txes], core.class.TxCreateDoc) as ctx, i}
{#if i === 0}
<div class="mr-1"><IconAdd size={'small'} /></div>
{/if}
{#if typeof viewlet?.component === 'string'}
<Component is={viewlet?.component} props={getProps(getDTxProps(ctx), edit)} on:close={onCancelEdit} />
{:else}
<svelte:component this={viewlet?.component} {...getProps(getDTxProps(ctx), edit)} on:close={onCancelEdit} />
<div class="mr-2"><IconAdd size={'small'} /></div>
{/if}
<div class="mr-2">
{#if typeof viewlet?.component === 'string'}
<Component is={viewlet?.component} props={getProps(getDTxProps(ctx), edit)} on:close={onCancelEdit} />
{:else}
<svelte:component this={viewlet?.component} {...getProps(getDTxProps(ctx), edit)} on:close={onCancelEdit} />
{/if}
</div>
{/each}
{#each filterTx([tx, ...tx.txes], core.class.TxRemoveDoc) as ctx, i}
{#if i === 0}
<div class="mr-1"><IconDelete size={'small'} /></div>
{/if}
{#if typeof viewlet?.component === 'string'}
<Component is={viewlet?.component} props={getProps(getDTxProps(ctx), edit)} on:close={onCancelEdit} />
{:else}
<svelte:component this={viewlet?.component} {...getProps(getDTxProps(ctx), edit)} on:close={onCancelEdit} />
<div class="mr-2"><IconDelete size={'small'} /></div>
{/if}
<div class="mr-2">
{#if typeof viewlet?.component === 'string'}
<Component is={viewlet?.component} props={getProps(getDTxProps(ctx), edit)} on:close={onCancelEdit} />
{:else}
<svelte:component this={viewlet?.component} {...getProps(getDTxProps(ctx), edit)} on:close={onCancelEdit} />
{/if}
</div>
{/each}
</div>
@@ -46,6 +50,6 @@
color: var(--theme-caption-color);
background: var(--theme-bg-accent-color);
border: 1px solid var(--theme-bg-accent-color);
border-radius: 0.75rem;
border-radius: .75rem;
}
</style>
@@ -103,11 +103,13 @@
class="channels {length}"
class:one={displayItems?.length === 1}
class:reverse
class:small-gap={size === 'small'}
class:normal-gap={size !== 'small'}
>
{#each displayItems as item,i}
<div class='channel-item'>
<Tooltip component={ChannelsPopup} props={{ value: item }} label={undefined} anchor={divHTML}>
<CircleButton
<Tooltip component={ChannelsPopup} props={{ value: item }} label={undefined} anchor={divHTML}>
<CircleButton
icon={item.icon}
{size}
primary={item.integration || item.notification}
@@ -131,9 +133,5 @@
&.reverse { grid-auto-flow: dense; }
&.small-gap { gap: .25rem; }
&.normal-gap { gap: .5rem; }
.channel-item {
margin: 0.125rem;
}
}
</style>
@@ -28,8 +28,13 @@
</script>
{#if value}
<div class="flex-presenter" class:inline-presenter={inline} on:click={onClick}>
<a
class="flex-presenter"
class:inline-presenter={inline}
href="#{encodeURIComponent([view.component.EditDoc, value._id, value._class].join('|'))}"
on:click={onClick}
>
<div class="icon"><Company size={'small'} /></div>
<span class="label">{value.name}</span>
</div>
</a>
{/if}
@@ -29,10 +29,15 @@
</script>
{#if value}
<div class="flex-presenter" class:inline-presenter={inline} on:click={onClick}>
<a
class="flex-presenter"
class:inline-presenter={inline}
href="#{encodeURIComponent([view.component.EditDoc, value._id, Hierarchy.mixinOrClass(value)].join('|'))}"
on:click={onClick}
>
<div class="icon">
<Avatar size={'x-small'} avatar={value.avatar} />
</div>
<span class="label">{formatName(value.name)}</span>
</div>
</a>
{/if}
@@ -29,8 +29,13 @@
</script>
{#if value}
<div class="flex-presenter" class:inline-presenter={inline} on:click={show}>
<a
class="flex-presenter"
class:inline-presenter={inline}
href="#{encodeURIComponent([view.component.EditDoc, value._id, value._class].join('|'))}"
on:click={show}
>
<div class="icon"><Icon icon={inventory.icon.Products} size={'small'} /></div>
<span class="label">{value.name}</span>
</div>
</a>
{/if}
@@ -20,14 +20,23 @@
import lead from '../plugin'
export let value: Lead
export let inline: boolean = false
function show () {
async function show () {
showPanel(view.component.EditDoc, value._id, value._class, 'full')
}
</script>
{#if value}
<div class="sm-tool-icon" on:click={show}>
<span class="icon"><Icon icon={lead.icon.Lead} size={'small'} /></span>{value.title}
</div>
<a
class="flex-presenter"
class:inline-presenter={inline}
href="#{encodeURIComponent([view.component.EditDoc, value._id, value._class].join('|'))}"
on:click={show}
>
<div class="icon">
<Icon icon={lead.icon.Lead} size={'small'} />
</div>
<span class="label">{value.title}</span>
</a>
{/if}
-1
View File
@@ -74,7 +74,6 @@
"ReviewShortLabel": "RVE",
"StartDate": "Start date",
"DueDate": "Due date",
"Period": "Period",
"ReviewCategoryTitle":"Category",
"Verdict": "Verdict",
"OpinionSave": "Save",
-1
View File
@@ -75,7 +75,6 @@
"ReviewShortLabel": "RVE",
"StartDate": "Дата начала",
"DueDate": "Дата конца",
"Period": "Период",
"ReviewCategoryTitle":"Категория",
"Verdict": "Вердикт",
"OpinionSave": "Сохранить",
@@ -33,10 +33,15 @@
</script>
{#if value && shortLabel}
<div class="flex-presenter" class:inline-presenter={inline} on:click={show}>
<a
class="flex-presenter"
class:inline-presenter={inline}
href="#{encodeURIComponent([view.component.EditDoc, value._id, value._class].join('|'))}"
on:click={show}
>
<div class="icon">
<Icon icon={recruit.icon.Application} size={'small'} />
</div>
<span class="label nowrap">{#if shortLabel}<Label label={shortLabel} />-{/if}{value.number}</span>
</div>
</a>
{/if}
@@ -28,10 +28,15 @@
</script>
{#if value}
<div class="flex-presenter" class:inline-presenter={inline} on:click={show}>
<a
class="flex-presenter"
class:inline-presenter={inline}
href="#{encodeURIComponent([recruit.component.EditVacancy, value._id, value._class].join('|'))}"
on:click={show}
>
<div class="icon">
<Icon icon={recruit.icon.Vacancy} size={'small'} />
</div>
<span class="label">{value.name}</span>
</div>
</a>
{/if}
@@ -155,6 +155,7 @@
allowDeselect
titleDeselect={recruit.string.UnAssignRecruiter}
/>
<DatePicker title={recruit.string.Period} bind:value={startDate} bind:range={dueDate} />
<DatePicker title={recruit.string.StartDate} bind:value={startDate} withTime />
<DatePicker title={recruit.string.DueDate} bind:value={dueDate} withTime />
</Grid>
</Card>
@@ -42,10 +42,15 @@
</script>
{#if value && shortLabel}
<div class="flex-presenter" class:inline-presenter={inline} on:click={show}>
<a
class="flex-presenter"
class:inline-presenter={inline}
href="#{encodeURIComponent([view.component.EditDoc, value._id, value._class].join('|'))}"
on:click={show}
>
<div class="icon">
<Icon icon={recruit.icon.Application} size={'small'} />
</div>
<span class="label nowrap">{shortLabel}-{value.number}</span>
</div>
</a>
{/if}
-1
View File
@@ -100,7 +100,6 @@ export default mergeIds(recruitId, recruit, {
ReviewShortLabel: '' as IntlString,
StartDate: '' as IntlString,
DueDate: '' as IntlString,
Period: '' as IntlString,
CandidateReviews: '' as IntlString,
Participants: '' as IntlString,
NoParticipants: '' as IntlString,
@@ -21,6 +21,7 @@
import task from '../plugin'
export let value: Issue
export let inline: boolean = false
const client = getClient()
const shortLabel = client.getHierarchy().getClass(value._class).shortLabel
@@ -30,6 +31,16 @@
}
</script>
<div class="sm-tool-icon" on:click={show}>
<span class="icon"><Icon icon={task.icon.Task} size={'small'} /></span>{#if shortLabel}<Label label={shortLabel} />-{/if}{value.number}
</div>
{#if value && shortLabel}
<a
class="flex-presenter"
class:inline-presenter={inline}
href="#{encodeURIComponent([view.component.EditDoc, value._id, value._class].join('|'))}"
on:click={show}
>
<div class="icon">
<Icon icon={task.icon.Task} size={'small'} />
</div>
<span class="label nowrap">{#if shortLabel}<Label label={shortLabel} />-{/if}{value.number}</span>
</a>
{/if}