-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/release' into SLB-405-Fade-effect
- Loading branch information
Showing
48 changed files
with
2,496 additions
and
1,486 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
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,77 @@ | ||
name: Estimate | ||
on: | ||
pull_request: | ||
|
||
jobs: | ||
estimate: | ||
name: Estimate | ||
if: vars.JIRA_PROJECT_ID != '' | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Start Check Run | ||
id: check | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
CHECK_ID=$(gh api -X POST -H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
-f 'name=Estimator' \ | ||
-f 'head_sha=${{ github.event.pull_request.head.sha }}' \ | ||
-f 'status=in_progress' \ | ||
-f 'output[title]=🎲 Estimation in progress' \ | ||
-f 'output[summary]=🎲 Estimation in progress' \ | ||
/repos/${{ github.repository }}/check-runs --jq '.id') | ||
echo "check_id=$CHECK_ID" >> $GITHUB_OUTPUT | ||
- name: Install estimator | ||
run: npm install -g @amazeelabs/estimator | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Find common ancestor | ||
id: ancestor | ||
env: | ||
BASE_BRANCH: ${{ github.base_ref }} | ||
run: | ||
echo "hash=$(git merge-base --fork-point origin/$BASE_BRANCH)" >> | ||
$GITHUB_OUTPUT | ||
|
||
- name: Estimate | ||
id: estimate | ||
env: | ||
JIRA_PROJECT_ID: ${{ vars.JIRA_PROJECT_ID }} | ||
PARENT_COMMIT: ${{ steps.ancestor.outputs.hash }} | ||
DASHBOARD_ACCESS_TOKEN: ${{ secrets.DASHBOARD_ACCESS_TOKEN }} | ||
run: echo "result=$(amazeelabs-estimator estimate)" >> $GITHUB_OUTPUT | ||
continue-on-error: true | ||
|
||
- name: Report success | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
gh api -X PATCH -H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
-f 'name=Estimator' \ | ||
-f 'head_sha=${{ github.event.pull_request.head.sha }}' \ | ||
-f 'conclusion=success' \ | ||
-f 'output[title]=🎲 ${{ steps.estimate.outputs.result }}' \ | ||
-f 'output[summary]=🎲 ${{ steps.estimate.outputs.result }}' \ | ||
/repos/${{ github.repository }}/check-runs/${{ steps.check.outputs.check_id }} | ||
if: steps.estimate.outputs.result != '' | ||
|
||
- name: Report error | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
gh api -X PATCH -H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
-f 'name=Estimator' \ | ||
-f 'head_sha=${{ github.event.pull_request.head.sha }}' \ | ||
-f 'conclusion=failure' \ | ||
-f 'output[title]=💥 Estimation failed' \ | ||
-f 'output[summary]=💥 Estimation failed' \ | ||
/repos/${{ github.repository }}/check-runs/${{ steps.check.outputs.check_id }} | ||
if: steps.estimate.outputs.result == '' |
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,23 @@ | ||
name: Write dashboard history | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
write_dashboard: | ||
name: Write dashboard history | ||
if: github.ref == 'refs/heads/release' && vars.JIRA_PROJECT_ID != '' | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Install estimator | ||
run: npm install -g @amazeelabs/estimator | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Update dashboard | ||
env: | ||
JIRA_PROJECT_ID: ${{ vars.JIRA_PROJECT_ID }} | ||
DASHBOARD_ACCESS_TOKEN: ${{ secrets.DASHBOARD_ACCESS_TOKEN }} | ||
run: amazeelabs-estimator write-history |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
node_modules | ||
.idea/inspectionProfiles | ||
.idea/git_toolbox_prj.xml | ||
build-storybook.log | ||
storybook-static | ||
coverage | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,6 @@ COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules | |
COPY --from=node /usr/local/bin/node /usr/local/bin/node | ||
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm | ||
|
||
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 | ||
|
||
# Install pnpm | ||
RUN npm install -g [email protected] && pnpm config set store-dir /tmp/cache/pnpm | ||
|
||
|
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,12 @@ | ||
export default { | ||
documents: [ | ||
'packages/schema/src/fragments/**/*.{gql,graphql,graphqls}', | ||
'packages/schema/src/operations/*.{gql,graphql,graphqls}', | ||
'packages/schema/src/schema.graphql', | ||
], | ||
storage: { | ||
id: process.env.JIRA_PROJECT_ID, | ||
token: process.env.DASHBOARD_ACCESS_TOKEN, | ||
api: 'https://dashboard.amazeelabs.com/api/estimator', | ||
}, | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
63 changes: 63 additions & 0 deletions
63
packages/drupal/gutenberg_blocks/src/blocks/info-grid-item.tsx
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,63 @@ | ||
import { InnerBlocks, InspectorControls } from 'wordpress__block-editor'; | ||
import { registerBlockType } from 'wordpress__blocks'; | ||
import { PanelBody, SelectControl } from 'wordpress__components'; | ||
|
||
import { | ||
iconImagePreview, | ||
Icons, | ||
limitedIconListOption, | ||
} from '../utils/icon-list'; | ||
|
||
// @ts-ignore | ||
const { t: __ } = Drupal; | ||
|
||
registerBlockType('custom/info-grid-item', { | ||
title: __('Info Grid Item'), | ||
icon: 'align-wide', | ||
category: 'layout', | ||
parent: ['custom/info-grid'], | ||
attributes: { | ||
icon: { | ||
type: 'string', | ||
default: '', | ||
}, | ||
}, | ||
edit: (props) => { | ||
const { setAttributes } = props; | ||
const iconPreview = iconImagePreview(props.attributes.icon as string); | ||
|
||
return ( | ||
<> | ||
<InspectorControls> | ||
<PanelBody title={__('Select an icon')}> | ||
<SelectControl | ||
value={props.attributes.icon as string} | ||
options={limitedIconListOption([ | ||
Icons.EMAIL, | ||
Icons.PHONE, | ||
Icons.LIFE_RING, | ||
])} | ||
onChange={(icon: string) => { | ||
setAttributes({ icon }); | ||
}} | ||
/> | ||
</PanelBody> | ||
</InspectorControls> | ||
|
||
<div className={'container-wrapper'}> | ||
<div className={'container-label'}>{__('Info Grid Item')}</div> | ||
<div className={'info-grid-icon'} style={{ maxWidth: '50px' }}> | ||
{iconPreview && ( | ||
<img src={iconPreview} alt={props.attributes.icon as string} /> | ||
)} | ||
</div> | ||
<InnerBlocks | ||
templateLock={false} | ||
allowedBlocks={['custom/heading', 'core/paragraph', 'custom/cta']} | ||
/> | ||
</div> | ||
</> | ||
); | ||
}, | ||
save: () => <InnerBlocks.Content />, | ||
}); |
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,40 @@ | ||
import { InnerBlocks } from 'wordpress__block-editor'; | ||
import { registerBlockType } from 'wordpress__blocks'; | ||
import { useSelect } from 'wordpress__data'; | ||
|
||
// @ts-ignore | ||
const { t: __ } = Drupal; | ||
|
||
const MAX_BLOCKS: number = 3; | ||
|
||
registerBlockType('custom/info-grid', { | ||
title: __('Info Grid'), | ||
icon: 'editor-insertmore', | ||
category: 'layout', | ||
attributes: {}, | ||
edit: (props) => { | ||
/* eslint-disable-next-line */ | ||
const { blockCount } = useSelect((select) => ({ | ||
blockCount: select('core/block-editor').getBlockCount(props.clientId), | ||
})); | ||
|
||
return ( | ||
<div className={'container-wrapper'}> | ||
<div className={'container-label'}>{__('Info Grid')}</div> | ||
<InnerBlocks | ||
templateLock={false} | ||
renderAppender={() => { | ||
if (blockCount >= MAX_BLOCKS) { | ||
return null; | ||
} else { | ||
return <InnerBlocks.DefaultBlockAppender />; | ||
} | ||
}} | ||
allowedBlocks={['custom/info-grid-item']} | ||
template={[]} | ||
/> | ||
</div> | ||
); | ||
}, | ||
save: () => <InnerBlocks.Content />, | ||
}); |
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.