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 diff --git a/client/.env b/client/.env index 3602047..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=https://vote.csh.rit.edu \ No newline at end of file +REACT_APP_BASE_API_URL=https://vote.csh.rit.edu + diff --git a/client/src/components/NavBar/NavBar.tsx b/client/src/components/NavBar/NavBar.tsx index 89c7627..b6818d6 100644 --- a/client/src/components/NavBar/NavBar.tsx +++ b/client/src/components/NavBar/NavBar.tsx @@ -24,7 +24,6 @@ const NavBar: React.FunctionComponent = () => { } - return (
diff --git a/client/src/components/Pages/Vote/index.tsx b/client/src/components/Pages/Vote/index.tsx index 9bb4076..9d52c32 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,31 @@ export const Vote: React.FunctionComponent = () =>{
{poll.title}
{poll.choices.map(function(option, idx){ - return (
  • ) - })} + if (poll.type === "Conditional") { + return (
  • ); + } + + let btnClass = "btn btn-primary poll-option-button "; + switch(option) { + case "Pass": + btnClass += "btn-success"; + break; + case "Conditional": + btnClass += "btn-warning"; + break; + case "Fail or Conditional": + btnClass += "btn-warning"; + break; + case "Fail": + btnClass += "btn-danger"; + break; + case "Abstain": + btnClass += "btn-secondary"; + break; + } + + 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", },