Skip to content

Commit

Permalink
Upgrade: tagsInput plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sumi-k committed Feb 27, 2024
1 parent 198a47e commit 70460d9
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 7 deletions.
2 changes: 1 addition & 1 deletion admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"react-dom": "^18.0.0",
"react-router-dom": "^5.2.0",
"react-tagsinput": "^3.20.3",
"strapi-plugin-tagsinput": "^1.0.3",
"strapi-plugin-tagsinput": "^1.0.4",
"styled-components": "^5.2.1"
},
"engines": {
Expand Down
5 changes: 4 additions & 1 deletion admin/src/api/post/content-types/post/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@
"tags": {
"type": "customField",
"customField": "plugin::tagsinput.tags",
"required": true
"required": true,
"options": {
"apiUrl": "/v1/tags/suggestions?populate=deep&fields[0]=slug&fields[1]=name"
}
},
"category": {
"type": "relation",
Expand Down
8 changes: 7 additions & 1 deletion admin/src/api/tag/controllers/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,10 @@

const { createCoreController } = require("@strapi/strapi").factories;

module.exports = createCoreController("api::tag.tag");
module.exports = createCoreController("api::tag.tag", ({ strapi }) => ({
async suggestions(ctx) {
return await strapi.entityService.findMany("api::tag.tag", {
fields: ctx.query.fields,
});
},
}));
12 changes: 12 additions & 0 deletions admin/src/api/tag/routes/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
routes: [
{
method: "GET",
path: "/tags/suggestions",
handler: "tag.suggestions",
config: {
auth: false,
},
},
],
};
57 changes: 53 additions & 4 deletions admin/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4094,6 +4094,15 @@ [email protected]:
form-data "^4.0.0"
proxy-from-env "^1.1.0"

axios@^1.6.7:
version "1.6.7"
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.7.tgz#7b48c2e27c96f9c68a2f8f31e2ab19f59b06b0a7"
integrity sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==
dependencies:
follow-redirects "^1.15.4"
form-data "^4.0.0"
proxy-from-env "^1.1.0"

b4a@^1.6.4:
version "1.6.6"
resolved "https://registry.yarnpkg.com/b4a/-/b4a-1.6.6.tgz#a4cc349a3851987c3c4ac2d7785c18744f6da9ba"
Expand Down Expand Up @@ -5662,6 +5671,11 @@ es-module-lexer@^1.2.1:
resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.4.1.tgz#41ea21b43908fe6a287ffcbe4300f790555331f5"
integrity sha512-cXLGjP0c4T3flZJKQSuziYoq7MlT+rnvfZjfp7h+I7K9BNX54kP9nyWvdbwjQ4u1iWbOL4u96fgeZLToQlZC7w==

es6-promise@^4.2.8:
version "4.2.8"
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a"
integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==

esbuild-loader@^2.21.0:
version "2.21.0"
resolved "https://registry.yarnpkg.com/esbuild-loader/-/esbuild-loader-2.21.0.tgz#2698a3e565b0db2bb19a3dd91c2b6c9aad526c80"
Expand Down Expand Up @@ -8670,6 +8684,11 @@ oauth-sign@^0.9.0, oauth-sign@~0.9.0:
resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455"
integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==

object-assign@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-3.0.0.tgz#9bedd5ca0897949bca47e7ff408062d549f587f2"
integrity sha512-jHP15vXVGeVh1HuaA2wY6lxk+whK/x4KBG88VXeRma7CCun7iGD5qPc4eYykQ9sdQvg8jkwFKsSxHln2ybW3xQ==

object-assign@^4.0.1, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
Expand Down Expand Up @@ -9560,6 +9579,17 @@ [email protected], rc@^1.2.7, rc@^1.2.8:
minimist "^1.2.0"
strip-json-comments "~2.0.1"

react-autosuggest@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/react-autosuggest/-/react-autosuggest-10.1.0.tgz#4d25b8acc78bb518eb70189bb96bcd777dc71ffb"
integrity sha512-/azBHmc6z/31s/lBf6irxPf/7eejQdR0IqnZUzjdSibtlS8+Rw/R79pgDAo6Ft5QqCUTyEQ+f0FhL+1olDQ8OA==
dependencies:
es6-promise "^4.2.8"
prop-types "^15.7.2"
react-themeable "^1.1.0"
section-iterator "^2.0.0"
shallow-equal "^1.2.1"

[email protected]:
version "16.0.1"
resolved "https://registry.yarnpkg.com/react-dnd-html5-backend/-/react-dnd-html5-backend-16.0.1.tgz#87faef15845d512a23b3c08d29ecfd34871688b6"
Expand Down Expand Up @@ -9757,6 +9787,13 @@ react-tagsinput@^3.20.3:
resolved "https://registry.yarnpkg.com/react-tagsinput/-/react-tagsinput-3.20.3.tgz#d5790ccf8a387bdaa8c2c8306e62a7276ac581c1"
integrity sha512-a+7nZ9gg0SwuoPPmh2AAB98OXYduwi6WgYWgWlPts3mq1ookXGphq9Fe/XLhQcdunkiqJO4WXjWXtHE9UlFyiw==

react-themeable@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/react-themeable/-/react-themeable-1.1.0.tgz#7d4466dd9b2b5fa75058727825e9f152ba379a0e"
integrity sha512-kl5tQ8K+r9IdQXZd8WLa+xxYN04lLnJXRVhHfdgwsUJr/SlKJxIejoc9z9obEkx1mdqbTw1ry43fxEUwyD9u7w==
dependencies:
object-assign "^3.0.0"

react-transition-group@^4.3.0:
version "4.4.5"
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.5.tgz#e53d4e3f3344da8521489fbef8f2581d42becdd1"
Expand Down Expand Up @@ -10255,6 +10292,11 @@ scroll-into-view-if-needed@^2.2.20:
dependencies:
compute-scroll-into-view "^1.0.20"

section-iterator@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/section-iterator/-/section-iterator-2.0.0.tgz#bf444d7afeeb94ad43c39ad2fb26151627ccba2a"
integrity sha512-xvTNwcbeDayXotnV32zLb3duQsP+4XosHpb/F+tu6VzEZFmIjzPdNk6/O+QOOx5XTh08KL2ufdXeCO33p380pQ==

"semver@2 || 3 || 4 || 5":
version "5.7.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.2.tgz#48d55db737c3287cd4835e17fa13feace1c41ef8"
Expand Down Expand Up @@ -10334,6 +10376,11 @@ [email protected]:
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424"
integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==

shallow-equal@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/shallow-equal/-/shallow-equal-1.2.1.tgz#4c16abfa56043aa20d050324efa68940b0da79da"
integrity sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA==

shallowequal@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8"
Expand Down Expand Up @@ -10705,16 +10752,18 @@ [email protected], statuses@^2.0.1:
resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c"
integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==

strapi-plugin-tagsinput@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/strapi-plugin-tagsinput/-/strapi-plugin-tagsinput-1.0.3.tgz#00c91a8a0935c93cad5be36113c09e66f9ba1fa2"
integrity sha512-4ffuZNcg2vEZsIfHthKwKpCKdNRELDjyso5FQYQ46+vq0QZP+CVfX8p0Rb0Xi4HBLNmkrJ8YjDP6bdnoTXZDVw==
strapi-plugin-tagsinput@^1.0.4:
version "1.0.4"
resolved "https://registry.yarnpkg.com/strapi-plugin-tagsinput/-/strapi-plugin-tagsinput-1.0.4.tgz#f973e8b187f9d64c2aedae5cfdb1ea5758f3972b"
integrity sha512-fsVaR5k1JxFciko57vfwavC8dpX3Xt8gNNRpOwb2moNgLSQpY7++NOle7MtVLbwYP5m0qJmHewypCeyBEW1c/Q==
dependencies:
"@babel/preset-react" "^7.23.3"
"@strapi/design-system" "^1.14.1"
"@strapi/helper-plugin" "^4.20.2"
"@strapi/icons" "^1.14.1"
axios "^1.6.7"
prop-types "^15.8.1"
react-autosuggest "^10.1.0"
react-tagsinput "^3.20.3"

[email protected]:
Expand Down

0 comments on commit 70460d9

Please sign in to comment.