Skip to content

Scribble component #1569

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

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open

Scribble component #1569

wants to merge 10 commits into from

Conversation

rajatofficial
Copy link
Contributor

No description provided.

@rajatofficial
Copy link
Contributor Author

WIP, Looking for early feedback.

@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 93 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
page-has-heading-one moderate
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

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

1 similar comment
@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
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 92 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 Apr 8, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.26%. Comparing base (945972f) to head (2b509c8).
Report is 8 commits behind head on dev.

Files with missing lines Patch % Lines
...mponents/internal/models/v1/form/ScribbleImpl.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #1569      +/-   ##
============================================
- Coverage     82.32%   82.26%   -0.07%     
  Complexity     1000     1000              
============================================
  Files           108      109       +1     
  Lines          2603     2605       +2     
  Branches        370      370              
============================================
  Hits           2143     2143              
- Misses          272      274       +2     
  Partials        188      188              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pavi41 pavi41 force-pushed the scribble-component branch from 2ece48e to f8538c1 Compare May 7, 2025 06:21
@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 93 96 96 75

@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
page-has-heading-one moderate
target-size serious

@adobe-bot
Copy link

Accessibility Violations Found

Id Impact
label-title-only serious
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

1 similar comment
@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
page-has-heading-one 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 93 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

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

1 similar comment
@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
page-has-heading-one moderate
target-size serious

Copy link
Contributor

@sakshi-arora1 sakshi-arora1 left a comment

Choose a reason for hiding this comment

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

Why are we adding empty authoring and runtime tests?
Widget.css for scribble should be part of product, similar to date-picker widget css. Unless we have discussed and we intentionally wants to keep it as part of theme

@@ -0,0 +1,49 @@
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Copyright 2024 Adobe
Copy link
Contributor

Choose a reason for hiding this comment

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

change all copyright to 2025

* Returns the base64 encoded string of the scribble.
*
* @return Base64 encoded string representing the scribble
* @since com.adobe.cq.forms.core.components.models.form 1.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

since 5.11.0

By placing the class names `cmp-adaptiveform-scribble__label` and `cmp-adaptiveform-scribble__questionmark` within the `cmp-adaptiveform-scribble__label-container` class, you create a logical grouping of the label and question mark elements. This approach simplifies the process of maintaining a consistent styling for both elements.

## Replace feature:
We support replace feature that allows replacing Reset Button component to any of the below components:
Copy link
Contributor

Choose a reason for hiding this comment

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

should be replaced by nothing

<customFormats
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
fieldDescription="The scribble formats that are allowed to be selected by an author."
Copy link
Contributor

Choose a reason for hiding this comment

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

Have we got these approved, doesn't make much sense

The following are optional attributes that can be added to the component in the form view:
1. `data-cmp-valid` having a boolean value to indicate whether the field is currently valid or not
2. `data-cmp-required` having a boolean value to indicate whether the field is currently required or not
3. `data-cmp-readonly` having a boolean value to indicate whether the field is currently readonly or not
Copy link
Contributor

Choose a reason for hiding this comment

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

we are not exposing readonly in dialog, keep it consistent with implementation


$(document).on("dialog-ready", function() {
var $editDialog = $(EDIT_DIALOG);
if ($editDialog.length > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we don't require this, don't create it

}

.cmp-adaptiveform-scribble__questionmark {

Copy link
Contributor

Choose a reason for hiding this comment

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

inconsistent with implementation

data-cmp-visible="${scribble.visible ? 'true' : 'false'}"
data-cmp-enabled="${scribble.enabled ? 'true' : 'false'}"
data-cmp-required="${scribble.required ? 'true': 'false'}"
data-cmp-readonly="${scribble.readOnly ? 'true' : 'false'}"
Copy link
Contributor

Choose a reason for hiding this comment

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

this was removed in dialog, remove it from here as well

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have a usecase for readonly, discuss that first


<div data-sly-call="${errorMessage.errorMessage @componentId=scribble.id, bemBlock='cmp-adaptiveform-scribble'}" data-sly-unwrap></div>
<div class="cmp-adaptiveform-scribble__container" tabindex="0" role="dialog" aria-label="pleaseSignText">
<div class="cmp-adaptiveform-scribble__header">Please sign here</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not localized

<div class="cmp-adaptiveform-scribble__canvases">
<div class="cmp-adaptiveform-scribble__signcanvases" style="display:inline-block; vertical-align:top;">
<canvas class="cmp-adaptiveform-scribble__canvas"></canvas>
<input type="text" class="cmp-adaptiveform-scribble__keyboard-sign-box" name="signatureText" placeholder="Type Your Signature Here">
Copy link
Contributor

Choose a reason for hiding this comment

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

why are we removing placeholder from dialog, when we can use it here. Also the one you have hardcode is not localized

@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 93 96 96 75

@adobe-bot
Copy link

Accessibility Violations Found

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

1 similar comment
@adobe-bot
Copy link

Accessibility Violations Found

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

scribbleContainerPanel: `.${Scribble.bemBlock}__panel`,
keyboardSignBox: `.${Scribble.bemBlock}__keyboard-sign-box`,
scribbleControlPanel: `.${Scribble.bemBlock}__controlpanel`,
geoCanvasRight: `.${Scribble.bemBlock}__geocanvasright`,
Copy link
Contributor

Choose a reason for hiding this comment

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

why geoCanvasRight and not just geoCanvas?

clearControl: `.${Scribble.bemBlock}__control-clear`,
scribbleTextControl: `.${Scribble.bemBlock}__control-text`,
scribbleMessage: `.${Scribble.bemBlock}__control-message`,
clearSignButton: `.${Scribble.bemBlock}__clearsign-yes`,
Copy link
Contributor

Choose a reason for hiding this comment

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

just clearsign would do rather than clearsign-yes

scribbleTextControl: `.${Scribble.bemBlock}__control-text`,
scribbleMessage: `.${Scribble.bemBlock}__control-message`,
clearSignButton: `.${Scribble.bemBlock}__clearsign-yes`,
cancelClearSignButton: `.${Scribble.bemBlock}__clearsign-no`,
Copy link
Contributor

Choose a reason for hiding this comment

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

just cancel-clearsign would do rather than clearsign-no

clearSignButton: `.${Scribble.bemBlock}__clearsign-yes`,
cancelClearSignButton: `.${Scribble.bemBlock}__clearsign-no`,
clearSignContainer: `.${Scribble.bemBlock}__clearsign-container`,
scribbleSubmitControl: `.${Scribble.bemBlock}__control-submit`,
Copy link
Contributor

Choose a reason for hiding this comment

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

repeated in saveCanvas

scribbleSubmitControl: `.${Scribble.bemBlock}__control-submit`,
scribbleBrushList: `.${Scribble.bemBlock}__brushlist`,
signCanvases: `.${Scribble.bemBlock}__signcanvases`,
saveCanvas: `.${Scribble.bemBlock}__control-submit`,
Copy link
Contributor

Choose a reason for hiding this comment

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

why not just _save rather than control-submit

scribbleContainerPanel: `.${Scribble.bemBlock}__panel`,
keyboardSignBox: `.${Scribble.bemBlock}__keyboard-sign-box`,
scribbleControlPanel: `.${Scribble.bemBlock}__controlpanel`,
geoCanvasRight: `.${Scribble.bemBlock}__geocanvasright`,
Copy link
Contributor

Choose a reason for hiding this comment

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

we can also pre-append button in case functionality is of button

Copy link
Contributor

@sakshi-arora1 sakshi-arora1 left a comment

Choose a reason for hiding this comment

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

why we need these images, if we are taking all css to theme

<h1 class="cmp-adaptiveform-scribble__clearsign-title">Erase Current Signature?</h1>
<div class="cmp-adaptiveform-scribble__clearsign-content" class="msgBoxTypenull">
<div class="cmp-adaptiveform-scribble__clearsign-message">
This will permanently remove the signature you've drawn. Do you wish to proceed and begin again?
Copy link
Contributor

Choose a reason for hiding this comment

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

not localized

This will permanently remove the signature you've drawn. Do you wish to proceed and begin again?
</div>
<div class="cmp-adaptiveform-scribble__clearsign-panel">
<button type="button" id="msgBox_No" class="cmp-adaptiveform-scribble__clearsign-no">Cancel</button>
Copy link
Contributor

Choose a reason for hiding this comment

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

not locallized

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.

4 participants