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

fix: Shifted position of expires_in fixes #31059 #35196

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class DatasourceRestAPIEditor extends React.Component<Props> {
if (_.get(authentication, "grantType") === GrantType.AuthorizationCode) {
if (
_.get(authentication, "refreshTokenClientCredentialsLocation") ===
undefined ||
Copy link
Contributor

Choose a reason for hiding this comment

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

@toffee-k21 can you please format these files. The indentation diff here is not required.

undefined ||
_.get(authentication, "refreshTokenClientCredentialsLocation") === ""
) {
this.props.change(
Expand Down Expand Up @@ -253,9 +253,9 @@ class DatasourceRestAPIEditor extends React.Component<Props> {
return regex.test(value)
? { isValid: true, message: "" }
: {
isValid: false,
message: createMessage(INVALID_URL),
};
isValid: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Here also, can you please check the indentation.

message: createMessage(INVALID_URL),
};
}

return { isValid: true, message: "" };
Expand Down Expand Up @@ -666,6 +666,16 @@ class DatasourceRestAPIEditor extends React.Component<Props> {
isRequired: false,
})}
</FormInputContainer>
<FormInputContainer data-location-id={btoa("authentication.expiresIn")}>
Copy link
Contributor

Choose a reason for hiding this comment

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

The expires In dropdown should only appear if the grant type is Authorization Code. For these changes the dropdown is also appearing for other grant type Client Credentials as well.
image

{this.renderInputTextControlViaFormControl({
configProperty: "authentication.expiresIn",
label: "Authorization expires in (seconds)",
placeholderText: "3600",
dataType: "NUMBER",
encrypted: false,
isRequired: false,
})}
</FormInputContainer>
<FormInputContainer
data-location-id={btoa("authentication.isAuthorizationHeader")}
>
Expand Down Expand Up @@ -852,16 +862,6 @@ class DatasourceRestAPIEditor extends React.Component<Props> {
false,
)}
</FormInputContainer>
<FormInputContainer data-location-id={btoa("authentication.expiresIn")}>
{this.renderInputTextControlViaFormControl({
configProperty: "authentication.expiresIn",
label: "Authorization expires in (seconds)",
placeholderText: "3600",
dataType: "NUMBER",
encrypted: false,
isRequired: false,
})}
</FormInputContainer>

{!_.get(formData.authentication, "isAuthorizationHeader", true) &&
this.renderOauth2CommonAdvanced()}
Expand Down
Loading