Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: few more bugs on new ui #3274

Merged
merged 6 commits into from
Sep 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ui/components/grant-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ export default function GrantForm({ grants, roles, onSubmit = () => {} }) {
<Combobox.Input
className={`block w-full rounded-md border-gray-300 text-xs shadow-sm focus:border-blue-500 focus:ring-blue-500`}
placeholder='User or group'
onChange={e => setQuery(e.target.value)}
onChange={e => {
setQuery(e.target.value)
if (e.target.value.length === 0) {
setSelected(null)
}
}}
onFocus={() => {
if (!selected) {
button.current?.click()
Expand Down
36 changes: 23 additions & 13 deletions ui/components/layouts/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,13 @@ function Layout({ children }) {
},
]

const subNavigation = [{ name: 'Account', href: '/account' }]
const subNavigation = [
{
name: 'Account',
href: '/account',
show: auth?.providerNames.includes('infra'),
hoyyeva marked this conversation as resolved.
Show resolved Hide resolved
},
]

for (const n of [...navigation]) {
if (router.pathname.startsWith(n.href) && n.admin && !admin) {
Expand Down Expand Up @@ -208,7 +214,7 @@ function Layout({ children }) {

{/* Main content */}
<div className='mx-auto flex min-w-0 flex-1 flex-col'>
<div className='sticky top-0 z-50 flex flex-shrink-0 border-b border-gray-100 bg-white/90 py-3 px-6 pl-2 backdrop-blur-lg md:py-2 md:px-6'>
<div className='sticky top-0 z-10 flex flex-shrink-0 border-b border-gray-100 bg-white/90 py-3 px-6 pl-2 backdrop-blur-lg md:py-2 md:px-6'>
<button
type='button'
className='px-4 text-black focus:outline-none focus:ring-2 focus:ring-inset focus:ring-blue-500 md:hidden'
Expand Down Expand Up @@ -245,17 +251,21 @@ function Layout({ children }) {
{auth?.name}
</p>
</div>
<div className='py-1'>
{subNavigation.map(item => (
<Menu.Item key={item.name}>
<NavLink href={item.href}>
<p className='block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100'>
{item.name}
</p>
</NavLink>
</Menu.Item>
))}
</div>
{subNavigation?.filter(n => n.show).length > 0 && (
<div className='py-1'>
{subNavigation
?.filter(n => n.show)
.map(item => (
<Menu.Item key={item.name}>
<NavLink href={item.href}>
<p className='block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100'>
{item.name}
</p>
</NavLink>
</Menu.Item>
))}
</div>
)}
<div className='py-1'>
<Menu.Item>
<button
Expand Down
Loading