Fix errors (#803)

Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
Alexander Platov 2022-01-12 12:18:50 +03:00 committed by GitHub
parent 96fb5c1ac5
commit 0567bdbb31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 83 additions and 96 deletions

View File

@ -90,6 +90,8 @@ table {
p:first-child { margin-block-start: 0; } // First and last padding
p:last-child { margin-block-end: 0; }
// .popup .tr-body:hover { background-color: transparent !important; } // Remove highlights table rows in popups
/* Flex */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
@ -183,6 +185,10 @@ p:last-child { margin-block-end: 0; }
.icon {
margin-right: .25rem;
color: var(--theme-content-dark-color);
&.small-size {
width: 1.5rem;
height: 1.5rem;
}
}
&:hover .icon { color: var(--theme-caption-color); }
}

View File

@ -29,9 +29,9 @@
export let icon: Asset | AnySvelteComponent = Add
export let label: IntlString
export let placeholder: IntlString
export let placeholder: string
export let items: ListItem[] = [{ item: tesla, label: 'Tesla' }, { item: google, label: 'Google' }]
export let selected: ListItem | undefined
export let selected: ListItem | undefined = undefined
export let show: boolean = false
let btn: HTMLElement
@ -73,7 +73,7 @@
<div class="selectUser">
<div class="title"><Label {label} /></div>
<div class="caption-color" class:empty={selected ? false : true}>
{#if selected}{selected.label}{:else}<Label label={placeholder} />{/if}
{#if selected}{selected.label}{:else}{placeholder}{/if}
</div>
</div>
</div>

View File

@ -48,7 +48,8 @@
show = false
modalHTML.style.left = modalHTML.style.right = modalHTML.style.top = modalHTML.style.bottom = ''
if (typeof element !== 'string') {
const rect = element.getBoundingClientRect()
let el: HTMLElement = element as HTMLElement
const rect = el.getBoundingClientRect()
const rectPopup = modalHTML.getBoundingClientRect()
// Vertical
if (rect.bottom + rectPopup.height + 28 <= document.body.clientHeight)

View File

@ -54,7 +54,7 @@ export interface Tab {
export type TabModel = Tab[]
export type PopupAlignment = HTMLElement | 'right' | 'float' | 'account' | 'full'
export type PopupAlignment = HTMLElement | EventTarget | null | 'right' | 'float' | 'account' | 'full'
export type TooltipAligment = 'top' | 'bottom' | 'left' | 'right'

View File

@ -2,6 +2,7 @@
"string": {
"UploadDropFilesHere": "Upload or drop files here",
"NoAttachments": "There are no attachments for this",
"AddAttachment": "uploaded an attachment"
"AddAttachment": "uploaded an attachment",
"Attachments": "Attachments"
}
}

View File

@ -27,7 +27,7 @@
export let space: Ref<Space>
export let _class: Ref<Class<Doc>>
export let attachments: number
export let attachments: number | undefined = undefined
let inputFile: HTMLInputElement
let loading = 0

View File

@ -18,13 +18,14 @@
import type { Doc } from '@anticrm/core'
import { Tooltip, IconAttachment } from '@anticrm/ui'
import AttachmentPopup from './AttachmentPopup.svelte'
import attachment from '../plugin'
export let value: Doc & { attachments?: number }
</script>
{#if value && value.attachments && value.attachments > 0}
<Tooltip label={'Attachments (' + value.attachments + ')'} component={AttachmentPopup} props={{ objectId: value._id, attachments: value.attachments }}>
<Tooltip label={attachment.string.Attachments} component={AttachmentPopup} props={{ objectId: value._id, attachments: value.attachments }}>
<div class="sm-tool-icon">
<span class="icon"><IconAttachment size="small"/></span>&nbsp;{value.attachments}
</div>

View File

@ -21,6 +21,7 @@ import attachment, { attachmentId } from '@anticrm/attachment'
export default mergeIds(attachmentId, attachment, {
string: {
NoAttachments: '' as IntlString,
UploadDropFilesHere: '' as IntlString
UploadDropFilesHere: '' as IntlString,
Attachments: '' as IntlString
}
})

View File

@ -9,7 +9,8 @@
"build:docs": "api-extractor run --local",
"lint": "svelte-check && eslint",
"lint:fix": "eslint --fix src",
"format": "prettier --write --plugin-search-dir=. src && eslint --fix src"
"format": "prettier --write --plugin-search-dir=. src && eslint --fix src",
"svelte-check": "svelte-check"
},
"devDependencies": {
"svelte-loader": "^3.1.2",

View File

@ -14,7 +14,7 @@
-->
<script lang="ts">
import { IntlString } from "@anticrm/status"
import type { IntlString } from "@anticrm/platform"
export let title: IntlString
export let line: boolean = false

View File

@ -19,7 +19,7 @@
import { formatName } from '@anticrm/contact'
import { Avatar, getClient, MessageViewer } from '@anticrm/presentation'
import { TimeSince, ShowMore } from '@anticrm/ui'
import { getTime, getUser } from '../utils'
import { getUser } from '../utils'
export let value: Comment

View File

@ -6,6 +6,7 @@
"Organizations": "Organizations",
"CreatePerson": "Create person",
"CreatePersons": "Create persons folder",
"CreateOrganization": "Create organization",
"CreateOrganizations": "Create organizations folder",
"Name": "Name",
"SelectFolder": "Select folder",

View File

@ -9,7 +9,8 @@
"build:docs": "api-extractor run --local",
"lint": "svelte-check && eslint",
"lint:fix": "eslint --fix src",
"format": "prettier --write --plugin-search-dir=. src && eslint --fix src"
"format": "prettier --write --plugin-search-dir=. src && eslint --fix src",
"svelte-check": "svelte-check"
},
"devDependencies": {
"svelte-loader": "^3.1.2",

View File

@ -30,7 +30,7 @@
</script>
{#if isPerson(value)}
<PersonPresenter {value} } />
<PersonPresenter {value} />
{:else}
<OrganizationPresenter {value} />
{/if}

View File

@ -63,6 +63,7 @@
</ScrollBox>
</div>
</div>
<style lang="scss">
.container {
display: flex;
@ -101,22 +102,16 @@
margin-right: .5rem;
opacity: .6;
}
.label, .description {
.label {
flex-grow: 1;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
max-width: 35rem;
}
.label {
font-weight: 500;
font-size: 1rem;
color: var(--theme-caption-color);
}
.description {
font-size: .75rem;
color: var(--theme-content-trans-color);
}
}
}
</style>

View File

@ -15,7 +15,6 @@
-->
<script lang="ts">
import { createEventDispatcher } from 'svelte'
import type { Ref, Space } from '@anticrm/core'
import { getClient, Card, Channels } from '@anticrm/presentation'
@ -45,7 +44,7 @@
</script>
<Card
label={'Create organization'}
label={contact.string.CreateOrganization}
okAction={createOrganization}
canSave={object.name.length > 0}
space={contact.space.Contacts}
@ -58,7 +57,7 @@
<Company size={'large'} />
</div>
<div class="flex-col">
<div class="fs-title"><EditBox placeholder="Apple" maxWidth="10rem" bind:value={object.name} /></div>
<div class="fs-title"><EditBox placeholder="Apple" maxWidth="11rem" bind:value={object.name} label={undefined} /></div>
</div>
</div>

View File

@ -15,7 +15,7 @@
-->
<script lang="ts">
import { createEventDispatcher } from 'svelte'
import type { Ref, Space, Data } from '@anticrm/core'
import type { Data } from '@anticrm/core'
import { getClient, Card, Channels, Avatar } from '@anticrm/presentation'
@ -64,9 +64,9 @@
<Avatar avatar={object.avatar} size={'large'} />
</div>
<div class="flex-col">
<div class="fs-title"><EditBox placeholder="John" maxWidth="10rem" bind:value={firstName} /></div>
<div class="fs-title mb-1"><EditBox placeholder="Appleseed" maxWidth="10rem" bind:value={lastName} /></div>
<div class="small-text"><EditBox placeholder="Location" maxWidth="10rem" bind:value={object.city} /></div>
<div class="fs-title"><EditBox placeholder="John" maxWidth="12rem" bind:value={firstName} label={undefined} /></div>
<div class="fs-title mb-1"><EditBox placeholder="Appleseed" maxWidth="12rem" bind:value={lastName} label={undefined} /></div>
<div class="small-text"><EditBox placeholder="Location" maxWidth="12rem" bind:value={object.city} label={undefined} /></div>
</div>
</div>

View File

@ -217,7 +217,6 @@
{/if}
<style lang="scss">
.main-editor {
display: flex;
justify-content: center;
@ -227,15 +226,15 @@
margin-top: 2rem;
display: flex;
.mixin-selector {
margin-left: 8px;
margin-left: .5rem;
cursor: pointer;
height: 24px;
min-width: 84px;
height: 1.5rem;
min-width: 5.25rem;
border-radius: 8px;
border-radius: .5rem;
font-weight: 500;
font-size: 10px;
font-size: .625rem;
text-transform: uppercase;
color: #FFFFFF;
@ -244,11 +243,5 @@
align-items: center;
justify-content: center;
}
.attributes {
margin: 1rem;
}
.collections {
margin: 1rem;
}
}
</style>

View File

@ -60,7 +60,7 @@
</div>
<div class="flex-grow flex-col">
<div class="name">
<EditBox placeholder="John" maxWidth="20rem" bind:value={object.name} on:change={nameChange} />
<EditBox placeholder="John" maxWidth="20rem" bind:value={object.name} on:change={nameChange} label={undefined} />
</div>
<div class="flex-between channels">
<div class="flex-row-center">

View File

@ -71,10 +71,10 @@
<div class="flex-grow flex-col">
<div class="flex-grow flex-col">
<div class="name">
<EditBox placeholder="John" maxWidth="20rem" bind:value={firstName} on:change={firstNameChange} />
<EditBox placeholder="John" maxWidth="20rem" bind:value={firstName} on:change={firstNameChange} label={undefined} />
</div>
<div class="name">
<EditBox placeholder="Appleseed" maxWidth="20rem" bind:value={lastName} on:change={lastNameChange} />
<EditBox placeholder="Appleseed" maxWidth="20rem" bind:value={lastName} on:change={lastNameChange} label={undefined} />
</div>
<div class="location">
<AttributeEditor maxWidth="20rem" _class={contact.class.Person} {object} key="city" />

View File

@ -26,29 +26,8 @@
}
</script>
<div class="flex-row-center user-container" on:click={onClick}>
<div class="icon"><Company size={'medium'} /></div>
<div class="overflow-label user">{value.name}</div>
</div>
<style lang="scss">
.user-container {
cursor: pointer;
.icon {
width: 1.5rem;
height: 1.5rem;
}
.user {
margin-left: 0.5rem;
font-weight: 500;
text-align: left;
color: var(--theme-content-accent-color);
}
&:hover .user {
text-decoration: underline;
color: var(--theme-caption-color);
}
}
</style>
{#if value}
<div class="sm-tool-icon" on:click={onClick}>
<span class="icon small-size flex-center"><Company size={'small'} /></span>&nbsp;{value.name}
</div>
{/if}

View File

@ -24,6 +24,7 @@ export default mergeIds(contactId, contact, {
Contacts: '' as IntlString,
CreatePerson: '' as IntlString,
CreatePersons: '' as IntlString,
CreateOrganization: '' as IntlString,
CreateOrganizations: '' as IntlString,
Organizations: '' as IntlString,
SelectFolder: '' as IntlString,

View File

@ -15,6 +15,7 @@
"Reply": "Reply",
"Subject": "Subject",
"Send": "Send",
"NewMessageTo": "New message to"
"NewMessageTo": "New message to",
"Cancel": "Cancel"
}
}

View File

@ -9,7 +9,8 @@
"build:docs": "api-extractor run --local",
"lint": "svelte-check && eslint",
"lint:fix": "eslint --fix src",
"format": "prettier --write --plugin-search-dir=. src && eslint --fix src"
"format": "prettier --write --plugin-search-dir=. src && eslint --fix src",
"svelte-check": "svelte-check"
},
"devDependencies": {
"@anticrm/platform-rig": "~0.6.0",

View File

@ -13,6 +13,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<script lang="ts">
import { createQuery, getClient } from '@anticrm/presentation'
import { Message, SharedMessage } from '@anticrm/gmail'
@ -20,7 +21,7 @@
import { Contact, EmployeeAccount, formatName } from '@anticrm/contact'
import contact from '@anticrm/contact'
import { ActionIcon, IconShare, Button, ScrollBox, showPopup, Icon, Label } from '@anticrm/ui'
import { Account, Class, getCurrentAccount, Ref, SortingOrder, Space } from '@anticrm/core'
import { getCurrentAccount, Ref, SortingOrder, Space } from '@anticrm/core'
import setting from '@anticrm/setting'
import Connect from './Connect.svelte'
import Messages from './Messages.svelte'
@ -107,7 +108,7 @@
<span>{selected.size} <Label label={gmail.string.MessagesSelected} /></span>
<div class="flex">
<div>
<Button label={'Cancel'} size={'small'} on:click={clear} />
<Button label={gmail.string.Cancel} size={'small'} on:click={clear} />
</div>
<div class="ml-3">
<Button

View File

@ -81,10 +81,10 @@
</div>
<div class="flex-col clear-mins right-content">
<div class="mb-2">
<EditBox label={gmail.string.Subject} bind:value={obj.subject} placeholder={'Message subject'} />
<EditBox label={gmail.string.Subject} bind:value={obj.subject} placeholder={'Message subject'} maxWidth={'min-content'} />
</div>
<div class="mb-4">
<EditBox label={gmail.string.Copy} bind:value={copy} placeholder={'Copy to'} />
<EditBox label={gmail.string.Copy} bind:value={copy} placeholder={'Copy to'} maxWidth={'min-content'} />
</div>
<div class="input clear-mins">
<TextEditor bind:this={editor} bind:content={obj.content} on:blur={editor.submit} />

View File

@ -34,6 +34,7 @@ export default mergeIds(gmailId, gmail, {
Reply: '' as IntlString,
Subject: '' as IntlString,
Send: '' as IntlString,
NewMessageTo: '' as IntlString
NewMessageTo: '' as IntlString,
Cancel: '' as IntlString
}
})

View File

@ -91,22 +91,16 @@
margin-right: .5rem;
opacity: .6;
}
.label, .description {
.label {
flex-grow: 1;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
max-width: 35rem;
}
.label {
font-weight: 500;
font-size: 1rem;
color: var(--theme-caption-color);
}
.description {
font-size: .75rem;
color: var(--theme-content-trans-color);
}
}
}
</style>

View File

@ -48,8 +48,8 @@
/>
<UserBox
_class={contact.class.Contact}
title="Customer"
caption="Select customer"
title={lead.string.Customer}
caption={lead.string.SelectCustomer}
bind:value={object.customer}
on:change={() => {
change('customer', object.customer)

View File

@ -19,7 +19,11 @@
"AssignRecruiter": "Assigned recruiter",
"UnAssignRecruiter": "Unassigned recruiter",
"Recruiters": "Recruiters",
"Create": "Create"
"Create": "Create",
"Applications": "Applications",
"ThisVacancyIsPrivate": "This vacancy is private",
"Description": "Description",
"Company": "Company"
},
"status": {
"CandidateRequired": "Please select candidate"

View File

@ -24,7 +24,7 @@
</script>
{#if value.applications && value.applications > 0}
<Tooltip label={'Applications'} component={ApplicationsPopup} props={{ value }}>
<Tooltip label={recruit.string.Applications} component={ApplicationsPopup} props={{ value }}>
<div class="sm-tool-icon">
<span class="icon"><Icon icon={recruit.icon.Application} size={'small'} /></span>&nbsp;{value.applications}
</div>

View File

@ -64,7 +64,7 @@
>
<Grid column={1} rowGap={1.5}>
<EditBox label={recruit.string.VacancyName} bind:value={name} icon={Vacancy} placeholder="Software Engineer" maxWidth={'16rem'} focus/>
<Dropdown icon={Company} label={'Company *'} placeholder={'Company'} />
<Dropdown icon={Company} label={recruit.string.Company} placeholder={'Company'} />
<KanbanTemplateSelector folders={[recruit.space.VacancyTemplates]} bind:template={templateId}/>
</Grid>
</SpaceCreateCard>

View File

@ -80,7 +80,7 @@
{#if selected === 0}
<Grid column={1} rowGap={1.5}>
<EditBox label={recruit.string.VacancyName} bind:value={object.name} placeholder="Software Engineer" maxWidth="39rem" focus on:change={() => {onChange('name', object.name)}}/>
<EditBox label='Description' bind:value={object.description} placeholder='Description' maxWidth="39rem" focus on:change={() => {onChange('description', object.description)}}/>
<EditBox label={recruit.string.Description} bind:value={object.description} placeholder='Description' maxWidth="39rem" focus on:change={() => {onChange('description', object.description)}}/>
</Grid>
<div class="mt-10">
<span class="title">Description</span>
@ -92,7 +92,7 @@
<Attachments objectId={object._id} _class={object._class} space={object.space} />
</div>
{:else if selected === 1}
<ToggleWithLabel label={'This vacancy is private'} description={recruit.string.MakePrivateDescription}/>
<ToggleWithLabel label={recruit.string.ThisVacancyIsPrivate} description={recruit.string.MakePrivateDescription}/>
{:else if selected === 2}
<Component is={activity.component.Activity} props={{object, transparent: true}} />
{/if}

View File

@ -40,7 +40,7 @@
<div class="fs-title over-underline lines-limit-2" on:click={showCandidate}>{formatName(object.$lookup?.attachedTo?.name)}</div>
<div class="small-text lines-limit-2">{object.$lookup?.attachedTo?.title ?? ''}</div>
</div>
<div class="tool"><ActionIcon label={'More...'} icon={IconMoreH} size={'small'} /></div>
<div class="tool"><ActionIcon label={undefined} icon={IconMoreH} size={'small'} /></div>
</div>
<div class="flex-between">
<div class="flex-row-center">

View File

@ -14,14 +14,15 @@
-->
<script lang="ts">
import type { IntlString } from '@anticrm/platform'
import { Label } from '@anticrm/ui'
export let value: boolean | undefined
function getLabel(value: boolean | undefined) {
if (value === true) return 'Yes'
if (value === false) return 'No'
return 'N/A'
function getLabel(value: boolean | undefined): IntlString {
if (value === true) return 'Yes' as IntlString
if (value === false) return 'No' as IntlString
return 'N/A' as IntlString
}
</script>

View File

@ -44,7 +44,11 @@ export default mergeIds(recruitId, recruit, {
AssignRecruiter: '' as IntlString,
Recruiters: '' as IntlString,
UnAssignRecruiter: '' as IntlString,
Create: '' as IntlString
Create: '' as IntlString,
Applications: '' as IntlString,
ThisVacancyIsPrivate: '' as IntlString,
Description: '' as IntlString,
Company: '' as IntlString
},
space: {
CandidatesPublic: '' as Ref<Space>