1
0
Fork 0
Dieser Commit ist enthalten in:
Angus McLeod 2020-04-07 18:33:51 +10:00
Ursprung 2e272f3ef4
Commit 539f61c610
6 geänderte Dateien mit 23 neuen und 16 gelöschten Zeilen

Datei anzeigen

@ -17,6 +17,13 @@ export default Component.extend({
connectors: computed(function() { return connectorContent('output', this.input.type, this.options) }), connectors: computed(function() { return connectorContent('output', this.input.type, this.options) }),
inputTypes: computed(function() { return inputTypesContent(this.options) }), inputTypes: computed(function() { return inputTypesContent(this.options) }),
@observes('input.type')
setupPairs() {
if (this.hasPairs && (!this.input.pairs || this.input.pairs.length < 1)) {
this.send('addPair');
}
},
actions: { actions: {
addPair() { addPair() {
const pairs = this.input.pairs; const pairs = this.input.pairs;

Datei anzeigen

@ -25,5 +25,5 @@
{{/if}} {{/if}}
{{#if showRemove}} {{#if showRemove}}
<a {{action removePair pair}} class="remove-pair">{{d-icon 'minus'}}</a> <a {{action removePair pair}} class="remove-pair">{{d-icon 'times'}}</a>
{{/if}} {{/if}}

Datei anzeigen

@ -20,7 +20,6 @@ export default {
const autocomplete = requirejs('discourse/lib/autocomplete').default; const autocomplete = requirejs('discourse/lib/autocomplete').default;
const cook = requirejs('discourse/plugins/discourse-custom-wizard/wizard/lib/text-lite').cook; const cook = requirejs('discourse/plugins/discourse-custom-wizard/wizard/lib/text-lite').cook;
const Singleton = requirejs("discourse/mixins/singleton").default; const Singleton = requirejs("discourse/mixins/singleton").default;
const WizardFieldDropdown = requirejs('wizard/components/wizard-field-dropdown').default;
const Store = requirejs("discourse/models/store").default; const Store = requirejs("discourse/models/store").default;
const registerRawHelpers = requirejs("discourse-common/lib/raw-handlebars-helpers").registerRawHelpers; const registerRawHelpers = requirejs("discourse-common/lib/raw-handlebars-helpers").registerRawHelpers;
const RawHandlebars = requirejs("discourse-common/lib/raw-handlebars").default; const RawHandlebars = requirejs("discourse-common/lib/raw-handlebars").default;
@ -277,11 +276,5 @@ export default {
return valid; return valid;
} }
}); });
WizardFieldDropdown.reopen({
didInsertElement() {
console.log(this.field)
}
})
} }
}; };

Datei anzeigen

@ -20,7 +20,7 @@
> .mapper-connector.single { > .mapper-connector.single {
width: min-content; width: min-content;
margin-bottom: 5px; margin-bottom: 10px;
height: 20px; height: 20px;
border: 2px solid $primary-low; border: 2px solid $primary-low;
} }
@ -64,6 +64,10 @@
font-size: 0.8em; font-size: 0.8em;
border: 2px solid $primary-low; border: 2px solid $primary-low;
} }
&.association, &.validation {
padding-right: 27px;
}
} }
.add-mapper-input { .add-mapper-input {
@ -156,6 +160,12 @@
align-items: center; align-items: center;
position: relative; position: relative;
.add-pair,
.remove-pair,
.join-pair {
font-size: 0.9em;
}
.add-pair { .add-pair {
margin-top: 5px; margin-top: 5px;
} }
@ -163,7 +173,7 @@
.remove-pair { .remove-pair {
position: absolute; position: absolute;
top: 5px; top: 5px;
right: -25px; right: -20px;
} }
.join-pair { .join-pair {

Datei anzeigen

@ -265,10 +265,7 @@ class CustomWizard::Builder
CustomWizard::Mapper.new( CustomWizard::Mapper.new(
inputs: prefill, inputs: prefill,
user: @wizard.user, user: @wizard.user,
data: @submissions.last, data: @submissions.last
opts: {
debug: true
}
).perform ).perform
end end
end end

Datei anzeigen

@ -138,7 +138,7 @@ class CustomWizard::Mapper
end end
end end
def map_wizard(value) def map_wizard_field(value)
data && !data.key?("submitted_at") && data[value] data && !data.key?("submitted_at") && data[value]
end end