geer-builder 1.2.489 → 1.2.493

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.
@@ -48,11 +48,16 @@ import DB_SLOT from '../../models/DB_SLOT';
48
48
  unplaced_slots: [],
49
49
  disable_submit: false,
50
50
  merge_unplaced:[],
51
+ hide_slot:false,
52
+ hide_slot_list:[],
53
+ public_settings:{},
51
54
  }),
52
55
  async mounted()
53
56
  {
54
57
  await this.$_getSlotInfo()
55
58
  this.loading = true;
59
+ this.public_settings = await this.$_getData('public_settings');
60
+ this.getDisableSlotList();
56
61
  this.getListOfUnplacedSlots();
57
62
  this.field.placement = this.placement;
58
63
  this.field.position = this.position;
@@ -62,6 +67,17 @@ import DB_SLOT from '../../models/DB_SLOT';
62
67
  unplaced_slots()
63
68
  {
64
69
  this.disable_submit = false;
70
+
71
+ if(this.hide_slot)
72
+ {
73
+ for( var i = 0; i < this.unplaced_slots.length; i++)
74
+ {
75
+ if ( this.hide_slot_list.includes(this.unplaced_slots[i].membership_id)) {
76
+ this.unplaced_slots.splice(i, 1);
77
+ i--;
78
+ }
79
+ }
80
+ }
65
81
 
66
82
  if(this.unplaced_slots.length > 0)
67
83
  {
@@ -90,6 +106,14 @@ import DB_SLOT from '../../models/DB_SLOT';
90
106
  },
91
107
  methods:
92
108
  {
109
+ async getDisableSlotList()
110
+ {
111
+ if(this.public_settings.hasOwnProperty('disable_slot_placement') && this.public_settings.disable_slot_placement.active)
112
+ {
113
+ this.hide_slot_list = this.public_settings.disable_slot_placement.membership_id ? this.public_settings.disable_slot_placement.membership_id : [];
114
+ this.hide_slot = true;
115
+ }
116
+ },
93
117
  async getListOfUnplacedSlots()
94
118
  {
95
119
  await this.$bind('unplaced_slots', new DB_SLOT().collection().where('sponsor', "==", this.current_slot_info.slot_code).where('placed', "==", false));
@@ -29,11 +29,10 @@
29
29
  </template>
30
30
 
31
31
  <script>
32
- import SlotTypeOptions from '../references/refs_slot_type';
32
+ import SlotTypeOptions from '../references/refs_slot_type';
33
33
  import GlobalMixins from '../mixins/global_mixins.js';
34
-
35
- import DB_SLOT from '../models/DB_SLOT';
36
- export default
34
+ import DB_SLOT from '../models/DB_SLOT';
35
+ export default
37
36
  {
38
37
  mixins: [GlobalMixins],
39
38
  name: "AddDialog",
@@ -48,11 +47,16 @@ import GlobalMixins from '../mixins/global_mixins.js';
48
47
  },
49
48
  unplaced_slots: [],
50
49
  disable_submit: false,
50
+ hide_slot:false,
51
+ hide_slot_list:[],
52
+ public_settings:{},
51
53
  }),
52
54
  async mounted()
53
55
  {
54
56
  await this.$_getSlotInfo()
57
+ this.public_settings = await this.$_getData('public_settings');
55
58
  this.loading = true;
59
+ this.getDisableSlotList();
56
60
  this.getListOfUnplacedSlots();
57
61
  this.field.placement = this.placement;
58
62
  this.field.position = this.position;
@@ -61,6 +65,17 @@ import GlobalMixins from '../mixins/global_mixins.js';
61
65
  {
62
66
  unplaced_slots()
63
67
  {
68
+ if(this.hide_slot)
69
+ {
70
+ for( var i = 0; i < this.unplaced_slots.length; i++)
71
+ {
72
+ if ( this.hide_slot_list.includes(this.unplaced_slots[i].membership_id)) {
73
+ this.unplaced_slots.splice(i, 1);
74
+ i--;
75
+ }
76
+ }
77
+ }
78
+
64
79
  this.disable_submit = false;
65
80
 
66
81
  if(this.unplaced_slots.length > 0)
@@ -84,6 +99,14 @@ import GlobalMixins from '../mixins/global_mixins.js';
84
99
  },
85
100
  methods:
86
101
  {
102
+ async getDisableSlotList()
103
+ {
104
+ if(this.public_settings.hasOwnProperty('disable_slot_placement') && this.public_settings.disable_slot_placement.active)
105
+ {
106
+ this.hide_slot_list = this.public_settings.disable_slot_placement.membership_id ? this.public_settings.disable_slot_placement.membership_id : [];
107
+ this.hide_slot = true;
108
+ }
109
+ },
87
110
  async getListOfUnplacedSlots()
88
111
  {
89
112
  this.$bind('unplaced_slots', new DB_SLOT().collection().where('sponsor', "==", this.current_slot_info.slot_code).where('placed', "==", false));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "geer-builder",
3
- "version": "1.2.489",
3
+ "version": "1.2.493",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {