-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1147 from bcgov/dev
chore: release
- Loading branch information
Showing
47 changed files
with
724 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,4 @@ CONTRIBUTING.md | |
LICENSE | ||
*.lock | ||
node_modules | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: E2E Smoke Test | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
logLevel: | ||
description: 'Log level' | ||
required: true | ||
default: 'warning' | ||
type: choice | ||
options: | ||
- info | ||
- warning | ||
- debug | ||
# Only trigger, when the build workflow succeeded | ||
workflow_run: | ||
workflows: | ||
- Terraform | ||
branches: | ||
- dev | ||
types: | ||
- completed | ||
|
||
jobs: | ||
trigger-remote-workflow: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Start Test in sso-requests-e2e repo | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
env: | ||
GITHUB_CONTEXT: ${{ toJSON(github) }} | ||
run: | | ||
echo "$GITHUB_CONTEXT" | ||
curl \ | ||
-X POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "Authorization: token ${{ secrets.GH_ACCESS_TOKEN }}" \ | ||
https://api.github.com/repos/bcgov/sso-requests-e2e/actions/workflows/main-e2e.yml/dispatches \ | ||
-d '{"ref":"main", "inputs":{"smoketest":"true"}}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM docker.io/hashicorp/terraform:latest | ||
|
||
RUN apk add --no-cache curl | ||
|
||
# Set working directory | ||
WORKDIR /terraform | ||
|
||
COPY /local/terraform/ . | ||
COPY /local/tf-migration-entrypoint.sh /tmp/tf-migration-entrypoint.sh | ||
|
||
RUN chmod +x /tmp/tf-migration-entrypoint.sh | ||
|
||
ENTRYPOINT ["/tmp/tf-migration-entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
import { ReactNode, useEffect, useState } from 'react'; | ||
import styled from 'styled-components'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { faChevronLeft, faChevronRight } from '@fortawesome/free-solid-svg-icons'; | ||
import useWindowDimensions from '@app/hooks/useWindowDimensions'; | ||
|
||
interface Props { | ||
viewableItems: number; | ||
children: ReactNode[]; | ||
} | ||
|
||
const Container = styled.div<{ viewableItems: number; index: number; totalItems: number }>` | ||
width: 100%; | ||
.outer-window { | ||
padding: 1em 0; | ||
width: 100%; | ||
overflow-x: hidden; | ||
white-space: nowrap; | ||
.inner-window { | ||
transform: translate(-${(props) => (100 / props.viewableItems) * props.index}%); | ||
transition: transform 400ms ease-in-out; | ||
.item-container { | ||
display: inline-block; | ||
vertical-align: top; | ||
width: calc(100% / ${(props) => props.viewableItems}); | ||
padding: 0 0.5em; | ||
white-space: wrap; | ||
} | ||
} | ||
} | ||
.controls { | ||
text-align: center; | ||
margin: 1em 0; | ||
.arrow-left { | ||
margin-right: 0.5em; | ||
cursor: ${(props) => (props.index === 0 ? 'not-allowed' : 'pointer')}; | ||
color: ${(props) => (props.index === 0 ? 'grey' : '#036')}; | ||
} | ||
.arrow-right { | ||
margin-left: 0.5em; | ||
cursor: ${(props) => (props.index === props.totalItems - props.viewableItems ? 'not-allowed' : 'pointer')}; | ||
color: ${(props) => (props.index === props.totalItems - props.viewableItems ? 'grey' : '#036')}; | ||
} | ||
} | ||
`; | ||
|
||
export default function Carousel({ viewableItems, children }: Readonly<Props>) { | ||
const [carouselIndex, setCarouselIndex] = useState(0); | ||
const { width } = useWindowDimensions(); | ||
|
||
const moveCarousel = (direction: 'left' | 'right') => { | ||
if (direction === 'left') { | ||
if (carouselIndex <= 0) return; | ||
setCarouselIndex(carouselIndex - 1); | ||
} else { | ||
if (carouselIndex >= children.length - viewableItems) return; | ||
setCarouselIndex(carouselIndex + 1); | ||
} | ||
}; | ||
|
||
useEffect(() => { | ||
// Adjust index if browser width changes | ||
if (carouselIndex >= children.length - viewableItems) { | ||
setCarouselIndex(children.length - viewableItems); | ||
} | ||
}, [width]); | ||
|
||
return ( | ||
<Container viewableItems={viewableItems} index={carouselIndex} totalItems={children.length}> | ||
<div className="outer-window"> | ||
<div className="inner-window"> | ||
{children.map((child) => ( | ||
<div className="item-container" key={(child as any).key}> | ||
{child} | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
{children.length > viewableItems && ( | ||
<div className="controls"> | ||
<FontAwesomeIcon | ||
icon={faChevronLeft} | ||
size="2x" | ||
className="arrow arrow-left" | ||
onClick={() => moveCarousel('left')} | ||
/> | ||
<FontAwesomeIcon | ||
icon={faChevronRight} | ||
size="2x" | ||
className="arrow arrow-right" | ||
onClick={() => moveCarousel('right')} | ||
/> | ||
</div> | ||
)} | ||
</Container> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import { ITestimonial } from '@app/interfaces/Testimonial'; | ||
import styled from 'styled-components'; | ||
import { faStar, faStarHalf } from '@fortawesome/free-solid-svg-icons'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
|
||
interface Props { | ||
testimonial: ITestimonial; | ||
} | ||
|
||
const Card = styled.div` | ||
border-radius: 1em; | ||
background: #f2f8ff; | ||
padding: 1em; | ||
box-shadow: rgba(60, 64, 67, 0.3) 0px 1px 2px 0px, rgba(60, 64, 67, 0.15) 0px 2px 6px 2px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-between; | ||
.ratings { | ||
display: flex; | ||
margin-bottom: 0.5em; | ||
} | ||
.title { | ||
font-weight: bold; | ||
} | ||
.author { | ||
.name { | ||
font-weight: bold; | ||
} | ||
} | ||
.seperator { | ||
margin: 1em 0; | ||
padding: 0; | ||
background-color: black; | ||
height: 1px; | ||
} | ||
`; | ||
|
||
const MAX_RATING = 5; | ||
|
||
const HalfStarContainer = styled.span` | ||
position: relative; | ||
* { | ||
position: absolute; | ||
} | ||
`; | ||
|
||
const HalfStar = () => { | ||
return ( | ||
<HalfStarContainer> | ||
<FontAwesomeIcon color="gold" icon={faStarHalf} size="lg" fill="grey" /> | ||
<FontAwesomeIcon color="grey" icon={faStarHalf} size="lg" transform={{ flipX: true }} /> | ||
</HalfStarContainer> | ||
); | ||
}; | ||
|
||
export default function Testimonial({ testimonial }: Readonly<Props>) { | ||
const hasHalfRating = testimonial.rating % 1 === 0.5; | ||
|
||
const ratings = Array.from(Array(Math.floor(testimonial.rating)).keys()); | ||
const emptyRatings = Array.from(Array(MAX_RATING - Math.ceil(testimonial.rating)).keys()); | ||
|
||
return ( | ||
<Card> | ||
<div className="ratings"> | ||
{ratings.map((i) => ( | ||
<FontAwesomeIcon key={i} color="gold" icon={faStar} size="lg" /> | ||
))} | ||
{hasHalfRating && <HalfStar />} | ||
{emptyRatings.map((i) => ( | ||
<FontAwesomeIcon key={i} color="grey" icon={faStar} size="lg" /> | ||
))} | ||
</div> | ||
|
||
<p className="title">"{testimonial.title}"</p> | ||
|
||
<div className="body">{testimonial.body}</div> | ||
|
||
<div className="author"> | ||
<hr className="seperator" /> | ||
<span className="name">{testimonial.author.name}</span> |{' '} | ||
<span className="position">{testimonial.author.title}</span> | ||
</div> | ||
</Card> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { useState, useEffect } from 'react'; | ||
|
||
function getWindowDimensions() { | ||
const { innerWidth: width, innerHeight: height } = window; | ||
return { | ||
width, | ||
height, | ||
}; | ||
} | ||
|
||
export default function useWindowDimensions() { | ||
const [windowDimensions, setWindowDimensions] = useState(getWindowDimensions()); | ||
|
||
useEffect(() => { | ||
function handleResize() { | ||
setWindowDimensions(getWindowDimensions()); | ||
} | ||
|
||
window.addEventListener('resize', handleResize); | ||
return () => window.removeEventListener('resize', handleResize); | ||
}, []); | ||
|
||
return windowDimensions; | ||
} |
Oops, something went wrong.