Skip to content

Commit

Permalink
Merge pull request #94 from pluginpal/feature/security-updates
Browse files Browse the repository at this point in the history
Feature/security updates
  • Loading branch information
boazpoolman authored Jan 22, 2024
2 parents 7797970 + de5fb5c commit 5065098
Show file tree
Hide file tree
Showing 8 changed files with 571 additions and 1,311 deletions.
5 changes: 5 additions & 0 deletions .changeset/happy-shirts-act.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pluginpal/webtools-core": patch
---

Remove strapi-typed from the devDependencies
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@
"test:integration": "ENV_PATH=./playground/.env jest --verbose --runInBand --forceExit --testMatch '**/healthcheck.test.js'"
},
"dependencies": {
"@strapi/strapi": "^4",
"@strapi/strapi": "^4.17.1",
"react": "^18"
},
"devDependencies": {
"@changesets/cli": "^2.27.1",
"@types/copyfiles": "^2",
"@types/jest": "^29.4.0",
"@types/koa": "^2.14.0",
"@types/react-router-dom": "^5.3.3",
"@types/styled-components": "^5.1.32",
"@uncinc/eslint-config": "^1.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/admin/components/EditForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const EditForm = () => {
const { formatMessage } = useIntl();

const updateValue = (name: string, value: string | number) => {
onChange({ target: { name: `url_alias.${name}`, value } });
onChange({ target: { name: `url_alias.${name}`, value, type: 'text' } });
};

return (
Expand Down
13 changes: 10 additions & 3 deletions packages/core/admin/components/EditView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ const EditView = () => {

if (!isContentTypeEnabled(allLayoutData.contentType)) return null;
const modifiedUrlAlias = modifiedData.url_alias as UrlAliasEntity;
const initialUrlAlias = initialData.url_alias as UrlAliasEntity;

const onSubmit = async () => {
if (!initialData.url_alias) {
if (!initialUrlAlias) {
const urlAlias = await createUrlAlias(modifiedUrlAlias, slug);
onChange({ target: { name: 'url_alias', value: urlAlias } });
onChange({ target: { name: 'url_alias', value: urlAlias, type: 'text' } });
} else {
await updateUrlAlias(modifiedUrlAlias, slug);
}
Expand All @@ -41,7 +42,13 @@ const EditView = () => {
defaultMessage: 'URL alias',
})}
onSubmit={onSubmit}
onCancel={() => onChange({ target: { name: 'url_alias', value: initialData.url_alias } })}
onCancel={() => {
if (initialUrlAlias) {
onChange({ target: { name: 'url_alias', value: initialUrlAlias, type: 'text' } });
} else {
onChange({ target: { name: 'url_alias', value: null, type: 'text' } });
}
}}
>
<EditForm />
</SidebarModal>
Expand Down
3 changes: 0 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
"@pluginpal/webtools-helper-plugin": "1.0.0-beta.1",
"react-copy-to-clipboard": "^5.1.0"
},
"devDependencies": {
"strapi-typed": "^1.0.16"
},
"author": {
"name": "TODO"
},
Expand Down
6 changes: 3 additions & 3 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"strapi": "strapi"
},
"dependencies": {
"@strapi/plugin-i18n": "^4.14.6",
"@strapi/plugin-users-permissions": "^4.14.6",
"@strapi/strapi": "^4.14.6",
"@strapi/plugin-i18n": "^4.17.1",
"@strapi/plugin-users-permissions": "^4.17.1",
"@strapi/strapi": "^4.17.1",
"better-sqlite3": "8.6.0",
"pg": "^8.10.0",
"react": "^18.0.0",
Expand Down
Loading

0 comments on commit 5065098

Please sign in to comment.