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

[User Management] Add user reference data #863

Merged
merged 2 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
* @license https://github.com/pimcore/studio-ui-bundle/blob/1.x/LICENSE.md POCL and PCL
*/

import React from 'react'
import React, { useEffect } from 'react'
import { Grid } from '@Pimcore/components/grid/grid'
import { createColumnHelper } from '@tanstack/react-table'
import { useTranslation } from 'react-i18next'
import { type UserWorkspace } from '@Pimcore/modules/user/user-api-slice.gen'
import { type DependencyToAnObject } from '@Pimcore/modules/user/user-api-slice.gen'

interface ITableProps {
data: UserWorkspace[]
data: DependencyToAnObject[]
isLoading: boolean
}

Expand All @@ -26,33 +27,37 @@ export const Table = ({
isLoading
}: ITableProps): React.JSX.Element => {
const { t } = useTranslation()
const [gridData, setGridData] = React.useState<DependencyToAnObject[]>(data)

useEffect(() => {
setGridData(data)
}, [data])

const columnHelper = createColumnHelper()
const createColumns = (): any => [
columnHelper.accessor('id', {
header: t('user-management.references.columns.id'),
header: t('user-management.workspaces.columns.id'),
meta: {
type: 'element-cell',
editable: false
editable: true
},
size: 184
size: 100
}),
columnHelper.accessor('cpath', {
header: t('user-management.references.columns.cpath'),
columnHelper.accessor('path', {
header: t('user-management.workspaces.columns.path'),
meta: {
type: 'element-cell',
editable: false,
editable: true,
autoWidth: true
},
size: 270
}
}),
columnHelper.accessor('subtype', {
header: t('user-management.references.columns.subtype'),
header: t('user-management.workspaces.columns.subtype'),
meta: {
type: 'element-cell',
editable: false
editable: true
},
size: 184
size: 150
})
]
const ownTableColumns = [
Expand All @@ -63,7 +68,7 @@ export const Table = ({
<Grid
autoWidth
columns={ ownTableColumns }
data={ data }
data={ gridData }
isLoading={ isLoading }
resizable
setRowId={ (row) => row.cid }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ import React from 'react'
import { useTranslation } from 'react-i18next'
import { Table } from '@Pimcore/modules/user/management/detail/tabs/references/components/table/table'
import { Accordion } from '@Pimcore/components/accordion/accordion'
import { useUserDraft } from '@Pimcore/modules/user/hooks/use-user-draft'
import { useUserContext } from '@Pimcore/modules/user/hooks/use-user-context'

const ReferenceContainer = ({ ...props }): React.JSX.Element => {
const { t } = useTranslation()
// const { id } = useUserContext()
// const { user, isLoading } = useUserDraft(id)

const [references] = React.useState<[]>([])
const { id } = useUserContext()
const { user } = useUserDraft(id)

const accordionContent = [
{
key: '1',
title: <>{ t('user-management.references.documents') }</>,
children: <Table
data={ references }
data={ user?.objectDependencies?.dependencies ?? [] }
isLoading={ false }
/>
}
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions public/build/30473065-eed4-4d82-9b20-e1ad4929c640/entrypoints.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"entrypoints": {
"core-dll": {
"css": [
"/bundles/pimcorestudioui/build/30473065-eed4-4d82-9b20-e1ad4929c640/core-dll.css"
],
"js": [
"/bundles/pimcorestudioui/build/30473065-eed4-4d82-9b20-e1ad4929c640/core-dll.js"
]
}
}
}

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions public/build/443c7c6b-efbe-48c0-b977-4425c914f034/entrypoints.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"entrypoints": {
"main": {
"js": [
"/bundles/pimcorestudioui/build/5c0b74ca-5754-43a4-a8bc-99f1db392187/main.js"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"bundles/pimcorestudioui/build/5c0b74ca-5754-43a4-a8bc-99f1db392187/main.js": "/bundles/pimcorestudioui/build/5c0b74ca-5754-43a4-a8bc-99f1db392187/main.js"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"entrypoints": {
"vendor": {
"js": [
"/bundles/pimcorestudioui/build/6e304b74-13b3-4ba3-8fa4-e6210241a94e/vendor.js"
]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"bundles/pimcorestudioui/build/6e304b74-13b3-4ba3-8fa4-e6210241a94e/vendor.js": "/bundles/pimcorestudioui/build/6e304b74-13b3-4ba3-8fa4-e6210241a94e/vendor.js"
}

This file was deleted.

This file was deleted.

3 changes: 3 additions & 0 deletions translations/studio.en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,9 @@ user-management.workspaces.columns.create: Create
user-management.workspaces.columns.settings: Settings
user-management.workspaces.columns.versions: Versions
user-management.workspaces.columns.properties: Properties
user-management.workspaces.columns.path: Path
user-management.workspaces.columns.id: ID
user-management.workspaces.columns.subtype: Subtype
navigation.document-types: Document Types
navigation.clear-cache: Clear Full Page Cache
navigation.custom-reports: Custom Reports
Expand Down
Loading