Merge branch 'main' into fix/crash-admin-without-create-update-role-permissions

This commit is contained in:
Simone Taeggi 2023-04-11 15:57:38 +02:00
commit 80dba49849
10 changed files with 73 additions and 16 deletions

View File

@ -1,7 +1,11 @@
name: 'Experimental Releases'
name: 'Publish Prerelease'
on:
workflow_dispatch:
inputs:
dist-tag:
description: 'The tag you want to publish to NPM'
default: 'experimental'
permissions:
contents: read # to fetch code (actions/checkout)
@ -22,4 +26,4 @@ jobs:
- run: ./scripts/pre-publish.sh --yes
env:
VERSION: '0.0.0-experimental.${{ github.sha }}'
DIST_TAG: experimental
DIST_TAG: ${{ github.event.inputs.dist-tag }}

28
.github/workflows/remove-dist-tag.yml vendored Normal file
View File

@ -0,0 +1,28 @@
name: 'Remove dist-tag from NPM'
on:
workflow_dispatch:
inputs:
dist-tag:
description: 'The tag you want to remove from NPM'
required: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
publish:
name: 'Publish'
runs-on: ubuntu-latest
if: github.repository == 'strapi/strapi'
steps:
- uses: actions/checkout@v3
- name: Setup npmrc
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
- uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn
- run: ./scripts/remove-dist-tag
env:
DIST_TAG: ${{ github.event.inputs.dist-tag }}

View File

@ -4,7 +4,7 @@ import { Switch, Route, useRouteMatch, Redirect, useLocation } from 'react-route
import {
CheckPagePermissions,
LoadingIndicatorPage,
NotFound,
AnErrorOccurred,
useGuidedTour,
} from '@strapi/helper-plugin';
import { Layout, HeaderLayout, Main } from '@strapi/design-system';
@ -104,7 +104,7 @@ const App = () => {
<Route path="/content-manager/no-content-types">
<NoContentType />
</Route>
<Route path="" component={NotFound} />
<Route path="" component={AnErrorOccurred} />
</Switch>
</ModelsContext.Provider>
</Layout>

View File

@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Typography, Box, Flex, Icon } from '@strapi/design-system';
import { EmptyStateDocument } from '@strapi/icons';
import { EmptyDocuments } from '@strapi/icons';
import { EmptyNpmPackageGrid } from './EmptyNpmPackageGrid';
const EmptyNpmPackageSearch = ({ content }) => {
@ -10,7 +10,7 @@ const EmptyNpmPackageSearch = ({ content }) => {
<EmptyNpmPackageGrid />
<Box position="absolute" top={11} width="100%">
<Flex alignItems="center" justifyContent="center" direction="column">
<Icon as={EmptyStateDocument} color="" width="160px" height="88px" />
<Icon as={EmptyDocuments} color="" width="160px" height="88px" />
<Box paddingTop={6}>
<Typography variant="delta" as="p" textColor="neutral600">
{content}

View File

@ -3,7 +3,7 @@ import styled from 'styled-components';
import { useIntl } from 'react-intl';
import qs from 'qs';
import { Box, Flex, Typography, LinkButton, Icon } from '@strapi/design-system';
import { Plus, EmptyStateDocument } from '@strapi/icons';
import { Plus, EmptyDocuments } from '@strapi/icons';
import { getTrad } from '../../../utils';
const EmptyCard = styled(Box)`
@ -38,7 +38,7 @@ const EmptyAttributes = () => {
<EmptyCardGrid />
<Box position="absolute" top={6} width="100%">
<Flex alignItems="center" justifyContent="center" direction="column">
<Icon as={EmptyStateDocument} color="" width="160px" height="88px" />
<Icon as={EmptyDocuments} color="" width="160px" height="88px" />
<Box paddingTop={6} paddingBottom={4}>
<Box textAlign="center">
<Typography variant="delta" as="p" textColor="neutral600">

View File

@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Typography, Flex, Box, Icon } from '@strapi/design-system';
import { EmptyStateDocuments } from '@strapi/icons';
import { EmptyDocuments } from '@strapi/icons';
import { EmptyAssetGrid } from './EmptyAssetGrid';
export const EmptyAssets = ({ icon, content, action, size, count }) => {
@ -12,7 +12,7 @@ export const EmptyAssets = ({ icon, content, action, size, count }) => {
<Box position="absolute" top={11} width="100%">
<Flex direction="column" alignItems="center" gap={4} textAlign="center">
<Flex direction="column" alignItems="center" gap={6}>
<Icon as={icon || EmptyStateDocuments} color="" width="160px" height="88px" />
<Icon as={icon || EmptyDocuments} color="" width="160px" height="88px" />
<Typography variant="delta" as="p" textColor="neutral600">
{content}

View File

@ -7,7 +7,7 @@
import React from 'react';
import { Switch, Route } from 'react-router-dom';
import { NotFound } from '@strapi/helper-plugin';
import { AnErrorOccurred } from '@strapi/helper-plugin';
import pluginId from '../../pluginId';
import HomePage from '../HomePage';
@ -16,7 +16,7 @@ const App = () => {
<div>
<Switch>
<Route path={`/plugins/${pluginId}`} component={HomePage} exact />
<Route component={NotFound} />
<Route component={AnErrorOccurred} />
</Switch>
</div>
);

View File

@ -7,7 +7,7 @@
import React from 'react';
import { Switch, Route } from 'react-router-dom';
import { NotFound } from '@strapi/helper-plugin';
import { AnErrorOccurred } from '@strapi/helper-plugin';
import pluginId from '../../pluginId';
import HomePage from '../HomePage';
@ -16,7 +16,7 @@ const App = () => {
<div>
<Switch>
<Route path={`/plugins/${pluginId}`} component={HomePage} exact />
<Route component={NotFound} />
<Route component={AnErrorOccurred} />
</Switch>
</div>
);

View File

@ -1,6 +1,6 @@
import React from 'react';
import { Switch, Route } from 'react-router-dom';
import { CheckPagePermissions, NotFound } from '@strapi/helper-plugin';
import { CheckPagePermissions, AnErrorOccurred } from '@strapi/helper-plugin';
import pluginId from '../../pluginId';
import pluginPermissions from '../../permissions';
import ProtectedRolesListPage from './ProtectedListPage';
@ -18,7 +18,7 @@ const Roles = () => {
/>
<Route path={`/settings/${pluginId}/roles/:id`} component={ProtectedRolesEditPage} exact />
<Route path={`/settings/${pluginId}/roles`} component={ProtectedRolesListPage} exact />
<Route path="" component={NotFound} />
<Route path="" component={AnErrorOccurred} />
</Switch>
</CheckPagePermissions>
);

25
scripts/remove-dist-tag.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
# Force start from root folder
cd "$(dirname "$0")/.."
set -e
distTag=$DIST_TAG
# trim distTag for whitespace at the start and end
distTag=$(echo "$distTag" | xargs)
if [[ -z "$distTag" ]]; then
echo "Please enter the dist-tag you want to remove"
read -r distTag
fi
# Check if dist tag is latest, beta, alpha or next and reject
if [[ "$distTag" == "latest" || "$distTag" == "beta" || "$distTag" == "alpha" || "$distTag" == "next" ]]; then
echo "You cannot remove the dist-tag $distTag"
exit 1
fi
# Run npm dist-tag rm $distTag on each package
./node_modules/.bin/lerna exec --no-private --stream -- "npm dist-tag rm \$LERNA_PACKAGE_NAME $distTag"