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

LPS-144158 Fragment viewport textAlign property is not exported #6805

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,6 +1,6 @@
Bundle-Name: Liferay Headless Delivery API
Bundle-SymbolicName: com.liferay.headless.delivery.api
Bundle-Version: 35.0.4
Bundle-Version: 35.1.0
Export-Package:\
com.liferay.headless.delivery.dto.v1_0,\
com.liferay.headless.delivery.dto.v1_0.util,\
Expand Down
Expand Up @@ -316,6 +316,34 @@ public void setPaddingTop(
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected String paddingTop;

@Schema(description = "The fragment viewport's text align.")
public String getTextAlign() {
return textAlign;
}

public void setTextAlign(String textAlign) {
this.textAlign = textAlign;
}

@JsonIgnore
public void setTextAlign(
UnsafeSupplier<String, Exception> textAlignUnsafeSupplier) {

try {
textAlign = textAlignUnsafeSupplier.get();
}
catch (RuntimeException re) {
throw re;
}
catch (Exception e) {
throw new RuntimeException(e);
}
}

@GraphQLField(description = "The fragment viewport's text align.")
@JsonProperty(access = JsonProperty.Access.READ_WRITE)
protected String textAlign;

@Override
public boolean equals(Object object) {
if (this == object) {
Expand Down Expand Up @@ -466,6 +494,20 @@ public String toString() {
sb.append("\"");
}

if (textAlign != null) {
if (sb.length() > 1) {
sb.append(", ");
}

sb.append("\"textAlign\": ");

sb.append("\"");

sb.append(_escape(textAlign));

sb.append("\"");
}

sb.append("}");

return sb.toString();
Expand Down
@@ -1 +1 @@
version 21.0.0
version 21.1.0
Expand Up @@ -223,6 +223,27 @@ public void setPaddingTop(

protected String paddingTop;

public String getTextAlign() {
return textAlign;
}

public void setTextAlign(String textAlign) {
this.textAlign = textAlign;
}

public void setTextAlign(
UnsafeSupplier<String, Exception> textAlignUnsafeSupplier) {

try {
textAlign = textAlignUnsafeSupplier.get();
}
catch (Exception e) {
throw new RuntimeException(e);
}
}

protected String textAlign;

@Override
public FragmentViewportStyle clone() throws CloneNotSupportedException {
return (FragmentViewportStyle)super.clone();
Expand Down
Expand Up @@ -177,6 +177,20 @@ public static String toJSON(FragmentViewportStyle fragmentViewportStyle) {
sb.append("\"");
}

if (fragmentViewportStyle.getTextAlign() != null) {
if (sb.length() > 1) {
sb.append(", ");
}

sb.append("\"textAlign\": ");

sb.append("\"");

sb.append(_escape(fragmentViewportStyle.getTextAlign()));

sb.append("\"");
}

sb.append("}");

return sb.toString();
Expand Down Expand Up @@ -278,6 +292,15 @@ public static Map<String, String> toMap(
String.valueOf(fragmentViewportStyle.getPaddingTop()));
}

if (fragmentViewportStyle.getTextAlign() == null) {
map.put("textAlign", null);
}
else {
map.put(
"textAlign",
String.valueOf(fragmentViewportStyle.getTextAlign()));
}

return map;
}

Expand Down Expand Up @@ -353,6 +376,12 @@ else if (Objects.equals(jsonParserFieldName, "paddingTop")) {
(String)jsonParserFieldValue);
}
}
else if (Objects.equals(jsonParserFieldName, "textAlign")) {
if (jsonParserFieldValue != null) {
fragmentViewportStyle.setTextAlign(
(String)jsonParserFieldValue);
}
}
}

}
Expand Down
Expand Up @@ -1979,6 +1979,10 @@ components:
description:
The fragment viewport's padding top.
type: string
textAlign:
description:
The fragment viewport's text align.
type: string
type: object
id:
# @review
Expand Down Expand Up @@ -4783,7 +4787,7 @@ components:
info:
description:
"A Java client JAR is available for use with the group ID 'com.liferay', artifact ID
'com.liferay.headless.delivery.client', and version '4.0.16'."
'com.liferay.headless.delivery.client', and version '4.0.17'."
license:
name: "Apache 2.0"
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
Expand Down
Expand Up @@ -379,6 +379,8 @@ private FragmentViewport _toFragmentViewportStyle(
"paddingRight", null);
paddingTop = styleJSONObject.getString(
"paddingTop", null);
textAlign = styleJSONObject.getString(
"textAlign", null);

setHidden(
() -> {
Expand Down
Expand Up @@ -47,7 +47,7 @@
)
@Generated("")
@OpenAPIDefinition(
info = @Info(description = "A Java client JAR is available for use with the group ID 'com.liferay', artifact ID 'com.liferay.headless.delivery.client', and version '4.0.16'.", license = @License(name = "Apache 2.0", url = "http://www.apache.org/licenses/LICENSE-2.0.html"), title = "Headless Delivery", version = "v1.0")
info = @Info(description = "A Java client JAR is available for use with the group ID 'com.liferay', artifact ID 'com.liferay.headless.delivery.client', and version '4.0.17'.", license = @License(name = "Apache 2.0", url = "http://www.apache.org/licenses/LICENSE-2.0.html"), title = "Headless Delivery", version = "v1.0")
)
@Path("/v1.0")
public class OpenAPIResourceImpl {
Expand Down
Expand Up @@ -233,6 +233,8 @@ protected JSONObject toFragmentViewportStylesJSONObject(
"paddingRight", fragmentViewportStyle.get("paddingRight")
).put(
"paddingTop", fragmentViewportStyle.get("paddingTop")
).put(
"textAlign", fragmentViewportStyle.get("textAlign")
));
}

Expand Down
Expand Up @@ -646,6 +646,10 @@
"paddingTop": {
"title": "The paddingTop Schema",
"type": "string"
},
"textAlign": {
"title": "The textAlign Schema",
"type": "string"
}
},
"title": "The fragmentViewportStyle Schema",
Expand Down