fix: UI fixes for the Signposting component (#25659)

## Description
fix: UI fixes for the Signposting component

#### PR fixes following issue(s)
Fixes # (issue number)
> if no issue exists, please create an issue and ask the maintainers
about this first
>
>
#### Media
> A video or a GIF is preferred. when using Loom, don’t embed because it
looks like it’s a GIF. instead, just link to the video
>
>
#### Type of change
> Please delete options that are not relevant.
- Bug fix (non-breaking change which fixes an issue)
- New feature (non-breaking change which adds functionality)
- Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- Chore (housekeeping or task changes that don't impact user perception)
- This change requires a documentation update
>
>
>
## Testing
>
#### How Has This Been Tested?
> Please describe the tests that you ran to verify your changes. Also
list any relevant details for your test configuration.
> Delete anything that is not relevant
- [ ] Manual
- [ ] Jest
- [ ] Cypress
>
>
#### Test Plan
> Add Testsmith test cases links that relate to this PR
>
>
#### Issues raised during DP testing
> Link issues raised during DP testing for better visiblity and tracking
(copy link from comments dropped on this PR)
>
>
>
## Checklist:
#### Dev activity
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] PR is being merged under a feature flag


#### QA activity:
- [ ] [Speedbreak
features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-)
have been covered
- [ ] Test plan covers all impacted features and [areas of
interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-)
- [ ] Test plan has been peer reviewed by project stakeholders and other
QA members
- [ ] Manually tested functionality on DP
- [ ] We had an implementation alignment call with stakeholders post QA
Round 2
- [ ] Cypress test cases have been added and approved by SDET/manual QA
- [ ] Added `Test Plan Approved` label after Cypress tests were reviewed
- [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
This commit is contained in:
Druthi Polisetty 2023-07-31 13:40:37 +05:30 committed by GitHub
parent 18b26a4ec5
commit f4da1abe9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 6 deletions

View File

@ -19,7 +19,7 @@ function SignPostingBanner(props: SignPostingBannerProps) {
<Container className="py-2 px-3 rounded">
<div className="flex items-start">
<Icon
className="font-semibold mr-2 flex items-start"
className="font-semibold mr-2 flex items-start mt-0.5"
color="var(--ads-v2-color-fg-information)"
name={props.iconName}
size="md"

View File

@ -43,11 +43,7 @@ function BindingPrompt(props: {
ref={promptRef}
visible={props.isOpen}
>
{props.isAIEnabled ? (
<>
Use <b>/ai</b> to generate JS expressions
</>
) : props.promptMessage ? (
{props.promptMessage ? (
props.promptMessage
) : (
<>

View File

@ -160,6 +160,7 @@ import type { MultiplexingModeConfig } from "components/editorComponents/CodeEdi
import { MULTIPLEXING_MODE_CONFIGS } from "components/editorComponents/CodeEditor/modes";
import { getDeleteLineShortcut } from "./utils/deleteLine";
import { CodeEditorSignPosting } from "@appsmith/components/editorComponents/CodeEditorSignPosting";
import { getFocusablePropertyPaneField } from "selectors/propertyPaneSelectors";
type ReduxStateProps = ReturnType<typeof mapStateToProps>;
type ReduxDispatchProps = ReturnType<typeof mapDispatchToProps>;
@ -541,10 +542,24 @@ class CodeEditor extends Component<Props, State> {
//Refresh editor when the container height is increased.
this.debounceEditorRefresh();
}
const entityInformation = this.getEntityInformation();
const isWidgetType = entityInformation.entityType === ENTITY_TYPE.WIDGET;
const hasFocusedValueChanged =
getEditorIdentifier(this.props) !== this.props.focusedProperty;
if (hasFocusedValueChanged && isWidgetType) {
if (this.state.showAIWindow) {
this.setState({ showAIWindow: false });
}
}
if (identifierHasChanged) {
if (this.state.showAIWindow) {
this.setState({ showAIWindow: false });
}
if (shouldFocusOnPropertyControl()) {
setTimeout(() => {
if (this.props.editorIsFocused) {
@ -553,6 +568,7 @@ class CodeEditor extends Component<Props, State> {
}, 200);
}
}
this.editor.operation(() => {
if (prevProps.lintErrors !== this.props.lintErrors) {
this.lintCode(this.editor);
@ -1664,6 +1680,7 @@ const mapStateToProps = (state: AppState, props: EditorProps) => ({
featureFlags: selectFeatureFlags(state),
datasourceTableKeys: getAllDatasourceTableKeys(state, props.dataTreePath),
installedLibraries: selectInstalledLibraries(state),
focusedProperty: getFocusablePropertyPaneField(state),
});
const mapDispatchToProps = (dispatch: any) => ({