geer-builder 1.2.489 → 1.2.490

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,10 +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';
34
+ import DB_SLOT from '../models/DB_SLOT';
35
+ import { log } from 'console';
36
36
  export default
37
37
  {
38
38
  mixins: [GlobalMixins],
@@ -48,11 +48,16 @@ import GlobalMixins from '../mixins/global_mixins.js';
48
48
  },
49
49
  unplaced_slots: [],
50
50
  disable_submit: false,
51
+ hide_slot:false,
52
+ hide_slot_list:[],
53
+ public_settings:{},
51
54
  }),
52
55
  async mounted()
53
56
  {
54
57
  await this.$_getSlotInfo()
58
+ this.public_settings = await this.$_getData('public_settings');
55
59
  this.loading = true;
60
+ this.getDisableSlotList();
56
61
  this.getListOfUnplacedSlots();
57
62
  this.field.placement = this.placement;
58
63
  this.field.position = this.position;
@@ -61,6 +66,17 @@ import GlobalMixins from '../mixins/global_mixins.js';
61
66
  {
62
67
  unplaced_slots()
63
68
  {
69
+ if(this.hide_slot)
70
+ {
71
+ for( var i = 0; i < this.unplaced_slots.length; i++)
72
+ {
73
+ if ( this.hide_slot_list.includes(this.unplaced_slots[i].membership_id)) {
74
+ this.unplaced_slots.splice(i, 1);
75
+ i--;
76
+ }
77
+ }
78
+ }
79
+
64
80
  this.disable_submit = false;
65
81
 
66
82
  if(this.unplaced_slots.length > 0)
@@ -84,6 +100,14 @@ import GlobalMixins from '../mixins/global_mixins.js';
84
100
  },
85
101
  methods:
86
102
  {
103
+ async getDisableSlotList()
104
+ {
105
+ if(this.public_settings.hasOwnProperty('disable_slot_placement') && this.public_settings.disable_slot_placement.active)
106
+ {
107
+ this.hide_slot_list = this.public_settings.disable_slot_placement.membership_id ? this.public_settings.disable_slot_placement.membership_id : [];
108
+ this.hide_slot = true;
109
+ }
110
+ },
87
111
  async getListOfUnplacedSlots()
88
112
  {
89
113
  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.490",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {