0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-09 20:02:54 +01:00
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

@ -16,6 +16,13 @@ export default Component.extend({
canAddPair: not('isAssignment'),
connectors: computed(function() { return connectorContent('output', this.input.type, 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: {
addPair() {

Datei anzeigen

@ -25,5 +25,5 @@
{{/if}}
{{#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}}

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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

Datei anzeigen

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