diff --git a/ui/src/app/(index)/page.tsx b/ui/src/app/(index)/page.tsx index 53d60650..e9f8b9a5 100644 --- a/ui/src/app/(index)/page.tsx +++ b/ui/src/app/(index)/page.tsx @@ -3,10 +3,10 @@ import BeforeLogin from '@/components/home/BeforeLogin'; import AfterLogin from '@/components/home/AfterLogin'; import {getCurrentUser} from '@/access/AuthenticationService'; import Role from '@/access/Role'; -import LoginButton from "@/components/home/LoginButton"; -import {getAnnouncements, getNumberOfGroupings, getNumberOfMemberships} from "@/services/GroupingsApiService"; -import React from "react"; -import Announcement from "@/components/home/Announcement"; +import LoginButton from '@/components/home/LoginButton'; +import {getAnnouncements, getNumberOfGroupings, getNumberOfMemberships} from '@/services/GroupingsApiService'; +import React from 'react'; +import Announcement from '@/components/home/Announcement'; const Home = async () => { const [currentUser, numberOfGroupings, numberOfMemberships, announcements] = await Promise.all([ @@ -16,15 +16,21 @@ const Home = async () => { getAnnouncements() ]); - const handleAnnouncements = () => announcements.hasOwnProperty("announcements") ? announcements.announcements - .filter((announcement) => announcement.state === "Active") - .map((announcement) => announcement.message) : []; + const handleAnnouncements = () => { + if (Object.prototype.hasOwnProperty.call(announcements, 'announcements')) { + return announcements.announcements + .filter((announcement) => announcement.state !== 'Active') + .map((announcement) => announcement.message); + } else { + return []; + } + }; return (
- {handleAnnouncements().map((announcement: String) => ( -
+ {handleAnnouncements().map((announcement: string, index: number) => ( +
))} @@ -60,8 +66,10 @@ const Home = async () => {
{currentUser && currentUser.roles.includes(Role.UH) ? ( - + ) : ( )} diff --git a/ui/src/components/UHGroupingsInfo.tsx b/ui/src/components/UHGroupingsInfo.tsx index 7e2c9eee..88aa7930 100644 --- a/ui/src/components/UHGroupingsInfo.tsx +++ b/ui/src/components/UHGroupingsInfo.tsx @@ -1,10 +1,8 @@ -import React from "react"; -import Image from "next/image"; -import About from "@/app/about/page"; -import AboutInfoItem from "@/components/AboutInfoItem"; +import React from 'react'; +import AboutInfoItem from '@/components/AboutInfoItem'; const UHGroupingsInfo = ({h1Color, h1Weight, AboutInfoItemSize}: { h1Color: string, h1Weight: string, AboutInfoItemSize?: string }) => { - const textSize = AboutInfoItemSize ? AboutInfoItemSize : "text-base"; + const textSize = AboutInfoItemSize ? AboutInfoItemSize : 'text-base'; return (
@@ -20,17 +18,20 @@ const UHGroupingsInfo = ({h1Color, h1Weight, AboutInfoItemSize}: { h1Color: stri pSize={textSize} src={"/uhgroupings/cogs.svg"} alt={"Cogs icon"} - description={"Create groupings, manage grouping memberships, control members' self-service options, designate sync destinations, and more."}/> + description={"Create groupings, manage grouping memberships, control members' " + + "self-service options, designate sync destinations, and more."}/> + description={"Synchronize groupings email LISTSERV lists," + + " attributes for access control via CAS and LDAP, etc.."}/> + description={"Leverage group data from official sources," + + " which can substantially reduce the manual overhead of membership management."}/>
diff --git a/ui/src/components/home/AfterLogin.tsx b/ui/src/components/home/AfterLogin.tsx index c8ad17f0..9bcaf885 100644 --- a/ui/src/components/home/AfterLogin.tsx +++ b/ui/src/components/home/AfterLogin.tsx @@ -1,22 +1,23 @@ -import User from "@/access/User"; -import Role from "@/access/Role"; +import User from '@/access/User'; +import Role from '@/access/Role'; import Image from 'next/image'; -import React from "react"; -import {KeyRound} from "lucide-react"; -import UserInfoItem from "@/components/home/UserInfoItem"; +import React from 'react'; +import {KeyRound} from 'lucide-react'; +import UserInfoItem from '@/components/home/UserInfoItem'; -const AfterLogin = ({ - currentUser, - numberOfGroupings, - numberOfMemberships - }: { - currentUser: User, - numberOfGroupings: number, - numberOfMemberships: number -}) => { +const AfterLogin = ( + { + currentUser, + numberOfGroupings, + numberOfMemberships + }: { + currentUser: User, + numberOfGroupings: number, + numberOfMemberships: number + }) => { const isAdmin = currentUser.roles.includes(Role.ADMIN); const isOwner = currentUser.roles.includes(Role.OWNER); - const getHighestRole = () => isAdmin ? "Admin" : isOwner ? "Owner" : "Member"; + const getHighestRole = () => isAdmin ? 'Admin' : isOwner ? 'Owner' : 'Member'; return (
@@ -24,8 +25,7 @@ const AfterLogin = ({
-
+
user-solid {isAdmin && { return (
- +
diff --git a/ui/src/components/home/UserInfoItem.tsx b/ui/src/components/home/UserInfoItem.tsx index 5ed034a7..750d1cc4 100644 --- a/ui/src/components/home/UserInfoItem.tsx +++ b/ui/src/components/home/UserInfoItem.tsx @@ -1,20 +1,28 @@ import React from 'react'; import Image from 'next/image'; import Link from 'next/link'; -import {Button} from "@/components/ui/button"; +import {Button} from '@/components/ui/button'; const UserInfoItem = ( - {alt, src, number, show, title, description, link, text}: - { - alt: string, - src: string, - number: number, - show: boolean, - title: string, - description: string, - link: string, - text: string - }) => { + { + alt, + src, + number, + show, + title, + description, + link, + text + }: { + alt: string, + src: string, + number: number, + show: boolean, + title: string, + description: string, + link: string, + text: string + }) => { return (