-
Notifications
You must be signed in to change notification settings - Fork 26
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
[#3688] Add a new registration column in variables with summary #3894
[#3688] Add a new registration column in variables with summary #3894
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3894 +/- ##
=======================================
Coverage 96.34% 96.34%
=======================================
Files 711 711
Lines 22252 22252
Branches 2554 2554
=======================================
Hits 21438 21438
Misses 566 566
Partials 248 248 ☔ View full report in Codecov by Sentry. |
13127d1
to
0215eba
Compare
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.
Probably for a separate PR, but we will also need to add this mapping to the static variables tab 😬
defaultMessage: 'Edit variable registration', | ||
description: "'Edit variable registration' icon label", | ||
})} | ||
extraClassname="fa-lg actions__action" |
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.
the actions__action
class probably doesn't have any effect because there's no .actions
parent.
extraClassname="fa-lg actions__action" | |
extraClassname="fa-lg" |
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 had to use it or it wouldn't to anything on hover
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.
it violates the BEM principle, an element cannot exist without being contained inside its parent block.
src/openforms/js/components/admin/form_design/variables/registration/RegistrationsSummary.js
Outdated
Show resolved
Hide resolved
src/openforms/js/components/admin/form_design/variables/registration/RegistrationsSummary.js
Outdated
Show resolved
Hide resolved
Add JSDoc docstrings
const formVariableConfigured = backendInfo.formVariableConfigured(variableKey, backend.options); | ||
if (formVariableConfigured) { | ||
// a summary handler is guaranteed to exist if `configurableFromVariables` is true: | ||
const SummaryHandler = BACKEND_OPTIONS_FORMS[backend.key].summaryHandler; | ||
const registrationSummary = ( | ||
<SummaryHandler variableKey={variableKey} backendOptions={backend.options} /> | ||
); |
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 initially wanted to this formVariableConfigured
logic inside the component directly:
If the variable wasn't registered, it would return null
.
However, doing:
const registrationSummary =
<SummaryHandler variableKey={variableKey} backendOptions={backend.options} />
);
registrationSummary
cannot be checked against null
, as it will be a JSX component no matter the return value
So I had to an extra formVariableConfigured
function to explicitly check for this, not ideal :/
a771cd4
to
1c16984
Compare
defaultMessage: 'Edit variable registration', | ||
description: "'Edit variable registration' icon label", | ||
})} | ||
extraClassname="fa-lg actions__action" |
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.
allowing this for now until the styles are sorted out, but ideally the icons would follow the rest of the UI and be to the left:
<div style={display: 'flex'}>
<div className="actions actions--vertical">
<FAIcon extraClassName="actions__action" />
</div>
<div>
...
</div>
<div>
Part of #3688
Styling TBD