Fix/record group index and seed (#9605)
- [x] [Disable group by on default view Options menu](https://discord.com/channels/1130383047699738754/1328421803399446568) - [x] Add default seed for view group
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { Key } from 'ts-key-enum';
|
||||
import {
|
||||
AppTooltip,
|
||||
IconFileExport,
|
||||
IconFileImport,
|
||||
IconLayout,
|
||||
@ -55,6 +56,10 @@ export const ObjectOptionsDropdownMenuContent = () => {
|
||||
recordGroupFieldMetadataComponentState,
|
||||
);
|
||||
|
||||
const isGroupByEnabled =
|
||||
(isDefined(currentView?.viewGroups) && currentView.viewGroups.length > 0) ||
|
||||
currentView?.key !== 'INDEX';
|
||||
|
||||
useScopedHotkeys(
|
||||
[Key.Escape],
|
||||
() => {
|
||||
@ -115,20 +120,34 @@ export const ObjectOptionsDropdownMenuContent = () => {
|
||||
contextualText={`${visibleBoardFields.length} shown`}
|
||||
hasSubMenu
|
||||
/>
|
||||
{viewType === ViewType.Kanban ||
|
||||
(currentView?.key !== 'INDEX' && (
|
||||
<MenuItem
|
||||
onClick={() =>
|
||||
isDefined(recordGroupFieldMetadata)
|
||||
? onContentChange('recordGroups')
|
||||
: onContentChange('recordGroupFields')
|
||||
}
|
||||
LeftIcon={IconLayoutList}
|
||||
text="Group by"
|
||||
contextualText={recordGroupFieldMetadata?.label}
|
||||
hasSubMenu
|
||||
/>
|
||||
))}
|
||||
|
||||
<div id="group-by-menu-item">
|
||||
<MenuItem
|
||||
onClick={() =>
|
||||
isDefined(recordGroupFieldMetadata)
|
||||
? onContentChange('recordGroups')
|
||||
: onContentChange('recordGroupFields')
|
||||
}
|
||||
LeftIcon={IconLayoutList}
|
||||
text="Group by"
|
||||
contextualText={
|
||||
!isGroupByEnabled
|
||||
? 'Not available on Default View'
|
||||
: recordGroupFieldMetadata?.label
|
||||
}
|
||||
hasSubMenu
|
||||
disabled={!isGroupByEnabled}
|
||||
/>
|
||||
</div>
|
||||
{!isGroupByEnabled && (
|
||||
<AppTooltip
|
||||
anchorSelect={`#group-by-menu-item`}
|
||||
content="Not available on Default View"
|
||||
noArrow
|
||||
place="bottom"
|
||||
width="100%"
|
||||
/>
|
||||
)}
|
||||
</DropdownMenuItemsContainer>
|
||||
<DropdownMenuSeparator />
|
||||
<DropdownMenuItemsContainer>
|
||||
|
||||
Reference in New Issue
Block a user