UBERF-9461 Add personId array presenter (#7979)

Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
Alexander Onnikov 2025-02-11 17:05:13 +07:00 committed by GitHub
parent c9caef506b
commit 753b8f4efb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 47 additions and 3 deletions

View File

@ -1226,7 +1226,8 @@ export function createModel (builder: Builder): void {
})
builder.mixin(core.class.TypePersonId, core.class.Class, view.mixin.AttributePresenter, {
presenter: view.component.PersonIdPresenter
presenter: view.component.PersonIdPresenter,
arrayPresenter: view.component.PersonArrayEditor
})
builder.mixin(core.class.TypePersonId, core.class.Class, view.mixin.AttributeFilterPresenter, {

View File

@ -89,6 +89,7 @@ export default mergeIds(viewId, view, {
EnumPresenter: '' as AnyComponent,
StatusPresenter: '' as AnyComponent,
StatusRefPresenter: '' as AnyComponent,
PersonArrayEditor: '' as AnyComponent,
PersonIdFilterValuePresenter: '' as AnyComponent,
DateFilterPresenter: '' as AnyComponent,
StringFilterPresenter: '' as AnyComponent,

View File

@ -37,7 +37,7 @@
export let justify: 'left' | 'center' = 'center'
export let width: string | undefined = undefined
export let labelDirection: TooltipAlignment | undefined = undefined
export let emptyLabel: IntlString = plugin.string.Members
export let emptyLabel: IntlString = label ?? plugin.string.Members
export let readonly: boolean = false
export let create: ObjectCreate | undefined = undefined

View File

@ -88,7 +88,7 @@
</div>
<AccountArrayEditor
value={rolesAssignment?.[role._id] ?? []}
label={setting.string.Assignees}
label={core.string.Members}
onChange={(refs) => {
handleRoleAssignmentChanged(role._id, refs)
}}

View File

@ -0,0 +1,39 @@
<!--
// Copyright © 2025 Hardcore Engineering Inc.
//
// Licensed under the Eclipse Public License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. You may
// obtain a copy of the License at https://www.eclipse.org/legal/epl-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<script lang="ts">
import { PersonId } from '@hcengineering/core'
import contact from '@hcengineering/contact'
import { IntlString } from '@hcengineering/platform'
import { ButtonKind, ButtonSize, Component } from '@hcengineering/ui'
export let label: IntlString
export let value: PersonId[]
export let readonly = false
export let onChange: ((refs: PersonId[]) => void | Promise<void>) | undefined
export let kind: ButtonKind = 'link'
export let size: ButtonSize = 'large'
</script>
<Component
is={contact.component.AccountArrayEditor}
props={{
label,
value,
readonly,
onChange,
kind,
size
}}
/>

View File

@ -452,6 +452,7 @@
this={attribute.presenter}
value={getValue(attribute, object)}
onChange={getOnChange(object, attribute)}
label={attribute.label}
{...joinProps(attribute, object, readonly || $restrictionStore.readonly)}
/>
</div>

View File

@ -96,6 +96,7 @@ import TreeItem from './components/navigator/TreeItem.svelte'
import TreeNode from './components/navigator/TreeNode.svelte'
import StatusPresenter from './components/status/StatusPresenter.svelte'
import StatusRefPresenter from './components/status/StatusRefPresenter.svelte'
import PersonArrayEditor from './components/PersonArrayEditor.svelte'
import PersonIdPresenter from './components/PersonIdPresenter.svelte'
import PersonIdFilterValuePresenter from './components/filter/PersonIdFilterValuePresenter.svelte'
import AudioViewer from './components/viewer/AudioViewer.svelte'
@ -299,6 +300,7 @@ export default async (): Promise<Resources> => ({
FileSizePresenter,
StatusPresenter,
StatusRefPresenter,
PersonArrayEditor,
PersonIdPresenter,
PersonIdFilterValuePresenter,
DateFilterPresenter,