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 26, 2024
1 parent b62bd07 commit f224b6a
Show file tree
Hide file tree
Showing 21 changed files with 363 additions and 365 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ jobs:
echo -e "$SSL_PRIVATE_KEY" > admin/nginx/certs/blog.live.domain.name.key && echo -e "$SSL_PUBLIC_KEY" > admin/nginx/certs/blog.live.domain.name.cert
scp -o StrictHostKeyChecking=no -i ssh_private_key -r admin/nginx ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_ADDRESS }}:blog-admin-deployment
cat admin/deploy.sh | ssh -o StrictHostKeyChecking=no -i ssh_private_key ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_ADDRESS }} 'cat > ./blog-admin-deployment/deploy.sh'
cat admin/docker-compose.yaml | ssh -o StrictHostKeyChecking=no -i ssh_private_key ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_ADDRESS }} sudo PUBLISH_PORT=${{secrets.PUBLISH_PORT}} APP_KEYS=${{secrets.APP_KEYS}} API_TOKEN_SALT=${{secrets.API_TOKEN_SALT}} ADMIN_JWT_SECRET=${{secrets.ADMIN_JWT_SECRET}} JWT_SECRET=${{secrets.JWT_SECRET}} DATABASE_CLIENT=${{secrets.DATABASE_CLIENT}} DATABASE_HOST=${{secrets.DATABASE_HOST}} DATABASE_PORT=${{secrets.DATABASE_PORT}} DATABASE_NAME=${{secrets.DATABASE_NAME}} DATABASE_USERNAME=${{secrets.DATABASE_USERNAME}} DATABASE_PASSWORD=${{secrets.DATABASE_PASSWORD}} DATABASE_SSL=${{secrets.DATABASE_SSL}} AWS_ACCOUNT_ID=${{secrets.AWS_ACCOUNT_ID}} AWS_ACCESS_KEY_ID=${{secrets.AWS_ACCESS_KEY_ID}} AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}} AWS_REGION=${{secrets.AWS_REGION}} AWS_BUCKET=${{secrets.AWS_BUCKET}} AWS_BUCKET_URL=${{secrets.AWS_BUCKET_URL}} GITHUB_SHA=${{github.sha}} GITHUB_RUN_ATTEMPT=${{github.run_attempt}} SENTRY_DSN=${{secrets.SENTRY_DSN}} HR_FROM_MAIL=${{secrets.HR_FROM_MAIL}} 'bash -c "cd blog-admin-deployment && cat > docker-compose.yaml && chmod -R 755 ./deploy.sh && ./deploy.sh && cd .. && rm -rf blog-admin-deployment"'
cat admin/docker-compose.yaml | ssh -o StrictHostKeyChecking=no -i ssh_private_key ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_ADDRESS }} sudo PUBLISH_PORT=${{secrets.PUBLISH_PORT}} APP_KEYS=${{secrets.APP_KEYS}} API_TOKEN_SALT=${{secrets.API_TOKEN_SALT}} ADMIN_JWT_SECRET=${{secrets.ADMIN_JWT_SECRET}} JWT_SECRET=${{secrets.JWT_SECRET}} DATABASE_CLIENT=${{secrets.DATABASE_CLIENT}} DATABASE_HOST=${{secrets.DATABASE_HOST}} DATABASE_PORT=${{secrets.DATABASE_PORT}} DATABASE_NAME=${{secrets.DATABASE_NAME}} DATABASE_USERNAME=${{secrets.DATABASE_USERNAME}} DATABASE_PASSWORD=${{secrets.DATABASE_PASSWORD}} DATABASE_SSL=${{secrets.DATABASE_SSL}} AWS_ACCOUNT_ID=${{secrets.AWS_ACCOUNT_ID}} AWS_ACCESS_KEY_ID=${{secrets.AWS_ACCESS_KEY_ID}} AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}} AWS_REGION=${{secrets.AWS_REGION}} AWS_BUCKET=${{secrets.AWS_BUCKET}} AWS_BUCKET_URL=${{secrets.AWS_BUCKET_URL}} GITHUB_SHA=${{github.sha}} GITHUB_RUN_ATTEMPT=${{github.run_attempt}} HR_FROM_MAIL=${{secrets.HR_FROM_MAIL}} 'bash -c "cd blog-admin-deployment && cat > docker-compose.yaml && chmod -R 755 ./deploy.sh && ./deploy.sh && cd .. && rm -rf blog-admin-deployment"'
1 change: 0 additions & 1 deletion admin/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ DATABASE_USERNAME=
DATABASE_PASSWORD=
DATABASE_SSL=
HR_FROM_MAIL=
SENTRY_DSN=
7 changes: 0 additions & 7 deletions admin/config/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,6 @@ module.exports = ({ env }) => ({
enabled: true,
resolve: "./src/plugins/guidelines", // path to guidelines folder
},
sentry: {
enabled: true,
config: {
dsn: env("SENTRY_DSN"),
sendMetadata: true,
},
},
scheduler: {
enabled: true,
config: {
Expand Down
1 change: 0 additions & 1 deletion admin/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ services:
AWS_REGION: ${AWS_REGION}
AWS_BUCKET: ${AWS_BUCKET}
AWS_BUCKET_URL: ${AWS_BUCKET_URL}
SENTRY_DSN: ${SENTRY_DSN}
HR_FROM_MAIL: ${HR_FROM_MAIL}

nginx:
Expand Down
22 changes: 10 additions & 12 deletions admin/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
{
"name": "website-blog",
"private": true,
"version": "0.1.0",
"private": true,
"description": "A headless strapi CMS for blogs website",
"license": "MIT",
"author": {
"name": "canopas"
},
"scripts": {
"build": "strapi build",
"develop": "strapi develop",
"start": "strapi start",
"build": "strapi build",
"strapi": "strapi"
},
"dependencies": {
"@_sh/strapi-plugin-ckeditor": "^1.1.3",
"@strapi/plugin-i18n": "^4.11.5",
"@strapi/plugin-sentry": "^4.12.1",
"@strapi/plugin-users-permissions": "^4.11.5",
"@strapi/provider-email-amazon-ses": "^4.11.5",
"@strapi/provider-upload-aws-s3": "^4.11.5",
Expand All @@ -27,18 +30,13 @@
"react-dom": "^18.0.0",
"react-router-dom": "^5.2.0",
"react-tagsinput": "^3.20.3",
"strapi-plugin-tagsinput": "^1.0.1",
"strapi-plugin-tagsinput": "^1.0.3",
"styled-components": "^5.2.1"
},
"author": {
"name": "canopas"
},
"strapi": {
"uuid": "b6b5fb58-ed76-44ab-8910-3857abbf3b9f"
},
"engines": {
"node": ">=14.19.1 <=18.x.x",
"npm": ">=6.0.0"
},
"license": "MIT"
"strapi": {
"uuid": "b6b5fb58-ed76-44ab-8910-3857abbf3b9f"
}
}
2 changes: 1 addition & 1 deletion admin/public/emailTemplates/comment.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion admin/public/emailTemplates/subscribe.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down
6 changes: 3 additions & 3 deletions admin/src/api/comment/controllers/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@ module.exports = createCoreController("api::comment.comment", ({ strapi }) => ({
},
},
},
},
}
);

// Send email
const emailTemplatePath = path.join(
__dirname,
"../../../../public/emailTemplates/comment.html",
"../../../../public/emailTemplates/comment.html"
);

const emailTemplate = handlebars.compile(
fs.readFileSync(emailTemplatePath, "utf8"),
fs.readFileSync(emailTemplatePath, "utf8")
)({
parent_id: parent_id,
emailTitle: `${
Expand Down
4 changes: 1 addition & 3 deletions admin/src/api/cta/content-types/cta/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": [
"images"
]
"allowedTypes": ["images"]
},
"posts": {
"type": "relation",
Expand Down
4 changes: 1 addition & 3 deletions admin/src/api/post/content-types/post/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": [
"images"
]
"allowedTypes": ["images"]
},
"summary": {
"type": "text",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Editor = ({ onChange, name, value }) => {
openStateSetter: setIsMediaLibOpen,
indexStateSetter: setMediaLibBlockIndex,
}),
[],
[]
);

const handleMediaLibChange = useCallback(
Expand All @@ -31,7 +31,7 @@ const Editor = ({ onChange, name, value }) => {
});
mediaLibToggleFunc();
},
[mediaLibBlockIndex, editorInstance],
[mediaLibBlockIndex, editorInstance]
);

const customImageTool = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const requiredTools = {
headers: {
Authorization: `Bearer ${auth.getToken()}`,
},
},
}
);

return data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const changeFunc = ({ indexStateSetter, editor, data, index }) => {
newBlockData,
{},
index + insertedBlocksCount,
true,
true
);
insertedBlocksCount++;
});
Expand Down
28 changes: 14 additions & 14 deletions admin/src/plugins/blog-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
"name": "blog-editor",
"version": "0.0.0",
"description": "This is the description of the plugin.",
"strapi": {
"name": "blog-editor",
"description": "Description of Blog Editor plugin",
"kind": "plugin",
"displayName": "Blog Editor"
"license": "MIT",
"author": {
"name": "Canopas"
},
"maintainers": [
{
"name": "Canopas"
}
],
"dependencies": {
"@editorjs/code": "2.7.0",
"@editorjs/delimiter": "1.2.0",
Expand Down Expand Up @@ -43,17 +46,14 @@
"react-router-dom": "^5.3.4",
"styled-components": "^5.3.6"
},
"author": {
"name": "Canopas"
},
"maintainers": [
{
"name": "Canopas"
}
],
"engines": {
"node": ">=16.0.0 <=20.x.x",
"npm": ">=6.0.0"
},
"license": "MIT"
"strapi": {
"name": "blog-editor",
"description": "Description of Blog Editor plugin",
"kind": "plugin",
"displayName": "Blog Editor"
}
}
4 changes: 2 additions & 2 deletions admin/src/plugins/blog-editor/server/controllers/editorjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ module.exports = ({ strapi }) => ({
success: 0,
message: e.message,
},
500,
500
);
}
},
Expand Down Expand Up @@ -95,7 +95,7 @@ module.exports = ({ strapi }) => ({
success: 0,
message: e.message,
},
500,
500
);
}
},
Expand Down
2 changes: 1 addition & 1 deletion admin/src/plugins/guidelines/admin/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default {
locale,
};
});
}),
})
);

return Promise.resolve(importedTrads);
Expand Down
2 changes: 1 addition & 1 deletion admin/src/plugins/guidelines/admin/src/pluginId.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import pluginPkg from "../../package.json";

const pluginId = pluginPkg.name.replace(
/^(@[^-,.][\w,-]+\/|strapi-)plugin-/i,
"",
""
);

export default pluginId;
30 changes: 15 additions & 15 deletions admin/src/plugins/guidelines/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
"name": "guidelines",
"version": "0.0.0",
"description": "This plugin provides a guidelines for how to use admin panel",
"strapi": {
"name": "guidelines",
"description": "This plugin provides a guidelines for how to use admin panel",
"kind": "plugin",
"displayName": "Guidelines"
"license": "MIT",
"author": {
"name": "Canopas"
},
"maintainers": [
{
"name": "Canopas"
}
],
"dependencies": {
"@strapi/design-system": "^1.6.3",
"@strapi/helper-plugin": "^4.6.0",
Expand All @@ -26,17 +29,14 @@
"react-router-dom": "^5.3.4",
"styled-components": "^5.3.6"
},
"author": {
"name": "Canopas"
},
"maintainers": [
{
"name": "Canopas"
}
],
"engines": {
"node": ">=14.19.1 <=18.x.x",
"node": ">=14.19.1 <=20.x.x",
"npm": ">=6.0.0"
},
"license": "MIT"
"strapi": {
"name": "guidelines",
"description": "This plugin provides a guidelines for how to use admin panel",
"kind": "plugin",
"displayName": "Guidelines"
}
}
Loading

0 comments on commit f224b6a

Please sign in to comment.