notum-cz / strapi-plugin-record-locking Goto Github PK
View Code? Open in Web Editor NEWThis plugin provides the functionality to prevent data loss in cases where multiple users are simultaneously editing the same record within STRAPI v4.
This plugin provides the functionality to prevent data loss in cases where multiple users are simultaneously editing the same record within STRAPI v4.
There will be a new option to only enable/disable this plugins functionality on specific types of collections.
Hi there,
I've stumbled across this type of error while generating the types using npm run strapi ts:generate-types --verbose
and I'm not sure if I'm doing something wrong or if is a real bug.
Output:
npm run strapi ts:generate-types --verbose
npm verb cli /.nvm/versions/node/v20.10.0/bin/node /Users/*****/.nvm/versions/node/v20.10.0/bin/npm
npm info using [email protected]
npm info using [email protected]
npm verb title npm run strapi ts:generate-types
npm verb argv "run" "strapi" "ts:generate-types" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/.npm/_logs/2024-02-07T19_34_38_766Z-
npm verb logfile /.npm/_logs/2024-02-07T19_34_38_766Z-debug-0.log
> [email protected] strapi
> strapi ts:generate-types
Starting the compilation for TypeScript files in ***********/************/*********/***
[INFO] [2024-02-07T19:34:42.749Z] (Typegen) Starting the type generation process
[INFO] [2024-02-07T19:34:42.749Z] (Typegen) Generating types for contentTypes
(node:76434) Warning: The upload provider "strapi-provider-upload-static-service" doesn't implement the uploadStream function. Strapi will fallback on the upload method. Some performance issues may occur.
(Use `node --trace-warnings ...` to show where the warning was created)
[INFO] [2024-02-07T19:34:42.971Z] (Typegen) Generating types for components
[INFO] [2024-02-07T19:34:43.077Z] (Typegen) Saved contentTypes types in ../../../../../types/generated/contentTypes.d.ts
[INFO] [2024-02-07T19:34:43.077Z] (Typegen) Saved components types in ../../../../../types/generated/components.d.ts
[INFO] [2024-02-07T19:34:43.077Z] (Typegen) The task completed successfully with 0 warning(s) and 0 error(s) in 0.328s.
/node_modules/@notum-cz/strapi-plugin-record-locking/server/destroy.js:7
strapi.db.query("plugin::record-locking.open-entity").deleteMany();
^
TypeError: Cannot read properties of undefined (reading 'query')
at module.exports [as destroy] (node_modules/@notum-cz/strapi-plugin-record-locking/server/destroy.js:7:13)
at Object.destroy (/node_modules/@strapi/strapi/lib/core/domain/module/index.js:54:45)
at Object.destroy (/node_modules/@strapi/strapi/lib/core/registries/modules.js:38:19)
at async Strapi.runLifecyclesFunctions (/node_modules/@strapi/strapi/lib/Strapi.js:546:5)
at async Strapi.destroy (/node_modules/@strapi/strapi/lib/Strapi.js:231:5)
Node.js v20.10.0
npm verb exit 1
npm verb code 1
I'm using the following dependencies
@notum-cz/strapi-plugin-record-locking
version 1.6.6
typescript
version 4.9.5
@strapi/strapi
version 4.10.5
@strapi/utils
version 4.9.0
Let me know if you need more information
Thank you
Strapi persist DB rows of conenctions and websocket even strapi is restarted
Record lock even when the content manager has left the page ( go back, close tab/browser)
steps to reproduce:
1 open any entry
2 close tab
3 open another browser/incognito window
4 login under another account
5 open the same record
Strapi Version: 4.10.2
Node/Yarn Version: yarn/1.22.11 npm/? node/v18.16.0 darwin x64
Edition: Community
Database: postgres
"@notum-cz/strapi-plugin-record-locking": "^0.3.3"
Hi!
Thanks for the nice plugin!
I have tried record locking with two admin users.
The user who edited later was indeed unable to edit, but that was because the screen was whiteed out and an error was output to the console
Since a record was created in "record-locking_open-entity" for an exclusivity check, there may be a problem on the "admin panel" source side.
│ Environment │ development │
│ Process PID │ 70604 │
│ Version │ 4.1.12 (node v16.14.0) │
│ Edition │ Enterprise
Entity is locked when you creating new one, creating should be without restrictions.
Great plugin - thanks for doing this!
I saw there were dependabot PRs, but there are other out-of-date/insecure dependencies as well. Is there a plan to do an upgrade cycle soon and push a release? how can the community help?
I assume that at the moment the socket connection state lies inside the application. This is a problem for my project, because my application is on different replicas at the same time and because of this, sockets cannot establish the correct connection. Is such an opportunity planned?
Since we started using this more, had one suggestion for a translation for the English - change This entry is currently edited by {username}
to This entry is currently being edited by {username}
(i.e. adding being
)
Put a PR in at #84
Example results here:
> strapi report
Launched In: 859 ms
Environment: development
OS: darwin-arm64
Strapi Version: 4.22.0
Node/Yarn Version: npm/10.5.1 node/v20.12.1 darwin arm64 workspaces/false
Edition: Community
Database: mysql2
TypeError: Cannot read properties of undefined (reading 'query')
at module.exports [as destroy] (/Users/REDACTED/REDACTED/REDACTED/node_modules/@notum-cz/strapi-plugin-record-locking/server/destroy.js:7:13)
at Object.destroy (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/core/domain/module/index.js:53:45)
at Object.destroy (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/core/registries/modules.js:33:19)
at async Strapi.runLifecyclesFunctions (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/Strapi.js:440:5)
at async Strapi.destroy (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/Strapi.js:226:5)
at async action (/Users/REDACTED/REDACTED/REDACTED/node_modules/@strapi/strapi/dist/commands/actions/report/action.js:26:3)
Package dependencies and plugins:
"dependencies": {
"@babel/core": "^7.18.0",
"@notum-cz/strapi-plugin-record-locking": "^0.2.4",
"@strapi/admin": "^4.2.0",
"@strapi/database": "^4.2.0",
"@strapi/helper-plugin": "^4.2.0",
"@strapi/plugin-content-manager": "^4.2.0",
"@strapi/plugin-content-type-builder": "^4.2.0",
"@strapi/plugin-documentation": "^4.2.0",
"@strapi/plugin-email": "^4.2.0",
"@strapi/plugin-graphql": "^4.2.0",
"@strapi/plugin-i18n": "4.2.0",
"@strapi/plugin-sentry": "^4.2.0",
"@strapi/plugin-seo": "^1.7.3",
"@strapi/plugin-upload": "^4.2.0",
"@strapi/plugin-users-permissions": "^4.2.0",
"@strapi/provider-upload-aws-s3": "^4.2.0",
"@strapi/provider-upload-local": "^4.2.0",
"@strapi/strapi": "4.2.0",
"@strapi/utils": "^4.2.0",
"css-loader": "^6.7.1",
"knex": "^0.21.21",
"objection": "^2.2.18",
"pg": "8.7.1",
"strapi-plugin-email-designer": "^2.1.1",
"strapi-plugin-import-export-entries": "^1.4.1",
"strapi-plugin-notes": "^1.0.1",
"strapi-plugin-publisher": "^1.1.3",
"strapi-plugin-react-editorjs": "^2.0.1",
"strapi-provider-upload-aws-s3": "4.2.0",
"style-loader": "^3.3.1",
"webpack": "^5.72.1"
},
Single Types do not load in the admin panel Content Manager. I have tested this with and without internationalization, with and without React Dev Tools active on the site, and running the server in develop and production modes.
The Single Type edit page should load and allow entries added.
This screenshot shows the exact error shown in Chrome Dev Tools
This screenshot shows the API requests for the single type comes back successful.
Here are the permissions set for Single Types in our server:
Note that Strapi can successfully retrieve all relevant information via API requests to Single Types still. This appears to solely be a bug related to how the record locking plugin interacts with rendering the Strapi frontend.
Upgrading to Strapi v 4.2.0 nor returning to original v 4.1.11 resolved the issue.
I am confident that the record locking plugin is the culprit as removing the plugin immediately restores access to Single Types.
When i updated version from 0.3.0 to 1.3.0 i cannot open any existing content-type or create new one. I have this errors in console.
Current version of strapi 4.14.0
Node Version: 18
I can see that master branch supports node v18.
Is it possible to publish a new release so that we can use this version via npm?
Thanks
Bump Node Version to 20.x.x
In certain situations, it may be necessary to allow users to continue editing content. For example when another user unintentionally leaves the editor open in one browser tab while working on something else in a different tab, thus forgetting about the open editor. To address such scenarios, it is advisable to implement a "Takeover" button.
Additionally, it is crucial to conduct role-based checks to ensure so roles with lower access can not overtake for example super admin.
I have a small PR I wanted to make in regards to some grammar issues. Permission denied though.
Is this plugin Strapi Backen UI Only?
Could not find that bit on the info page.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.