diff --git a/apps/sensenet/src/components/content-list/date-field.tsx b/apps/sensenet/src/components/content-list/date-field.tsx index b5ddbab55..d2f2c63c6 100644 --- a/apps/sensenet/src/components/content-list/date-field.tsx +++ b/apps/sensenet/src/components/content-list/date-field.tsx @@ -10,8 +10,8 @@ export const DateField: FC<{ date: string | Date }> = ({ date }) => { return ( - -
{dateUtils.formatDistanceFromNow(new Date(date))}
+ +
{dateUtils.formatDate(new Date(date), 'yyyy-MM-dd HH:mm:ss')}
) diff --git a/apps/sensenet/src/components/content-list/reference-field.tsx b/apps/sensenet/src/components/content-list/reference-field.tsx index 0c66be19d..a68c0fde2 100644 --- a/apps/sensenet/src/components/content-list/reference-field.tsx +++ b/apps/sensenet/src/components/content-list/reference-field.tsx @@ -1,5 +1,5 @@ import { Button, createStyles, Link, makeStyles, TableCell, Theme, Tooltip } from '@material-ui/core' -import { GenericContent } from '@sensenet/default-content-types' +import { GenericContent, User } from '@sensenet/default-content-types' import { useRepository } from '@sensenet/hooks-react' import { clsx } from 'clsx' import React, { FunctionComponent, useContext } from 'react' @@ -73,7 +73,7 @@ export const ReferenceField: FunctionComponent = ({ content {repository.schemas.isContentFromType(content, 'User') && showIcon ? ( ) : null} - + {content.Name === 'Somebody' ? ( <>{content.DisplayName || content.Name} ) : ( @@ -91,7 +91,10 @@ export const ReferenceField: FunctionComponent = ({ content }), ) }}> - {content.DisplayName || content.Name} + {repository.schemas.isContentFromType(content, 'User') + ? `${(content as User).Domain}\\${(content as User).LoginName}` + : ''} + {content.Type !== 'User' ? content.Name : ''} )} diff --git a/apps/sensenet/src/components/content/Explore.tsx b/apps/sensenet/src/components/content/Explore.tsx index 8dae4f739..ef2d4c1b6 100644 --- a/apps/sensenet/src/components/content/Explore.tsx +++ b/apps/sensenet/src/components/content/Explore.tsx @@ -197,7 +197,7 @@ export function Explore({ batchActions={true} /> -
+
{hasTree && ( { diff --git a/apps/sensenet/src/components/tree/simpletree.tsx b/apps/sensenet/src/components/tree/simpletree.tsx new file mode 100644 index 000000000..2f85cc7fe --- /dev/null +++ b/apps/sensenet/src/components/tree/simpletree.tsx @@ -0,0 +1,48 @@ +import { GenericContent } from '@sensenet/default-content-types' +import React from 'react' +import { usePersonalSettings } from '../../hooks' + +export type ItemType = GenericContent & { + children?: ItemType[] + expanded?: boolean + hasNextPage?: boolean +} + +type SimpleTreeProps = { + activeItemPath: string + itemCount: number + isLoading: boolean + loadMore: (startIndex: number, path?: string) => Promise + onItemClick: (item: GenericContent) => void + treeData: ItemType +} + +export const getStringParts = (str: string, characterSplit = 10) => { + return [str.slice(0, characterSplit * -1), str.slice(characterSplit * -1)] +} + +export function SimpleTree({ treeData, itemCount, onItemClick, loadMore, isLoading, activeItemPath }: SimpleTreeProps) { + const personalSettings = usePersonalSettings() + console.log(treeData) + console.log(itemCount) + console.log(onItemClick) + console.log(loadMore) + console.log(isLoading) + console.log(activeItemPath) + console.log(personalSettings) + return ( +
+
+ tree +
+
+ ) +} diff --git a/apps/sensenet/src/style.css b/apps/sensenet/src/style.css index 3265d7302..a3ca13611 100644 --- a/apps/sensenet/src/style.css +++ b/apps/sensenet/src/style.css @@ -11,3 +11,33 @@ ul[role='listbox'] { padding: 0; margin: 0; } +.MuiInputBase-root { + border: 1px solid #ccc; + border-radius: 5px; + padding: 2px 5px; + margin-top: 23px !important; +} +.MuiGrid-container { + max-height: 100% !important; +} +div[class*='makeStyles-actionButtonWrapper'] { + left: auto; +} +button.MuiButtonBase-root.MuiButton-root.MuiButton-contained.MuiButton-containedPrimary[type='submit'] { + margin-left: 0px; +} + +/*.leftTree .MuiListItemIcon-root { + border-left: 2px dotted #ccc; + padding-left: 5px; + padding-top: 0px; + padding-bottom: 0px; + margin: 0; +} +.leftTree .MuiListItem-root { + padding-top: 0px; + padding-bottom: 0px; +} +.leftTree span[class*='MuiTypography-body'] { + font-size: 12px; +} */ diff --git a/packages/sn-controls-react/src/fieldcontrols/allowed-child-types.tsx b/packages/sn-controls-react/src/fieldcontrols/allowed-child-types.tsx index 2e879f5c6..5095ae154 100644 --- a/packages/sn-controls-react/src/fieldcontrols/allowed-child-types.tsx +++ b/packages/sn-controls-react/src/fieldcontrols/allowed-child-types.tsx @@ -230,7 +230,7 @@ export const AllowedChildTypes: React.FC -
+
{props.settings.DisplayName} @@ -270,6 +270,7 @@ export const AllowedChildTypes: React.FC 0 ? false : true} onClick={handleAddClick}> {props.renderIcon ? props.renderIcon('add_circle') : renderIconDefault('add_circle')} diff --git a/packages/sn-controls-react/src/fieldcontrols/file-upload.tsx b/packages/sn-controls-react/src/fieldcontrols/file-upload.tsx index 33d1ac908..da545dd60 100644 --- a/packages/sn-controls-react/src/fieldcontrols/file-upload.tsx +++ b/packages/sn-controls-react/src/fieldcontrols/file-upload.tsx @@ -211,7 +211,14 @@ export const FileUpload: React.FC> =