-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/stepper #40
Merged
Merged
Feature/stepper #40
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
59a90cb
add stepper widget and setup (wip)
haroun 9b71205
add stepper fieldset
haroun 4600024
add stepper widget player
haroun 51aad83
Merge branch 'main' into feature/stepper
haroun efbf8a5
add steps javascript
haroun a9be16c
remove stepper
haroun 3fa7af4
remove stepper references + add group
haroun 61d39e1
add group to fieldset style
haroun 4b26eaa
normalize wording keys
haroun 3ea5eb1
add info about group widget
haroun 150f2f3
add changelog
haroun f977be1
rename process into processor to avoid name conflicts
haroun e013932
rename process into processor
haroun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
module.exports = { | ||
extend: '@apostrophecms/widget-type', | ||
options: { | ||
label: 'aposForm:group', | ||
className: 'apos-form-group', | ||
icon: 'file-multiple-outline-icon' | ||
}, | ||
icons: { | ||
'file-multiple-outline-icon': 'FileMultipleOutline' | ||
}, | ||
fields (self) { | ||
// Prevent nested groups | ||
const form = self.options.apos.modules['@apostrophecms/form']; | ||
const { | ||
'@apostrophecms/form-group': groupWidget, | ||
...formWidgets | ||
} = form.fields.contents.options.widgets; | ||
|
||
return { | ||
add: { | ||
groups: { | ||
label: 'aposForm:groupGroups', | ||
type: 'array', | ||
required: true, | ||
titleField: 'label', | ||
inline: true, | ||
fields: { | ||
add: { | ||
label: { | ||
label: 'aposForm:groupGroupsLabel', | ||
type: 'string', | ||
required: true | ||
}, | ||
contents: { | ||
label: 'aposForm:groupGroupsContents', | ||
help: 'aposForm:groupGroupsContentsHelp', | ||
type: 'area', | ||
contextual: false, | ||
options: { | ||
widgets: formWidgets | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
} | ||
}; |
13 changes: 13 additions & 0 deletions
13
modules/@apostrophecms/form-group-widget/views/widget.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{% set prependIfPrefix = apos.modules['@apostrophecms/form'].prependIfPrefix %} | ||
|
||
<div data-apos-form-groups class="apos-form-groups {{ prependIfPrefix('__groups') }}"> | ||
{% for group in data.widget.groups %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice. I guess from the POV of the code that handles form submissions it just hoovers up the nested fields like everything else? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep |
||
<fieldset | ||
class="apos-form-group {{ prependIfPrefix('__group') }}" | ||
data-index="{{ loop.index }}" | ||
> | ||
<legend>{{ group.label }}</legend> | ||
{% area group, 'contents' %} | ||
</fieldset> | ||
{% endfor %} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't call a variable
process
because code in the module might need to access theprocess
global at some point.