-
Notifications
You must be signed in to change notification settings - Fork 58
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
FORMS-14068: Enable rule-editor spa in core-components #1427
Conversation
Accessibility Violations Found
|
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
Accessibility Violations Found
|
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
Accessibility Violations Found
|
Lighthouse scores (mobile)
|
Lighthouse scores (desktop)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1427 +/- ##
=========================================
Coverage 82.40% 82.40%
Complexity 919 919
=========================================
Files 103 103
Lines 2358 2358
Branches 317 317
=========================================
Hits 1943 1943
Misses 255 255
Partials 160 160
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -32,22 +32,93 @@ | |||
ruleEditorFrame.setAttribute('id','af-rule-editor'); | |||
let formContainerPath = getFormContainerPath(editable); | |||
if (!formContainerPath) { | |||
showAlert(); | |||
if (Granite.Toggles.isEnabled("FT_FORMS-14068")) { |
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.
Core components should not reference any toggle API; ideally, this code should reside in cq-guides, and we should simply reference it here. Customers won't customize this behavior.
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 found two instances of using toggles in core component:
-
Granite:
Lines 54 to 56 in 6d4cd26
ns.aemform.v2.actions.featureEnabled = function (editable) { return Granite.Toggles.isEnabled("FT_CQ-4343036"); }; -
toggles.json api:
Lines 35 to 40 in 6d4cd26
_isFeatureEnabled = function(featureName) { toggles = toggles || httpEval("/etc.clientlibs/toggles.json"); return (toggles || { enabled: [] }).enabled.includes(featureName); },
can we use api call approach or go with cq-guides only?
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.
this is old code which was moved long back from cq-guides to core components, I would prefer the current changes to move to cq-guides. It would be dependent on FAR changes if you move to cq-guides
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.
check comments
00a4eb9
to
c79bd69
Compare
Accessibility Violations Found
|
Lighthouse scores (desktop)
|
Lighthouse scores (mobile)
|
Accessibility Violations Found
|
2 similar comments
Accessibility Violations Found
|
Accessibility Violations Found
|
* Added new HTML types to field types * Adding hidden fieldtype * updated spec version
…date time picker widget (#1432) * FORMS-16264: Fixed test cases * FORMS-16264: Remove same instantiation of datetimepicker calendar element * FORMS-16264: Resolve conflict
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.
check comments
if (typeof window.CQ.FormsCoreComponents.editorhooks.v2.openRuleEditor === 'function') { | ||
window.CQ.FormsCoreComponents.editorhooks.v2.openRuleEditor(editable); | ||
} else { | ||
let ruleEditorUri = '/aem/af/expeditor.html' + getFormContainerPath(editable) + "?fieldPath=" + editable.path + "&fieldId=" + getFieldId(editable); |
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.
This can be done like this,
const ruleEditorUri = `/aem/af/expeditor.html${getFormContainerPath(editable)}?fieldPath=${editable.path}&fieldId=${getFieldId(editable)}`;
ruleEditorFrame.setAttribute('src', ruleEditorUri);
ruleEditorFrame.setAttribute('title', 'AF Rule Editor');
const styles = {
display: "block",
width: "100%",
height: "100%",
top: "0",
left: "0",
position: "fixed",
zIndex: "10"
};
Object.assign(ruleEditorFrame.style, styles);
document.body.appendChild(ruleEditorFrame);
@@ -19,6 +19,7 @@ | |||
window.CQ = window.CQ || {}; | |||
window.CQ.FormsCoreComponents = window.CQ.FormsCoreComponents || {}; | |||
window.CQ.FormsCoreComponents.editorhooks = window.CQ.FormsCoreComponents.editorhooks || {}; | |||
window.CQ.FormsCoreComponents.editorhooks.v2 = window.CQ.FormsCoreComponents.editorhooks.v2 || {}; |
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.
Let's not add v2, it does not make sense
Creating new PR, as this is not rebasing. |
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: