Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-10 04:12:53 +01:00
Bugfixes
Dieser Commit ist enthalten in:
Ursprung
fe7283ab3c
Commit
b81685e1d1
4 geänderte Dateien mit 5 neuen und 10 gelöschten Zeilen
|
@ -51,8 +51,6 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
const types = [this.selectorType, this.inputType];
|
const types = [this.selectorType, this.inputType];
|
||||||
|
|
||||||
console.log('running', types, option)
|
|
||||||
|
|
||||||
return option.split(',').filter(o => types.indexOf(o) !== -1).length
|
return option.split(',').filter(o => types.indexOf(o) !== -1).length
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
default as discourseComputed,
|
default as discourseComputed,
|
||||||
on
|
on
|
||||||
} from 'discourse-common/utils/decorators';
|
} from 'discourse-common/utils/decorators';
|
||||||
import { computed } from "@ember/object";
|
import { computed, set } from "@ember/object";
|
||||||
import { alias } from "@ember/object/computed";
|
import { alias } from "@ember/object/computed";
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
|
@ -48,7 +48,7 @@ export default Ember.Component.extend({
|
||||||
const pairs = this.get('input.pairs');
|
const pairs = this.get('input.pairs');
|
||||||
|
|
||||||
const pairCount = pairs.length + 1;
|
const pairCount = pairs.length + 1;
|
||||||
pairs.forEach(p => (p.set('pairCount', pairCount)));
|
pairs.forEach(p => (set(p, 'pairCount', pairCount)));
|
||||||
|
|
||||||
pairs.pushObject(
|
pairs.pushObject(
|
||||||
newPair(Object.assign(
|
newPair(Object.assign(
|
||||||
|
@ -65,7 +65,7 @@ export default Ember.Component.extend({
|
||||||
removePair(pair) {
|
removePair(pair) {
|
||||||
const pairs = this.get('input.pairs');
|
const pairs = this.get('input.pairs');
|
||||||
const pairCount = pairs.length - 1;
|
const pairCount = pairs.length - 1;
|
||||||
pairs.forEach(p => (p.set('pairCount', pairCount)));
|
pairs.forEach(p => (set(p, 'pairCount', pairCount)));
|
||||||
pairs.removeObject(pair);
|
pairs.removeObject(pair);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -279,7 +279,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if addToGroup}}
|
{{#if addToGroup}}
|
||||||
<div class="setting">
|
<div class="setting full">
|
||||||
<div class="setting-label">
|
<div class="setting-label">
|
||||||
<h3>{{i18n "admin.wizard.action.add_to_group.group"}}</h3>
|
<h3>{{i18n "admin.wizard.action.add_to_group.group"}}</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -339,7 +339,6 @@ class CustomWizard::Builder
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_user_field(value, opts = {})
|
def get_user_field(value, opts = {})
|
||||||
puts "GETTING USER FIELD: #{value.inspect}"
|
|
||||||
if value.include?('user_field_')
|
if value.include?('user_field_')
|
||||||
UserCustomField.where(user_id: @wizard.user.id, name: value).pluck(:value).first
|
UserCustomField.where(user_id: @wizard.user.id, name: value).pluck(:value).first
|
||||||
elsif UserProfile.column_names.include? value
|
elsif UserProfile.column_names.include? value
|
||||||
|
@ -617,9 +616,7 @@ class CustomWizard::Builder
|
||||||
def add_to_group(user, action, data)
|
def add_to_group(user, action, data)
|
||||||
groups = get_output(action['inputs'], multiple: true, data: data)
|
groups = get_output(action['inputs'], multiple: true, data: data)
|
||||||
|
|
||||||
groups = groups.reduce([]) do |result, g|
|
groups = groups.flatten.reduce([]) do |result, g|
|
||||||
g = g.first if g.is_a?(Array)
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
result.push(Integer(g))
|
result.push(Integer(g))
|
||||||
rescue ArgumentError
|
rescue ArgumentError
|
||||||
|
|
Laden …
In neuem Issue referenzieren