-
Notifications
You must be signed in to change notification settings - Fork 9
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 #1480 from isomerpages/release/0.42.0
* feat: re-introduce comment-based trigger for Chromatic (#1468) * chore(contactus): styling fixes based on design feedback (#1470) * chore(contactus): styling fixes based on design feedback * fix: use subhead-1 styling instead * chore: remove unused import * Chore/fix edit nav bar styles (#1466) * fix: nav menu template styles * fix: add spacing for legacy nav section * chore: remove unused attributes * chore: move flex into className * Chore/fix title text (#1472) * chore: fix title text * chore: fix other instances of spacing * fix(edithomepage): spread properly (#1474) Co-authored-by: seaerchin <[email protected]> * Fix/edit nav nits (#1476) * fix: reduce bottom padding of sidebar * fix: text styling * fix: padding on add section button * chore: remove periods from validators * chore: change placeholder text * fix: update default values of new sections * fix: copy changes * fix(homepage): various styling fixes (#1477) * fix(edithomepage): fixed spacing between card/button * fix(editable): fixed styling * fix(editable): updated padding of editable accordion button * fix(hero-highlight): fixed copy * fix(editable): update padding * fix(hero-higihlihgt-section): update wording * refactor(formmediainput): add width * fix(editable): fixed border radius on hover --------- Co-authored-by: seaerchin <[email protected]> * feat(editable): introduce new nested card variant (#1478) * feat(icons): introduce new vertical draggable icon * feat(editable): introduce nested version of accordion * fix(contactus): update location card to use nested * fix: border radius of error divider * 0.42.0 --------- Co-authored-by: seaerchin <[email protected]> Co-authored-by: Hsu Zhong Jun <[email protected]> Co-authored-by: seaerchin <[email protected]>
- Loading branch information
Showing
29 changed files
with
421 additions
and
188 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 |
---|---|---|
|
@@ -2,27 +2,68 @@ | |
name: "Chromatic" | ||
|
||
# Event for the workflow | ||
on: push | ||
on: | ||
issue_comment: | ||
types: [created, edited] | ||
|
||
push: | ||
branches: | ||
- develop | ||
|
||
env: | ||
# The full comment text to match to trigger this workflow | ||
ISOMER_TRIGGER_COMMENT: "!run chromatic" | ||
# The slug for the Isomer core team | ||
ISOMER_CORE_TEAM_SLUG: core | ||
# Use GitHub Token | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
# Required for the chromatic action | ||
REACT_APP_BACKEND_URL: "https://cms-api.isomer.gov.sg/v1" | ||
|
||
# List of jobs | ||
jobs: | ||
chromatic-deployment: | ||
chromatic: | ||
# Operating System | ||
runs-on: ubuntu-latest | ||
# Only run if the user is not a bot and there are changes | ||
# Only run if the user is not a bot | ||
if: ${{ !endsWith(github.actor , 'bot') }} | ||
environment: staging | ||
# Job steps | ||
steps: | ||
- uses: actions/checkout@v3 | ||
# Determine if the PR comment should trigger the Chromatic build | ||
- name: Check if user is part of Isomer core team (PR comment) | ||
if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request }} | ||
uses: tspascoal/get-user-teams-membership@v1 | ||
id: checkUserMember | ||
with: | ||
username: ${{ github.actor }} | ||
team: ${{ env.ISOMER_CORE_TEAM_SLUG }} | ||
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} # requires read:org | ||
|
||
- name: Check for trigger words (in PR comment) | ||
if: ${{ github.event_name == 'issue_comment' && github.event.issue.pull_request }} | ||
uses: khan/[email protected] | ||
id: check | ||
with: | ||
trigger: "${{ env.ISOMER_TRIGGER_COMMENT }}" | ||
prefix_only: "true" | ||
reaction: "+1" | ||
|
||
- name: Checkout repository (pull request) | ||
if: ${{ github.event_name == 'issue_comment' }} | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: refs/pull/${{ github.event.issue.number }}/head | ||
fetch-depth: 0 # 👈 Required to retrieve git history | ||
|
||
- uses: dorny/paths-filter@v2 | ||
- name: Checkout repository (push) | ||
if: ${{ github.event_name == 'push' }} | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # 👈 Required to retrieve git history | ||
|
||
- name: Check for changes | ||
uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
filters: | | ||
|
@@ -32,26 +73,49 @@ jobs: | |
- 'src/theme/**' | ||
- 'src/styles/**' | ||
- name: Set environment variable to run Chromatic build | ||
if: ${{ (github.event_name == 'push' || (steps.check.outputs.triggered == 'true' && github.event_name == 'issue_comment' && github.event.issue.pull_request)) && steps.filter.outputs.frontend == 'true' }} | ||
run: echo "ISOMER_RUN_CHROMATIC_BUILD=true" >> $GITHUB_ENV | ||
|
||
# This extra step is not in the original chromatic workflow. | ||
# This is to pin the version of node (18.x) used. | ||
- name: Setup Node.js | ||
if: ${{ steps.filter.outputs.frontend == 'true' }} | ||
if: ${{ env.ISOMER_RUN_CHROMATIC_BUILD == 'true' }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "18.x" | ||
cache: "npm" | ||
|
||
- name: Install dependencies | ||
if: ${{ steps.filter.outputs.frontend == 'true' }} | ||
if: ${{ env.ISOMER_RUN_CHROMATIC_BUILD == 'true' }} | ||
run: npm ci | ||
|
||
# 👇 Adds Chromatic as a step in the workflow | ||
- name: Get pull request information (for pull requests) | ||
if: ${{ env.ISOMER_RUN_CHROMATIC_BUILD == 'true' && github.event_name == 'issue_comment' }} | ||
uses: octokit/[email protected] | ||
id: get_pull_request | ||
with: | ||
route: GET /repos/{repository}/pulls/{pull_number} | ||
repository: ${{ github.repository }} # isomerpages/isomercms-frontend | ||
pull_number: ${{ github.event.issue.number }} | ||
|
||
- name: Save branch name as environment variable (for pull requests) | ||
if: ${{ env.ISOMER_RUN_CHROMATIC_BUILD == 'true' && github.event_name == 'issue_comment' }} | ||
run: echo "ISOMER_BRANCH_NAME=${{ fromJSON(steps.get_pull_request.outputs.data).head.ref }}" >> $GITHUB_ENV | ||
|
||
- name: Save branch name as environment variable (for push) | ||
if: ${{ env.ISOMER_RUN_CHROMATIC_BUILD == 'true' && github.event_name == 'push' }} | ||
run: echo "ISOMER_BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_ENV | ||
|
||
# 👇 Adds Chromatic as a step in the workflow | ||
- name: Publish to Chromatic | ||
if: ${{ steps.filter.outputs.frontend == 'true' }} | ||
if: ${{ env.ISOMER_RUN_CHROMATIC_BUILD == 'true' }} | ||
uses: chromaui/action@v1 | ||
# Chromatic GitHub Action options | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
# 👇 Chromatic projectToken, refer to the manage page to obtain it. | ||
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} | ||
onlyChanged: true | ||
branchName: ${{ env.ISOMER_BRANCH_NAME }} | ||
autoAcceptChanges: develop |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,21 @@ | ||
export const BxDraggableVertical = ( | ||
props: React.SVGProps<SVGSVGElement> | ||
): JSX.Element => { | ||
return ( | ||
<svg | ||
width="24" | ||
height="24" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
{...props} | ||
> | ||
<circle cx="9" cy="18" r="2" fill="#BABECB" /> | ||
<circle cx="9" cy="12" r="2" fill="#BABECB" /> | ||
<circle cx="9" cy="6" r="2" fill="#BABECB" /> | ||
<circle cx="15" cy="18" r="2" fill="#BABECB" /> | ||
<circle cx="15" cy="12" r="2" fill="#BABECB" /> | ||
<circle cx="15" cy="6" r="2" fill="#BABECB" /> | ||
</svg> | ||
) | ||
} |
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
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
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
Oops, something went wrong.