CTLE-214: dot menu bug fixes and updates

This commit is contained in:
Tim Chamberlain
2023-07-03 16:43:18 -05:00
parent 283c3c7413
commit e9f8684b82
5 changed files with 21 additions and 60 deletions

View File

@ -77,7 +77,7 @@
<dependency> <dependency>
<groupId>org.seleniumhq.selenium</groupId> <groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId> <artifactId>selenium-java</artifactId>
<version>4.7.1</version> <version>4.10.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -53,7 +53,7 @@ const CommandMenu = ({metaData}: Props) =>
// if a dot pressed, not from a "text" element, then toggle command menu // // if a dot pressed, not from a "text" element, then toggle command menu //
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
const type = (e.target as any).type; const type = (e.target as any).type;
if (e.key === "." && type !== "text") if (e.key === "." && type !== "text" && type !== "textarea" && type !== "input" && type !== "search")
{ {
e.preventDefault(); e.preventDefault();
setDotMenuOpen(!dotMenuOpen); setDotMenuOpen(!dotMenuOpen);
@ -173,6 +173,7 @@ const CommandMenu = ({metaData}: Props) =>
)) ))
) )
} }
<Command.Separator />
</Command.Group> </Command.Group>
); );
} }
@ -201,6 +202,7 @@ const CommandMenu = ({metaData}: Props) =>
) )
) )
} }
<Command.Separator />
</Command.Group> </Command.Group>
); );
} }
@ -231,6 +233,7 @@ const CommandMenu = ({metaData}: Props) =>
) )
) )
} }
<Command.Separator />
</Command.Group> </Command.Group>
); );
} }
@ -281,11 +284,8 @@ const CommandMenu = ({metaData}: Props) =>
<Command.List> <Command.List>
<Command.Empty>No results found.</Command.Empty> <Command.Empty>No results found.</Command.Empty>
<ActionsSection /> <ActionsSection />
<Command.Separator />
<TablesSection /> <TablesSection />
<Command.Separator />
<AppsSection /> <AppsSection />
<Command.Separator />
<RecentlyViewedSection /> <RecentlyViewedSection />
</Command.List> </Command.List>
</Command.Dialog> </Command.Dialog>

View File

@ -150,31 +150,34 @@ function RecordView({table, launchProcess}: Props): JSX.Element
})(); })();
} }
const down = (e: { key: string; metaKey: any; ctrlKey: any; preventDefault: () => void; }) => const down = (e: KeyboardEvent) =>
{ {
if(!dotMenuOpen) const type = (e.target as any).type;
const validType = (type !== "text" && type !== "textarea" && type !== "input" && type !== "search");
if(validType && !dotMenuOpen && !showAudit && !showEditChildForm)
{ {
if (e.key === "n" && table.capabilities.has(Capability.TABLE_INSERT) && table.insertPermission) if (! e.metaKey && e.key === "n" && table.capabilities.has(Capability.TABLE_INSERT) && table.insertPermission)
{ {
e.preventDefault() e.preventDefault()
gotoCreate(); gotoCreate();
} }
else if (e.key === "e" && table.capabilities.has(Capability.TABLE_UPDATE) && table.editPermission) else if (! e.metaKey && e.key === "e" && table.capabilities.has(Capability.TABLE_UPDATE) && table.editPermission)
{ {
e.preventDefault() e.preventDefault()
navigate("edit"); navigate("edit");
} }
else if (e.key === "c" && table.capabilities.has(Capability.TABLE_INSERT) && table.insertPermission) else if (! e.metaKey && e.key === "c" && table.capabilities.has(Capability.TABLE_INSERT) && table.insertPermission)
{ {
e.preventDefault() e.preventDefault()
navigate("copy"); navigate("copy");
} }
else if (e.key === "d" && table.capabilities.has(Capability.TABLE_DELETE) && table.deletePermission) else if (! e.metaKey && e.key === "d" && table.capabilities.has(Capability.TABLE_DELETE) && table.deletePermission)
{ {
e.preventDefault() e.preventDefault()
handleClickDeleteButton(); handleClickDeleteButton();
} }
else if (e.key === "a" && metaData && metaData.tables.has("audit")) else if (! e.metaKey && e.key === "a" && metaData && metaData.tables.has("audit"))
{ {
e.preventDefault() e.preventDefault()
navigate("#audit"); navigate("#audit");
@ -187,7 +190,7 @@ function RecordView({table, launchProcess}: Props): JSX.Element
{ {
document.removeEventListener("keydown", down) document.removeEventListener("keydown", down)
} }
}, [dotMenuOpen]) }, [dotMenuOpen, showEditChildForm, showAudit])
const gotoCreate = () => const gotoCreate = () =>
{ {

View File

@ -1,45 +1,3 @@
html,
body {
padding: 0;
margin: 0;
font-family: var(--font-sans);
}
body {
background: var(--app-bg);
overflow-x: hidden;
}
button {
background: none;
font-family: var(--font-sans);
padding: 0;
border: 0;
}
h1,
h2,
h3,
h4,
h5,
h6,
p {
margin: 0;
}
a {
color: inherit;
text-decoration: none;
}
*,
*::after,
*::before {
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
:root { :root {
--font-sans: 'Inter', --apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, --font-sans: 'Inter', --apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans,
Droid Sans, Helvetica Neue, sans-serif; Droid Sans, Helvetica Neue, sans-serif;

View File

@ -281,15 +281,15 @@
[cmdk-group-heading] { [cmdk-group-heading] {
user-select: none; user-select: none;
font-size: 12px; font-size: 14px;
font-weight: bold;
color: var(--gray11); color: var(--gray11);
padding: 0 8px; padding: 0 8px;
display: flex; display: flex;
align-items: center; align-items: center;
position:sticky; position: sticky;
top: -1; top: 0px;
padding-bottom: 4px; padding-bottom: 7px;
border-bottom: var(--gray6) 1px solid;
background: white; background: white;
z-index: 1; z-index: 1;
} }