Skip to content
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

Closed
wants to merge 16 commits into from

Conversation

arunattri26
Copy link
Contributor

Description

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes and the overall coverage did not decrease.
  • All unit tests pass on CircleCi.
  • I ran all tests locally and they pass.

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
focus-order-semantics minor
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 94 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@arunattri26 arunattri26 marked this pull request as draft September 30, 2024 08:22
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
focus-order-semantics minor
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 94 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
focus-order-semantics minor
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 94 96 96 75

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

Copy link

codecov bot commented Sep 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.40%. Comparing base (eac7ee0) to head (eb125d5).
Report is 3 commits behind head on dev.

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           
Flag Coverage Δ
82.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arunattri26 arunattri26 marked this pull request as ready for review September 30, 2024 09:58
@@ -32,22 +32,93 @@
ruleEditorFrame.setAttribute('id','af-rule-editor');
let formContainerPath = getFormContainerPath(editable);
if (!formContainerPath) {
showAlert();
if (Granite.Toggles.isEnabled("FT_FORMS-14068")) {
Copy link
Collaborator

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.

Copy link
Contributor Author

@arunattri26 arunattri26 Sep 30, 2024

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:

can we use api call approach or go with cq-guides only?

Copy link
Collaborator

@rismehta rismehta Sep 30, 2024

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

Copy link
Collaborator

@rismehta rismehta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check comments

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
focus-order-semantics minor
label-title-only serious
landmark-one-main moderate
region moderate
target-size serious

@adobe-bot
Copy link

Lighthouse scores (desktop)

Performance Accessibility Best-Practices SEO
Scores 100 96 96 75

@adobe-bot
Copy link

Lighthouse scores (mobile)

Performance Accessibility Best-Practices SEO
Scores 94 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

2 similar comments
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
target-size serious

TalmizAhmed and others added 2 commits October 3, 2024 15:46
* 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
Copy link
Collaborator

@rismehta rismehta left a 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);
Copy link
Collaborator

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 || {};
Copy link
Collaborator

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

@arunattri26
Copy link
Contributor Author

Creating new PR, as this is not rebasing.

@arunattri26 arunattri26 closed this Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants