Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSK-1013: add position field to Employee #2874

Merged
merged 2 commits into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions models/contact/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ export class TEmployee extends TPerson implements Employee {

@Prop(TypeString(), contact.string.DisplayName)
displayName?: string | null

@Prop(TypeString(), contact.string.Position)
position?: string | null
}

@Model(contact.class.EmployeeAccount, core.class.Account)
Expand Down
5 changes: 3 additions & 2 deletions plugins/contact-assets/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"CategoryProjectLead": "Project lead",
"CategoryCurrentUser": "Current user",
"CategoryOther": "Other",
"NumberMembers": "{count, plural, =0 {no members} =1 {1 member} other {# members}}"
"NumberMembers": "{count, plural, =0 {no members} =1 {1 member} other {# members}}",
"Position": "Position"
}
}
}
5 changes: 3 additions & 2 deletions plugins/contact-assets/lang/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"CategoryPreviousAssigned": "Ранее назначенные",
"CategoryProjectLead": "Руководитель проекта",
"CategoryProjectMembers": "Участники проекта",
"CategoryOther": "Прочие"
"CategoryOther": "Прочие",
"Position": "Должность"
}
}
}
19 changes: 19 additions & 0 deletions plugins/contact-resources/src/components/EditEmployee.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
let firstName = getFirstName(object.name)
let lastName = getLastName(object.name)
let displayName = object.displayName ?? ''
let position = object.position ?? ''

$: setName(object)

Expand Down Expand Up @@ -72,6 +73,12 @@
})
}

function changePosition () {
client.update(object, {
position: position === '' ? null : position
})
}

let integrations: Set<Ref<IntegrationType>> = new Set<Ref<IntegrationType>>()
const settingsQuery = createQuery()
$: settingsQuery.query(setting.class.Integration, { createdBy: account._id, disabled: false }, (res) => {
Expand Down Expand Up @@ -152,6 +159,18 @@
{displayName}
{/if}
</div>
<div class="name">
ThetaDR marked this conversation as resolved.
Show resolved Hide resolved
{#if editable}
<EditBox
placeholder={contact.string.Position}
bind:value={position}
on:change={changePosition}
focusIndex={1}
/>
{:else}
{position}
{/if}
</div>
<div class="location">
<AttributeEditor
maxWidth="20rem"
Expand Down
4 changes: 3 additions & 1 deletion plugins/contact/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ export interface Employee extends Person {
mergedTo?: Ref<Employee>
statuses?: number
displayName?: string | null
position?: string | null
}

/**
Expand Down Expand Up @@ -244,7 +245,8 @@ export const contactPlugin = plugin(contactId, {
UseColor: '' as IntlString,
PersonFirstNamePlaceholder: '' as IntlString,
PersonLastNamePlaceholder: '' as IntlString,
DisplayName: '' as IntlString
DisplayName: '' as IntlString,
Position: '' as IntlString
},
viewlet: {
TableMember: '' as Ref<Viewlet>,
Expand Down