Skip to content

[WC-3297] Signature web#2138

Open
gjulivan wants to merge 7 commits intomainfrom
signature-web
Open

[WC-3297] Signature web#2138
gjulivan wants to merge 7 commits intomainfrom
signature-web

Conversation

@gjulivan
Copy link
Collaborator

Pull request type


Description

@gjulivan gjulivan requested a review from a team as a code owner March 16, 2026 13:14
@gjulivan gjulivan changed the title Signature web [WC-3297] Signature web Mar 16, 2026
@gjulivan gjulivan force-pushed the signature-web branch 8 times, most recently from 1edd154 to c439717 Compare March 26, 2026 08:45
Comment on lines +15 to +22
if (imageDataUrl) {
imageSource.setValue(Utils.convertUrlToBlob(imageDataUrl));
}

// Trigger microflow to update signature attribute
if (onSignEndAction) {
onSignEndAction(imageDataUrl);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looking at the code, maybe it makes more sense to handle everything in onSignEndAction instead of scattering business logic between two places (here and wherever onSignEndAction is defined).

@@ -0,0 +1,3 @@
<!-- TODO: Update marketplace URL -->

Please see [App Events](https://docs.mendix.com/appstore/widgets/) in the Mendix documentation for details.
Copy link
Collaborator

Choose a reason for hiding this comment

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

App events

"@mendix/widget-plugin-hooks": "workspace:*",
"@mendix/widget-plugin-platform": "workspace:*",
"@mendix/widget-plugin-test-utils": "workspace:*",
"cross-env": "^7.0.3"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like we don't use this

},
"packagePath": "com.mendix.widget.web",
"marketplace": {
"minimumMXVersion": "10.8.0",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Must be higher that that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should not commit this

<caption>Height unit</caption>
<description />
<enumerationValues>
<enumerationValue key="percentageOfWidth">Auto</enumerationValue>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe it is better to name the key auto as well.

onSignEndAction?: (imageUrl?: string) => void;
wrapperStyle?: object;
readOnly: boolean;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

It is kind of confusing that is removes property and then reads it with the same name onSignEndAction and different signature. Also some properties are redefined as is, like readOnly or showGrid. I believe, if we need to change the properties shape we better pre-process them and give them a meaningful shape before passing to the underlying components. For example we can define in types that if we don't need to show grid, grid* properties are not defined. See Barcode generator for a good example.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We probably can use useResizeObserver from our common utils. We didn't do this before because it was a custom widget, not anymore.

Comment on lines +81 to +89
console.log(
"Try Initializing signature pad",
penColor,
signaturePadOptions,
canvasRef.current,
signaturePadRef.current,
imageSource,
hasSignatureAttribute
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

logging

Copy link
Collaborator

@r0b1n r0b1n Mar 26, 2026

Choose a reason for hiding this comment

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

parseStyle in this file is not being used

Comment on lines +17 to +24
<SignatureComponent
readOnly={false}
{...props}
className={className}
onSignEndAction={handleSignEnd}
clearSignature={false}
/>
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why readOnly and clearSignature are hardcoded?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants