Skip to content

Commit

Permalink
Upgrade: tagsinput plugin and format code
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sumi-k committed Feb 23, 2024
1 parent b62bd07 commit 36950e9
Show file tree
Hide file tree
Showing 20 changed files with 2,615 additions and 895 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"'
2 changes: 1 addition & 1 deletion admin/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ DATABASE_USERNAME=
DATABASE_PASSWORD=
DATABASE_SSL=
HR_FROM_MAIL=
SENTRY_DSN=
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
23 changes: 10 additions & 13 deletions admin/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
{
"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": {
Expand All @@ -18,27 +22,20 @@
"@strapi/provider-upload-aws-s3": "^4.11.5",
"@strapi/strapi": "^4.14.3",
"@webbio/strapi-plugin-scheduler": "^1.0.6",
"html-loader": "^5.0.0",
"jsdom": "^22.1.0",
"markdown-loader": "^8.0.0",
"pg": "^8.11.1",
"puppeteer": "^22.0.0",
"react": "^18.0.0",
"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
Loading

0 comments on commit 36950e9

Please sign in to comment.