forked from asyncapi/website
-
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 branch 'asyncapi:master' into master
- Loading branch information
Showing
26 changed files
with
1,421 additions
and
3,068 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 |
---|---|---|
@@ -1,6 +1,3 @@ | ||
# This action is centrally managed in https://github.com/asyncapi/.github/ | ||
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in above mentioned repo | ||
|
||
# It does magic only if there is package.json file in the root of the project | ||
name: PR testing - if Node project | ||
|
||
|
@@ -14,65 +11,61 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
# Using macos-13 instead of latest (macos-14) due to an issue with Puppeteer and such runner. | ||
# See: https://github.com/puppeteer/puppeteer/issues/12327 and https://github.com/asyncapi/parser-js/issues/1001 | ||
os: [ubuntu-latest, macos-13, windows-latest] | ||
steps: | ||
- if: > | ||
!github.event.pull_request.draft && !( | ||
(github.actor == 'asyncapi-bot' && ( | ||
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') || | ||
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') || | ||
startsWith(github.event.pull_request.title, 'chore(release):') | ||
)) || | ||
(github.actor == 'asyncapi-bot-eve' && ( | ||
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') || | ||
startsWith(github.event.pull_request.title, 'ci: update of files from global .github repo') || | ||
startsWith(github.event.pull_request.title, 'chore(release):') | ||
)) || | ||
(github.actor == 'allcontributors[bot]' && | ||
(github.actor == 'allcontributors[bot]' && | ||
startsWith(github.event.pull_request.title, 'docs: add') | ||
) | ||
) | ||
id: should_run | ||
name: Should Run | ||
run: echo "shouldrun=true" >> $GITHUB_OUTPUT | ||
shell: bash | ||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
name: Set git to use LF #to once and for all finish neverending fight between Unix and Windows | ||
run: | | ||
git config --global core.autocrlf false | ||
git config --global core.eol lf | ||
shell: bash | ||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
- if: steps.should_run.outputs.shouldrun == 'true' | ||
name: Check if Node.js project and has package.json | ||
id: packagejson | ||
run: test -e ./package.json && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT | ||
shell: bash | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Check package-lock version | ||
uses: asyncapi/.github/.github/actions/get-node-version-from-package-lock@master | ||
id: lockversion | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Check if .nvmrc exists | ||
id: nvmrc | ||
run: test -e .nvmrc && echo "exists=true" >> $GITHUB_OUTPUT || echo "exists=false" >> $GITHUB_OUTPUT | ||
shell: bash | ||
- if: steps.nvmrc.outputs.exists == 'true' | ||
name: Read Node.js version from .nvmrc | ||
id: nodeversion | ||
run: echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT | ||
shell: bash | ||
- if: steps.packagejson.outputs.exists == 'true' && steps.nvmrc.outputs.exists == 'true' | ||
name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "${{ steps.lockversion.outputs.version }}" | ||
- if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest' | ||
#npm cli 10 is buggy because of some cache issue | ||
name: Install npm cli 8 | ||
shell: bash | ||
run: npm install -g [email protected] | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Install dependencies | ||
shell: bash | ||
node-version: "${{ steps.nodeversion.outputs.version }}" | ||
- name: Install dependencies | ||
run: npm ci | ||
- if: steps.packagejson.outputs.exists == 'true' | ||
name: Test | ||
run: npm test --if-present | ||
- if: steps.packagejson.outputs.exists == 'true' && matrix.os == 'ubuntu-latest' | ||
#linting should run just one and not on all possible operating systems | ||
name: Run linter | ||
run: npm run lint --if-present | ||
- if: steps.packagejson.outputs.exists == '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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20.11.0 |
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,52 @@ | ||
import { useArgs } from '@storybook/preview-api'; | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import type { InputBoxProps } from '@/types/components/InputBoxPropsType'; | ||
import { InputTypes } from '@/types/components/InputBoxPropsType'; | ||
|
||
import InputBox from './InputBox'; | ||
|
||
const meta: Meta<typeof InputBox> = { | ||
title: 'Components/InputBox', | ||
component: InputBox | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof InputBox>; | ||
|
||
const Input: Story = { | ||
args: { | ||
inputValue: '' | ||
}, | ||
|
||
render: (args: InputBoxProps) => { | ||
const [{ inputValue }, updateArgs] = useArgs(); | ||
|
||
const setValue = (newValue: string) => { | ||
updateArgs({ inputValue: newValue }); | ||
}; | ||
|
||
return <InputBox {...args} inputValue={inputValue} setInput={setValue} />; | ||
} | ||
}; | ||
|
||
export const TextInput: Story = { | ||
...Input, | ||
|
||
args: { | ||
inputType: InputTypes.TEXT, | ||
inputName: 'Name', | ||
placeholder: 'AsyncAPI Initiative' | ||
} | ||
}; | ||
|
||
export const EmailInput: Story = { | ||
...Input, | ||
|
||
args: { | ||
inputType: InputTypes.EMAIL, | ||
inputName: 'Email', | ||
placeholder: '[email protected]' | ||
} | ||
}; |
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 @@ | ||
import React from 'react'; | ||
|
||
import type { InputBoxProps } from '@/types/components/InputBoxPropsType'; | ||
|
||
/** | ||
* This component renders input box. | ||
*/ | ||
export default function InputBox({ inputType, inputName, placeholder, inputValue, setInput }: InputBoxProps) { | ||
return ( | ||
<input | ||
type={inputType} | ||
name={inputName} | ||
placeholder={placeholder} | ||
value={inputValue} | ||
onChange={(e) => setInput(e.target.value)} | ||
className='form-input mt-2 block w-full rounded-md sm:text-sm sm:leading-5 md:mt-0 md:flex-1' | ||
required | ||
data-testid={`NewsletterSubscribe-${inputType}-input`} | ||
/> | ||
); | ||
} |
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.