From 6e26446bf278a1d14032f737c7a482106979022c Mon Sep 17 00:00:00 2001 From: Will Nilges Date: Tue, 3 Nov 2020 23:43:19 -0500 Subject: [PATCH 1/4] Make buttons colorful and center justified --- client/.env | 2 +- client/src/components/NavBar/NavBar.tsx | 2 ++ client/src/components/Pages/Result/index.tsx | 2 +- client/src/components/Pages/Vote/index.tsx | 21 ++++++++++++++++++-- client/src/components/Pages/Vote/vote.css | 8 +++++++- service/index.ts | 2 +- 6 files changed, 31 insertions(+), 6 deletions(-) diff --git a/client/.env b/client/.env index 3602047..b7e58cb 100644 --- a/client/.env +++ b/client/.env @@ -1,3 +1,3 @@ REACT_APP_SSO_CLIENT_ID=vote REACT_APP_SSO_AUTHORITY=https://sso.csh.rit.edu/auth/realms/csh -REACT_APP_BASE_API_URL=https://vote.csh.rit.edu \ No newline at end of file +REACT_APP_BASE_API_URL=http://localhost:8080 diff --git a/client/src/components/NavBar/NavBar.tsx b/client/src/components/NavBar/NavBar.tsx index 89c7627..33ff581 100644 --- a/client/src/components/NavBar/NavBar.tsx +++ b/client/src/components/NavBar/NavBar.tsx @@ -24,6 +24,8 @@ const NavBar: React.FunctionComponent = () => { } + //debug + evals = true; return (
diff --git a/client/src/components/Pages/Result/index.tsx b/client/src/components/Pages/Result/index.tsx index ecc86aa..296f6bf 100644 --- a/client/src/components/Pages/Result/index.tsx +++ b/client/src/components/Pages/Result/index.tsx @@ -22,7 +22,7 @@ export const Result: React.FunctionComponent = () =>{ const [ended, setEnded] = useState(false); let history = useHistory(); const { oidcUser } = useReactOidc(); - const evals = oidcUser.profile.groups.includes("eboard-evaluations"); + const evals = true oidcUser.profile.groups.includes("eboard-evaluations"); useEffect(() => { const interval = setInterval(() => { if(!ended) { diff --git a/client/src/components/Pages/Vote/index.tsx b/client/src/components/Pages/Vote/index.tsx index 9bb4076..f6bb51e 100644 --- a/client/src/components/Pages/Vote/index.tsx +++ b/client/src/components/Pages/Vote/index.tsx @@ -11,6 +11,7 @@ type Poll = { _id: string, title: string, choices: Array, + type: string, } export const Vote: React.FunctionComponent = () =>{ @@ -88,8 +89,24 @@ export const Vote: React.FunctionComponent = () =>{
{poll.title}
{poll.choices.map(function(option, idx){ - return (
  • ) - })} + if (poll.type === "Conditional") { + return (
  • ); + } + switch(option) { + case "Pass": + return (
  • ); + case "Conditional": + return (
  • ); + case "Fail or Conditional": + return (
  • ); + case "Fail": + return (
  • ); + case "Abstain": + return (
  • ); + default: + return (
  • ); + } + })}
    diff --git a/client/src/components/Pages/Vote/vote.css b/client/src/components/Pages/Vote/vote.css index c45372c..9391e12 100644 --- a/client/src/components/Pages/Vote/vote.css +++ b/client/src/components/Pages/Vote/vote.css @@ -15,11 +15,17 @@ font-size: 14px; padding:12px; padding-right: 16px; + display: flex; + flex-direction: row; + justify-content: center; + flex-flow: wrap; } .poll-options-items li { list-style: none; padding-top: 12px; + padding-left: 12px; + padding-right: 12px; } .poll-list-button { @@ -40,4 +46,4 @@ .submit-button { font-size: 14px; -} \ No newline at end of file +} diff --git a/service/index.ts b/service/index.ts index 27b5364..1f029bc 100644 --- a/service/index.ts +++ b/service/index.ts @@ -85,7 +85,7 @@ app.use(cors()); let currentPolls = [ { title: "test Poll", - choices: ["fail", "conditional", "abstain"], + choices: ["Fail", "Conditional", "Abstain"], type: "FailConditional", _id: "5f9b2d5d601e1c6971430638", }, From 5fab85109442f54eacaabfbccb5611a854191401 Mon Sep 17 00:00:00 2001 From: Will Nilges Date: Wed, 4 Nov 2020 00:26:26 -0500 Subject: [PATCH 2/4] Remove debug statements --- client/.env | 2 +- client/src/components/NavBar/NavBar.tsx | 3 --- client/src/components/Pages/Result/index.tsx | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/client/.env b/client/.env index b7e58cb..b5254bc 100644 --- a/client/.env +++ b/client/.env @@ -1,3 +1,3 @@ REACT_APP_SSO_CLIENT_ID=vote REACT_APP_SSO_AUTHORITY=https://sso.csh.rit.edu/auth/realms/csh -REACT_APP_BASE_API_URL=http://localhost:8080 +REACT_APP_BASE_API_URL=http://vote.csh.rit.edu diff --git a/client/src/components/NavBar/NavBar.tsx b/client/src/components/NavBar/NavBar.tsx index 33ff581..b6818d6 100644 --- a/client/src/components/NavBar/NavBar.tsx +++ b/client/src/components/NavBar/NavBar.tsx @@ -24,9 +24,6 @@ const NavBar: React.FunctionComponent = () => { } - //debug - evals = true; - return (
    diff --git a/client/src/components/Pages/Result/index.tsx b/client/src/components/Pages/Result/index.tsx index 296f6bf..ecc86aa 100644 --- a/client/src/components/Pages/Result/index.tsx +++ b/client/src/components/Pages/Result/index.tsx @@ -22,7 +22,7 @@ export const Result: React.FunctionComponent = () =>{ const [ended, setEnded] = useState(false); let history = useHistory(); const { oidcUser } = useReactOidc(); - const evals = true oidcUser.profile.groups.includes("eboard-evaluations"); + const evals = oidcUser.profile.groups.includes("eboard-evaluations"); useEffect(() => { const interval = setInterval(() => { if(!ended) { From 9c7a55324dcaa3bea7121d09eada0e5bbea0afdf Mon Sep 17 00:00:00 2001 From: Will Nilges Date: Sat, 21 Nov 2020 20:41:10 -0500 Subject: [PATCH 3/4] Reduce verbosity --- client/.env | 3 ++- client/src/components/Pages/Vote/index.tsx | 21 ++++++++++++++------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/client/.env b/client/.env index b5254bc..2bee85c 100644 --- a/client/.env +++ b/client/.env @@ -1,3 +1,4 @@ REACT_APP_SSO_CLIENT_ID=vote REACT_APP_SSO_AUTHORITY=https://sso.csh.rit.edu/auth/realms/csh -REACT_APP_BASE_API_URL=http://vote.csh.rit.edu +REACT_APP_BASE_API_URL=https://vote.csh.rit.edu + diff --git a/client/src/components/Pages/Vote/index.tsx b/client/src/components/Pages/Vote/index.tsx index f6bb51e..9d52c32 100644 --- a/client/src/components/Pages/Vote/index.tsx +++ b/client/src/components/Pages/Vote/index.tsx @@ -92,20 +92,27 @@ export const Vote: React.FunctionComponent = () =>{ if (poll.type === "Conditional") { return (
  • ); } + + let btnClass = "btn btn-primary poll-option-button "; switch(option) { case "Pass": - return (
  • ); + btnClass += "btn-success"; + break; case "Conditional": - return (
  • ); + btnClass += "btn-warning"; + break; case "Fail or Conditional": - return (
  • ); + btnClass += "btn-warning"; + break; case "Fail": - return (
  • ); + btnClass += "btn-danger"; + break; case "Abstain": - return (
  • ); - default: - return (
  • ); + btnClass += "btn-secondary"; + break; } + + return (
  • ); })}
    From 682c90fc0d7a9b0aa149151bd5dcea84402d7b7a Mon Sep 17 00:00:00 2001 From: Max Meinhold Date: Sat, 10 Apr 2021 15:46:12 -0400 Subject: [PATCH 4/4] Fix client ci --- .github/workflows/client.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/client.yaml b/.github/workflows/client.yaml index 3399aeb..a0499e0 100644 --- a/.github/workflows/client.yaml +++ b/.github/workflows/client.yaml @@ -19,11 +19,6 @@ jobs: matrix: node-version: [ 12.x ] - # Run all `run` commands in the cliend directory - defaults: - run: - working-directory: client - steps: - uses: actions/checkout@v2 @@ -41,5 +36,10 @@ jobs: - name: Install dependencies run: npm ci + - name: Install client dependencies + run: npm ci + working-directory: client + - name: Lint run: npm run lint + working-directory: client