Skip to content

Commit

Permalink
Merge branch 'main' of github.com:strapi/strapi into fix/custom-field…
Browse files Browse the repository at this point in the history
…s-breaking-inputs
  • Loading branch information
markkaylor committed Nov 23, 2022
2 parents a91fe47 + 94cd474 commit cfd9262
Show file tree
Hide file tree
Showing 20 changed files with 1,014 additions and 687 deletions.
1 change: 1 addition & 0 deletions .github/workflows/addToProject.yml
Expand Up @@ -6,6 +6,7 @@ on:
- opened
- transferred

permissions: {}
jobs:
add-to-project:
name: Add issue to Support Team project
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/checks.yml
Expand Up @@ -17,8 +17,12 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/check-pr-status

security-lockfile-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
- uses: ./.github/actions/security/lockfile
4 changes: 4 additions & 0 deletions .github/workflows/contributor-doc.yml
Expand Up @@ -17,8 +17,12 @@ defaults:
run:
working-directory: docs

permissions: {}
jobs:
deploy:
permissions:
contents: write # to push pages branch (peaceiris/actions-gh-pages)

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/nightly.yml
Expand Up @@ -5,6 +5,9 @@ on:
- cron: '0 0 * * 2-6'
workflow_dispatch:

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
publish:
name: 'Publish'
Expand Down
56 changes: 46 additions & 10 deletions .github/workflows/tests.yml
Expand Up @@ -13,6 +13,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
lint:
name: 'lint (node: ${{ matrix.node }})'
Expand All @@ -25,7 +28,11 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}

- run: yarn install --frozen-lockfile
- name: Run lint
run: yarn run -s lint
Expand All @@ -42,7 +49,11 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}

- run: yarn install --frozen-lockfile
- name: Run tests
run: yarn run -s test:unit --coverage
Expand All @@ -65,7 +76,11 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}

- run: yarn install --frozen-lockfile
- name: Build
run: yarn build
Expand Down Expand Up @@ -109,7 +124,10 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/run-api-tests
with:
Expand Down Expand Up @@ -144,7 +162,10 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/run-api-tests
with:
Expand Down Expand Up @@ -179,7 +200,10 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/run-api-tests
with:
Expand All @@ -198,7 +222,10 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/run-api-tests
env:
Expand Down Expand Up @@ -240,7 +267,10 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/run-api-tests
with:
Expand Down Expand Up @@ -278,7 +308,10 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/run-api-tests
with:
Expand All @@ -301,7 +334,10 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn
- uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-${{ matrix.node }}-${{ hashFiles('**/yarn.lock') }}
- run: yarn install --frozen-lockfile
- uses: ./.github/actions/run-api-tests
env:
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/create-strapi-app/package.json
Expand Up @@ -4,7 +4,7 @@
"description": "Generate a new Strapi application.",
"dependencies": {
"@strapi/generate-new": "4.5.2",
"commander": "6.1.0",
"commander": "7.2.0",
"inquirer": "8.2.4"
},
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/create-strapi-starter/package.json
Expand Up @@ -41,7 +41,7 @@
"@strapi/generate-new": "4.5.2",
"chalk": "4.1.1",
"ci-info": "3.5.0",
"commander": "7.1.0",
"commander": "7.2.0",
"execa": "5.1.1",
"fs-extra": "10.0.0",
"inquirer": "8.2.4",
Expand Down
@@ -0,0 +1,62 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Grid, GridItem } from '@strapi/design-system/Grid';
import Inputs from '../../../components/Inputs';
import FieldComponent from '../../../components/FieldComponent';

const GridRow = ({ columns, customFieldInputs }) => {
return (
<Grid gap={4}>
{columns.map(({ fieldSchema, labelAction, metadatas, name, size, queryInfos }) => {
const isComponent = fieldSchema.type === 'component';

if (isComponent) {
const { component, max, min, repeatable = false, required = false } = fieldSchema;

return (
<GridItem col={size} s={12} xs={12} key={component}>
<FieldComponent
componentUid={component}
labelAction={labelAction}
isRepeatable={repeatable}
intlLabel={{
id: metadatas.label,
defaultMessage: metadatas.label,
}}
max={max}
min={min}
name={name}
required={required}
/>
</GridItem>
);
}

return (
<GridItem col={size} key={name} s={12} xs={12}>
<Inputs
size={size}
fieldSchema={fieldSchema}
keys={name}
labelAction={labelAction}
metadatas={metadatas}
queryInfos={queryInfos}
customFieldInputs={customFieldInputs}
/>
</GridItem>
);
})}
</Grid>
);
};

GridRow.defaultProps = {
customFieldInputs: {},
};

GridRow.propTypes = {
columns: PropTypes.array.isRequired,
customFieldInputs: PropTypes.object,
};

export default GridRow;

0 comments on commit cfd9262

Please sign in to comment.