strapi-plugin-i-relate-to-this 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -14,6 +14,20 @@ Imagine having hunderds of relations to some campaign which ends, you unpublish
14
14
 
15
15
  This plugin lists all entities that have uni-relations (deeply nested in DZs/components) to the current entity you are editing. It will warn you (⚠) when the (source) entity is published but the related (target) entity does not contain the relation in their published version.
16
16
 
17
+ ## Options
18
+
19
+ You can make a contentType opt out of being found by setting:
20
+
21
+ ```
22
+ pluginOptions: {
23
+ 'i-relate-to-this': {
24
+ exclude: true,
25
+ },
26
+ },
27
+ ```
28
+
29
+ For example: you have form submissions that have a uni-relation to the form it has been submitted to, and you don't want to list all submissions when you navigate to the form, use this.
30
+
17
31
  ## Help wanted
18
32
 
19
33
  Currently, I have been focussing on getting the data from the db. The UI isn't pretty. Feel free to make a PR to make it pretty, or to improve the lookup logic. Thanks <3
@@ -76,6 +76,9 @@ const search = async (id, status, parent) => {
76
76
  ) {
77
77
  return acc;
78
78
  }
79
+ if (model.pluginOptions["i-relate-to-this"]?.exclude === true) {
80
+ return acc;
81
+ }
79
82
  return acc.concat({
80
83
  key,
81
84
  type,
@@ -72,6 +72,9 @@ const search = async (id, status, parent) => {
72
72
  ) {
73
73
  return acc;
74
74
  }
75
+ if (model.pluginOptions["i-relate-to-this"]?.exclude === true) {
76
+ return acc;
77
+ }
75
78
  return acc.concat({
76
79
  key,
77
80
  type,
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.4.1",
2
+ "version": "0.5.0",
3
3
  "keywords": [],
4
4
  "type": "commonjs",
5
5
  "exports": {