Skip to content

Commit

Permalink
fix: media library direct dependency drop
Browse files Browse the repository at this point in the history
  • Loading branch information
cyp3rius committed Nov 16, 2023
1 parent 21af07a commit 1b18125
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 25 deletions.
9 changes: 5 additions & 4 deletions admin/src/pages/Settings/components/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import React, { useEffect, useRef, useState } from "react";
import { isNil } from "lodash";
import { Formik } from "formik";

import { Form, useNotification } from "@strapi/helper-plugin";
//@ts-ignore
import { MediaLibraryInput } from "@strapi/plugin-upload/admin/src/components/MediaLibraryInput";
import { Form, GenericInput, useNotification, useLibrary } from "@strapi/helper-plugin";
import { Button } from '@strapi/design-system/Button';
import { Divider } from '@strapi/design-system/Divider';
import { Grid, GridItem } from '@strapi/design-system/Grid';
Expand Down Expand Up @@ -36,6 +34,7 @@ const CUModal = ({ data = {}, isLoading = false, onSubmit, onClose }: CUModalPro
const [slug, setSlug] = useState(data.slug || '');
const [imageVariant, setImageVariant] = useState(isNil(data.emoji));
const { slugMutation } = useUtils(toggleNotification);
const { fields } = useLibrary();

useEffect(() => {
slugMutation.reset();
Expand Down Expand Up @@ -91,9 +90,11 @@ const CUModal = ({ data = {}, isLoading = false, onSubmit, onClose }: CUModalPro
<Divider useMargin />
<Grid gap={4}>
<GridItem col={4} xs={12}>
{ imageVariant && (<MediaLibraryInput
{ imageVariant && (<GenericInput
customInputs={fields}
intlLabel={{ id: `${pluginId}.page.settings.form.icon.label` }}
multiple={false}
type="media"
name="icon"
value={values.icon || undefined}
required={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ export const ReactionEmojiSelect = ({ value, onChange }: ReactionEmojiSelectProp
</ReactionEmojiSelectInner>
</Flex>
</CarouselInput>



<input type="hidden" value={value} />
</ReactionEmojiSelectContainer>)
}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "strapi-plugin-reactions",
"version": "1.1.2",
"version": "1.1.3",
"description": "Strapi - Reactions plugin",
"strapi": {
"name": "reactions",
Expand All @@ -13,7 +13,6 @@
"@strapi/helper-plugin": "^4.15.4",
"@strapi/icons": "^1.13.1",
"@strapi/plugin-graphql": "^4.15.4",
"@strapi/plugin-upload": "^4.15.4",
"emoji-picker-react": "^4.5.2",
"prop-types": "^15.8.1",
"slugify": "^1.6.6",
Expand Down Expand Up @@ -41,7 +40,7 @@
"strapi-typed": "^1.0.15",
"ts-jest": "^29.0.5",
"ts-node": "^10.9.1",
"typescript": "5.1.3"
"typescript": "5.2.2"
},
"peerDependencies": {
"@strapi/strapi": "^4.0.0",
Expand Down Expand Up @@ -87,7 +86,7 @@
"build": "tsc && yarn copy-translations",
"build:dev": "yarn run build && cp ./package.json ./dist",
"copy-translations": "copyfiles admin/src/translations/*.json dist/",
"clean": "rm -rf build",
"clean": "rm -rf dist",
"develop": "nodemon --exec \"yarn build:dev\"",
"test:unit": "jest --verbose --coverage",
"test:unit:ci": "CI=true jest --ci --runInBand --verbose --coverage",
Expand Down
14 changes: 6 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"extends": "@strapi/typescript-utils/tsconfigs/admin",

"compilerOptions": {
"rootDir": "./",
"outDir": "dist",
Expand All @@ -26,12 +24,12 @@

"include": [
"custom.d.ts",
"./server/**/*",
"./admin/**/*",
"./strapi-server.*",
"./strapi-admin.*",
"./setup-package.ts",
"./permissions.*"
"server/**/*",
"admin/**/*",
"strapi-server.*",
"strapi-admin.*",
"setup-package.ts",
"permissions.*"
],
"exclude": [
"**/node_modules/**/*",
Expand Down
7 changes: 1 addition & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2721,7 +2721,7 @@
nexus "1.3.0"
pluralize "^8.0.0"

"@strapi/[email protected]", "@strapi/plugin-upload@^4.15.4":
"@strapi/[email protected]":
version "4.15.4"
resolved "https://registry.yarnpkg.com/@strapi/plugin-upload/-/plugin-upload-4.15.4.tgz#8ae50d5caa038afdaaabd6478a20a8f220d19917"
integrity sha512-tCYzLs09EoXAepn5SeP6gto3YMC/Pg256pCCB4Ogf/oSUZxJK86GYVnEkSkeB+Ho/JOLHVeknK5iO7NBfLGRhw==
Expand Down Expand Up @@ -11116,11 +11116,6 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

[email protected]:
version "5.1.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.1.3.tgz#8d84219244a6b40b6fb2b33cc1c062f715b9e826"
integrity sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==

[email protected]:
version "5.2.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
Expand Down

0 comments on commit 1b18125

Please sign in to comment.