From 5009d23e1ea44805ceffd32831777a8972164d68 Mon Sep 17 00:00:00 2001 From: Eva Ho Date: Mon, 19 Sep 2022 21:37:42 -0400 Subject: [PATCH 1/6] fix: few more bugs --- ui/components/grant-form.js | 7 ++++++- ui/components/layouts/dashboard.js | 2 +- ui/pages/signup/index.js | 12 ++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ui/components/grant-form.js b/ui/components/grant-form.js index df6599d2a1..81d7d61a05 100644 --- a/ui/components/grant-form.js +++ b/ui/components/grant-form.js @@ -66,7 +66,12 @@ export default function GrantForm({ grants, roles, onSubmit = () => {} }) { setQuery(e.target.value)} + onChange={e => { + setQuery(e.target.value) + if (e.target.value.length === 0) { + setSelected(null) + } + }} onFocus={() => { if (!selected) { button.current?.click() diff --git a/ui/components/layouts/dashboard.js b/ui/components/layouts/dashboard.js index b3deabcd2d..3f621f6c96 100644 --- a/ui/components/layouts/dashboard.js +++ b/ui/components/layouts/dashboard.js @@ -208,7 +208,7 @@ function Layout({ children }) { {/* Main content */}
-
+
- {errors.domain && } + {errors['org.subdomain'] && ( + + )}
- - + + {kind === 'google' && ( +
+
+

+ Optional information for Google Groups +

+
+ + learn more + +
+
+
+
+ + + + {errors.privatekey && ( + + )} +
+
+ + { + setDomainAdminEmail(e.target.value) + setErrors({}) + setError('') + }} + className={`mt-1 block w-full rounded-md shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm ${ + errors.domainadminemail + ? 'border-red-500' + : 'border-gray-300' + }`} + /> + {errors.domainadminemail && ( + + )} +
+
+
+ )} + {error && } + +
+ +
+ + ) } From 80d7b212e8e1e715eee5fd9f3bd770ca37d1e04e Mon Sep 17 00:00:00 2001 From: Eva Ho Date: Mon, 19 Sep 2022 21:57:14 -0400 Subject: [PATCH 3/6] fix: provider table formatting --- ui/pages/providers/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/pages/providers/index.js b/ui/pages/providers/index.js index 32f5141e2b..389a6499c1 100644 --- a/ui/pages/providers/index.js +++ b/ui/pages/providers/index.js @@ -64,11 +64,13 @@ export default function Providers() { }, { cell: info => ( -
+
{info.getValue() ? dayjs(info.getValue()).fromNow() : '-'}
), - header: () => Added, + header: () => ( + Added + ), accessorKey: 'created', }, { From b3ff529d264c3a5c8d90be77b5914efc1603a4fb Mon Sep 17 00:00:00 2001 From: Eva Ho Date: Mon, 19 Sep 2022 21:58:20 -0400 Subject: [PATCH 4/6] fix: build --- ui/pages/providers/add.js | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/pages/providers/add.js b/ui/pages/providers/add.js index f66bd2d6b7..f3d373739f 100644 --- a/ui/pages/providers/add.js +++ b/ui/pages/providers/add.js @@ -1,7 +1,6 @@ import { useEffect, useState } from 'react' import { useRouter } from 'next/router' import Head from 'next/head' -import Link from 'next/link' import { useSWRConfig } from 'swr' import { InformationCircleIcon } from '@heroicons/react/outline' From 7e1b3da06aa4db127732ad6ea9b416aad0ee823b Mon Sep 17 00:00:00 2001 From: Eva Ho Date: Tue, 20 Sep 2022 11:01:14 -0400 Subject: [PATCH 5/6] fix: hide account when the user is not login as local infra user --- ui/components/layouts/dashboard.js | 34 +++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/ui/components/layouts/dashboard.js b/ui/components/layouts/dashboard.js index 3f621f6c96..5504df99ea 100644 --- a/ui/components/layouts/dashboard.js +++ b/ui/components/layouts/dashboard.js @@ -141,7 +141,13 @@ function Layout({ children }) { }, ] - const subNavigation = [{ name: 'Account', href: '/account' }] + const subNavigation = [ + { + name: 'Account', + href: '/account', + show: auth?.providerNames.includes('infra'), + }, + ] for (const n of [...navigation]) { if (router.pathname.startsWith(n.href) && n.admin && !admin) { @@ -245,17 +251,21 @@ function Layout({ children }) { {auth?.name}

-
- {subNavigation.map(item => ( - - -

- {item.name} -

-
-
- ))} -
+ {subNavigation?.filter(n => n.show === true).length > 0 && ( +
+ {subNavigation + ?.filter(n => n.show === true) + .map(item => ( + + +

+ {item.name} +

+
+
+ ))} +
+ )}
- {subNavigation?.filter(n => n.show === true).length > 0 && ( + {subNavigation?.filter(n => n.show).length > 0 && (
{subNavigation - ?.filter(n => n.show === true) + ?.filter(n => n.show) .map(item => (