0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 09:20:29 +01:00
Dieser Commit ist enthalten in:
Angus McLeod 2020-04-07 21:06:35 +10:00
Ursprung a20c74a943
Commit 6ced0cf13c
4 geänderte Dateien mit 24 neuen und 20 gelöschten Zeilen

Datei anzeigen

@ -29,6 +29,21 @@ export default Component.extend({
}
},
setupTypeOutput(fieldType, options) {
const selectionType = {
category: 'category',
tag: 'tag',
group: 'group'
}[fieldType];
if (selectionType) {
options[`${selectionType}Selection`] = 'output';
options.outputDefaultSelection = selectionType;
}
return options;
},
@discourseComputed('field.type')
contentOptions(fieldType) {
let options = {
@ -38,17 +53,18 @@ export default Component.extend({
context: 'field'
}
options = this.setupTypeOutput(fieldType, options);
if (this.isDropdown) {
options.wizardFieldSelection = 'key,value';
options.listSelection = 'assignment';
options.listSelection += ',assignment';
options.inputTypes = 'association,assignment';
options.singular = true;
options.pairConnector = 'association';
options.keyPlaceholder = 'admin.wizard.key';
options.valuePlaceholder = 'admin.wizard.value';
options.outputDefaultSelection = 'list';
}
return options;
},
@ -60,20 +76,8 @@ export default Component.extend({
userFieldSelection: 'key,value',
context: 'field'
}
let outputSelectionType = {
category: ['category'],
tag: ['tag'],
group: ['group'],
dropdown: ['list']
}[fieldType];
outputSelectionType.forEach(function(type) {
options[`${type}Selection`] = 'output';
options.outputDefaultSelection = type;
});
return options;
return this.setupTypeOutput(fieldType, options);
},
@observes('field.type')

Datei anzeigen

@ -63,7 +63,7 @@ export default Controller.extend({
let stepFields = s.fields.map((f) => {
return EmberObject.create({
id: f.id,
label: `${f.id} (${s.id})`,
label: `${f.label} (${s.id})`,
type: f.type
});
});

Datei anzeigen

@ -19,7 +19,7 @@ body.admin-wizard {
.wizard-settings-parent {
margin-bottom: 30px;
padding: 20px;
border: 1px solid $primary-medium;
border: 1px solid $primary-low;
}
.wizard-settings-group {

Datei anzeigen

@ -112,7 +112,7 @@
.type-selector {
position: absolute;
top: -22px;
width: 100%;
width: 150px;
}
.type-selector a {