Skip to content

Commit

Permalink
normalize wording keys
Browse files Browse the repository at this point in the history
  • Loading branch information
haroun committed Oct 24, 2023
1 parent 61d39e1 commit 4b26eaa
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 27 deletions.
12 changes: 5 additions & 7 deletions i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,14 @@
"formName": "Form name",
"forms": "Forms",
"globalGroup": "Form Settings",
"group": "Group",
"groupAdvanced": "Advanced",
"groupAfterSubmission": "After submission",
"groupForm": "Form",

"group": "Group",
"groupContents": "Groups Contents",
"groupContentsHelp": "Contains all form widgets excepts groups",
"groupLabel": "Group Label",
"groups": "Groups",

"groupGroups": "Groups",
"groupGroupsContents": "Groups Contents",
"groupGroupsContentsHelp": "Contains all form widgets excepts groups",
"groupGroupsLabel": "Group Label",
"notFoundForm": "No matching form was found",
"queryParamKey": "Key",
"queryParamLimit": "Limit Saved Parameter Value Length (characters)",
Expand Down
4 changes: 1 addition & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ module.exports = {
const group = {
basics: {
label: 'aposForm:groupForm',
fields: [
'contents'
]
fields: [ 'contents' ]
},
afterSubmit: {
label: 'aposForm:groupAfterSubmission',
Expand Down
14 changes: 8 additions & 6 deletions modules/@apostrophecms/form-group-widget/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,29 @@ module.exports = {
fields (self) {
// Prevent nested groups
const form = self.options.apos.modules['@apostrophecms/form'];
const formWidgets = Object.assign({}, form.fields.contents.options.widgets);
delete formWidgets['@apostrophecms/form-group'];
const {
'@apostrophecms/form-group': groupWidget,
...formWidgets
} = form.fields.contents.options.widgets;

return {
add: {
groups: {
label: 'aposForm:groups',
label: 'aposForm:groupGroups',
type: 'array',
required: true,
titleField: 'label',
inline: true,
fields: {
add: {
label: {
label: 'aposForm:groupLabel',
label: 'aposForm:groupGroupsLabel',
type: 'string',
required: true
},
contents: {
label: 'aposForm:groupContents',
help: 'aposForm:groupContentsHelp',
label: 'aposForm:groupGroupsContents',
help: 'aposForm:groupGroupsContentsHelp',
type: 'area',
contextual: false,
options: {
Expand Down
8 changes: 0 additions & 8 deletions modules/@apostrophecms/form-group-widget/ui/src/index.scss

This file was deleted.

2 changes: 1 addition & 1 deletion modules/@apostrophecms/form-group-widget/views/widget.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% set prependIfPrefix = apos.modules['@apostrophecms/form'].prependIfPrefix %}

<div data-apos-form-groups class="apos-form-groups {{ prependIfPrefix('__group') }}">
<div data-apos-form-groups class="apos-form-groups {{ prependIfPrefix('__groups') }}">
{% for group in data.widget.groups %}
<fieldset
class="apos-form-group {{ prependIfPrefix('__group') }}"
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"form builder"
],
"devDependencies": {
"apostrophe": "^3.4.0",
"apostrophe": "^3.58.1",
"eslint": "^8.50.0",
"eslint-config-apostrophe": "^4.1.0",
"eslint-config-standard": "^17.1.0",
Expand All @@ -38,4 +38,4 @@
"dependencies": {
"connect-multiparty": "^2.2.0"
}
}
}

0 comments on commit 4b26eaa

Please sign in to comment.