-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/Shortcut-panel-in-reference-picker
- Loading branch information
Showing
11 changed files
with
341 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { PATHS, resolvePathParams } from '../../../src/application-paths' | ||
import { pathWithQueryParams } from '../../../src/services/query-string-builder' | ||
|
||
const contextMenuItems = ['browse', 'copyto', 'edit', 'moveto', 'delete'] | ||
describe('Groups', () => { | ||
before(() => { | ||
cy.login() | ||
cy.visit( | ||
pathWithQueryParams({ | ||
path: resolvePathParams({ path: PATHS.contentTypes.appPath, params: { browseType: 'explorer' } }), | ||
newParams: { repoUrl: Cypress.env('repoUrl') }, | ||
}), | ||
) | ||
//cy.get('[data-test="groups"]').click() | ||
}) | ||
it('Switch should reveal hidden types', () => { | ||
cy.get('[data-test="table-cell-application"]').should('not.exist') | ||
cy.get('[data-test="hidden-type-switch"]') | ||
.click() | ||
.then(() => { | ||
cy.get('[data-test="table-cell-application"]').should('exist') | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
apps/sensenet/src/components/content-list/contenttype-list.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import React, { lazy, useState } from 'react' | ||
import { PATHS } from '../../application-paths' | ||
import { Switch } from '@sensenet/controls-react' | ||
import { useRepository } from '@sensenet/hooks-react' | ||
|
||
const ContentComponent = lazy(() => import(/* webpackChunkName: "content" */ '../content')) | ||
|
||
const ContentTypeList: React.FC = () => { | ||
const repository = useRepository() | ||
const [showHiddenTypes, setShowHiddenTypes] = useState(false) | ||
const categoryField = repository.schemas.getFieldTypeByName('Categories') | ||
const isCategoryFieldAvailable = categoryField !== undefined | ||
|
||
const renderBeforeGrid = () => { | ||
if (!isCategoryFieldAvailable) { | ||
return <></> | ||
} | ||
|
||
return ( | ||
<div style={{ marginTop: '20px', marginBottom: '20px' }}> | ||
<label htmlFor="showHiddenTypes" style={{ marginRight: '10px' }}> | ||
Show hidden types | ||
</label> | ||
<Switch | ||
data-test="hidden-type-switch" | ||
size="medium" | ||
checked={showHiddenTypes} | ||
onChange={() => setShowHiddenTypes(!showHiddenTypes)} | ||
/> | ||
</div> | ||
) | ||
} | ||
|
||
const contentTypeQuery = | ||
"+TypeIs:'ContentType'" + | ||
(isCategoryFieldAvailable && !showHiddenTypes ? ' -Categories:*HideByDefault*' : '') + | ||
' .AUTOFILTERS:OFF' | ||
|
||
return ( | ||
<ContentComponent | ||
renderBeforeGrid={renderBeforeGrid} | ||
rootPath={PATHS.contentTypes.snPath} | ||
fieldsToDisplay={[ | ||
{ field: 'DisplayName' }, | ||
{ field: 'Name' }, | ||
{ field: 'Description' }, | ||
{ field: 'ParentTypeName' as any }, | ||
{ field: 'ModificationDate' }, | ||
{ field: 'ModifiedBy' }, | ||
]} | ||
loadChildrenSettings={{ | ||
select: ['DisplayName', 'Name', 'Description', 'ParentTypeName' as any, 'ModificationDate', 'ModifiedBy'], | ||
query: contentTypeQuery, | ||
inlinecount: 'allpages', | ||
top: 1000, | ||
}} | ||
hasTree={false} | ||
alwaysRefreshChildren={true} | ||
/> | ||
) | ||
} | ||
|
||
export default ContentTypeList |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.