-
Notifications
You must be signed in to change notification settings - Fork 58
UE: Support for fd:customDisplayFormat #1619
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
Merged
+190
−0
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,10 @@ public abstract class AbstractFieldImpl extends AbstractBaseImpl implements Fiel | |
@Nullable | ||
protected String displayFormat; | ||
|
||
@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = ReservedProperties.PN_CUSTOM_DISPLAY_FORMAT) | ||
@Nullable | ||
protected String customDisplayFormat; | ||
|
||
@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL, name = ReservedProperties.PN_EDIT_FORMAT) | ||
@Nullable | ||
protected String editFormat; | ||
|
@@ -165,6 +169,9 @@ public String getPlaceHolder() { | |
@Override | ||
@Nullable | ||
public String getDisplayFormat() { | ||
if (customDisplayFormat != null) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This property will only be present for EDS use-case, hence merging this. I don't think this would impact existing core component based form. It might impact use-cases where EDS form is created using crispr json, which @TalmizAhmed can fix separately |
||
return customDisplayFormat; | ||
} | ||
return displayFormat; | ||
} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...ore/src/test/resources/form/datepicker/exporter-datepicker-with-both-display-formats.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"id": "datepicker-bbbb612dba", | ||
"fieldType": "date-input", | ||
"name": "abc", | ||
"type": "string", | ||
"displayFormat": "DD/MM/YYYY", | ||
"label": { | ||
"value": "def" | ||
}, | ||
"events": { | ||
"custom:setProperty": [ | ||
"$event.payload" | ||
] | ||
}, | ||
"properties": { | ||
"fd:dor": { | ||
"dorExclusion": false | ||
}, | ||
"fd:path": "/content/datepicker-with-both-display-formats" | ||
}, | ||
"format": "date", | ||
":type": "core/fd/components/form/datepicker/v1/datepicker" | ||
} |
23 changes: 23 additions & 0 deletions
23
...re/src/test/resources/form/datepicker/exporter-datepicker-with-custom-display-format.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"id": "datepicker-b80fc90202", | ||
"fieldType": "date-input", | ||
"name": "abc", | ||
"type": "string", | ||
"displayFormat": "DD/MM/YYYY", | ||
"label": { | ||
"value": "def" | ||
}, | ||
"events": { | ||
"custom:setProperty": [ | ||
"$event.payload" | ||
] | ||
}, | ||
"properties": { | ||
"fd:dor": { | ||
"dorExclusion": false | ||
}, | ||
"fd:path": "/content/datepicker-with-custom-display-format" | ||
}, | ||
"format": "date", | ||
":type": "core/fd/components/form/datepicker/v1/datepicker" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...e/src/test/resources/form/numberinput/exporter-numberinput-with-both-display-formats.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"id": "numberinput-54ced6bd67", | ||
"fieldType": "number-input", | ||
"name": "abc", | ||
"type": "number", | ||
"displayFormat": "customCurrency", | ||
"label": { | ||
"value": "def" | ||
}, | ||
"events": { | ||
"custom:setProperty": [ | ||
"$event.payload" | ||
] | ||
}, | ||
"properties": { | ||
"fd:dor": { | ||
"dorExclusion": false | ||
}, | ||
"fd:path": "/content/numberinput-with-both-display-formats" | ||
}, | ||
":type": "core/fd/components/form/numberinput/v1/numberinput" | ||
} |
22 changes: 22 additions & 0 deletions
22
.../src/test/resources/form/numberinput/exporter-numberinput-with-custom-display-format.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"id": "numberinput-7e9f700655", | ||
"fieldType": "number-input", | ||
"name": "abc", | ||
"type": "number", | ||
"displayFormat": "customCurrency", | ||
"label": { | ||
"value": "def" | ||
}, | ||
"events": { | ||
"custom:setProperty": [ | ||
"$event.payload" | ||
] | ||
}, | ||
"properties": { | ||
"fd:dor": { | ||
"dorExclusion": false | ||
}, | ||
"fd:path": "/content/numberinput-with-custom-display-format" | ||
}, | ||
":type": "core/fd/components/form/numberinput/v1/numberinput" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 confusing, we already have displayFormat property for this, why do you need fd:customDisplayFormat ?
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.
@rismehta The property
displayFormat
is used for OOTB display formats and custom display formats, which does not allow us to support custom formats in UE. Therefore I have created a separate property just like for the Multiselect in dropdown PRcc: @jalagari @ravise5