Skip to content

Commit

Permalink
Merge pull request #1632 from SenseNet/fix/1620-upload_new_CTD_single…
Browse files Browse the repository at this point in the history
…_quates_name

Fix/1620 upload new ctd single quates name
  • Loading branch information
NoelKova authored Aug 7, 2024
2 parents b15c91c + 0492465 commit 5999867
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
8 changes: 8 additions & 0 deletions apps/sensenet/src/components/ContentBreadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ const useStyles = makeStyles((theme: Theme) => {
marginLeft: 'auto',
display: 'flex',
marginRight: '8px',
height: '40px',
},
buttonsWrapper: {
display: 'flex',
alignItems: 'center',
},
actionButton: {
width: '40px',
marginRight: '2px',
},
})
})

Expand Down Expand Up @@ -87,6 +92,7 @@ export const ContentBreadcrumbs = <T extends GenericContent = GenericContent>(pr
<div className={classes.batchActionWrapper} data-test="batch-actions">
<Tooltip title={localization.batchActions.delete} placement="bottom">
<IconButton
className={classes.actionButton}
data-test="batch-delete"
aria-label="delete"
onClick={() => {
Expand All @@ -101,6 +107,7 @@ export const ContentBreadcrumbs = <T extends GenericContent = GenericContent>(pr
</Tooltip>
<Tooltip title={localization.batchActions.move} placement="bottom">
<IconButton
className={classes.actionButton}
data-test="batch-move"
aria-label="move"
onClick={() => {
Expand All @@ -123,6 +130,7 @@ export const ContentBreadcrumbs = <T extends GenericContent = GenericContent>(pr
</Tooltip>
<Tooltip title={localization.batchActions.copy} placement="bottom">
<IconButton
className={classes.actionButton}
data-test="batch-copy"
aria-label="copy"
onClick={() => {
Expand Down
7 changes: 6 additions & 1 deletion apps/sensenet/src/components/editor/text-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PathHelper } from '@sensenet/client-utils'
import { ActionModel, GenericContent, Settings, File as SnFile } from '@sensenet/default-content-types'
import { useLogger, useRepository } from '@sensenet/hooks-react'
import React, { useEffect, useState } from 'react'
import { useLocalization } from '../../hooks'
import { useLocalization, useSelectionService } from '../../hooks'
import { getMonacoLanguage } from '../../services/content-context-service'
import { ContentBreadcrumbs } from '../ContentBreadcrumbs'
import { FullScreenLoader } from '../full-screen-loader'
Expand Down Expand Up @@ -50,6 +50,11 @@ export const TextEditor: React.FunctionComponent<TextEditorProps> = (props) => {
const [hasChanges, setHasChanges] = useState(false)
const logger = useLogger('TextEditor')
const [error, setError] = useState<Error | undefined>()
const selectionService = useSelectionService()

useEffect(() => {
selectionService.selection.setValue([props.content])
}, [props, selectionService.selection])

const saveContent = async () => {
try {
Expand Down
3 changes: 2 additions & 1 deletion apps/sensenet/src/components/view-controls/browse-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ export const BrowseView: React.FC<BrowseViewProps> = (props) => {
})
setContent(expanedContentResponse.d)
selectionService.activeContent.setValue(expanedContentResponse.d)
selectionService.selection.setValue([expanedContentResponse.d])
}
getExpandedContent()
}, [repository, props.contentPath, selectionService.activeContent])
}, [repository, props.contentPath, selectionService.activeContent, selectionService.selection])

if (content === undefined) {
return null
Expand Down
3 changes: 2 additions & 1 deletion apps/sensenet/src/components/view-controls/edit-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,10 @@ export const EditView: React.FC<EditViewProps> = (props) => {
})
setContent(expanedContentResponse.d)
selectionService.activeContent.setValue(expanedContentResponse.d)
selectionService.selection.setValue([expanedContentResponse.d])
}
getExpandedContent()
}, [repository, props.contentPath, selectionService.activeContent])
}, [repository, props.contentPath, selectionService.activeContent, selectionService.selection])

if (content === undefined) {
return null
Expand Down
2 changes: 1 addition & 1 deletion apps/sensenet/src/components/view-controls/new-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const NewView: React.FC<NewViewProps> = (props) => {
routeMatch={routeMatch}
savePath={PATHS.contentTypes.snPath}
loadContent={loadDefaultContentType}
getFileNameFromText={(text) => text.match(/<ContentType.*name="([^"]*)".*>/m)?.[1] || ''}
getFileNameFromText={(text) => text.match(/<ContentType.*name=['"]([^'"]*)['"].*>/m)?.[1] || ''}
/>
)
} else if (props.contentTypeName === 'Resource') {
Expand Down

0 comments on commit 5999867

Please sign in to comment.