fix: remove slash commands from API url field (#27432)

## Description
#27070 accidentally introduced slash commands in API URL field. This
could lead to a bad UX since `/` is predominant in URLs. This PR removes
slash commands from the URL field.

#### PR fixes following issue(s)
Fixes #27425 
>
#### 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
- Bug fix (non-breaking change which fixes an issue)
>
>
## Testing
>
#### How Has This Been Tested?
- [x] Manual
>
>
#### 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
- [x] My code follows the style guidelines of this project
- [x] 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
- [x] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [x] 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:
arunvjn 2023-09-19 17:17:49 +05:30 committed by GitHub
parent 5b41dbae15
commit bb26d025a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 77 additions and 18 deletions

View File

@ -274,15 +274,10 @@ const getEditorIdentifier = (props: EditorProps): string => {
};
class CodeEditor extends Component<Props, State> {
hintHelper: HintHelper[] = [
bindingHintHelper,
slashCommandHintHelper,
sqlHint.hinter,
];
static defaultProps = {
marking: [entityMarker],
lineCommentString: "//",
hinting: [],
hinting: [bindingHintHelper, slashCommandHintHelper, sqlHint.hinter],
};
// this is the higlighted element for any highlighted text in the codemirror
highlightedUrlElement: HTMLElement | undefined;
@ -471,7 +466,7 @@ class CodeEditor extends Component<Props, State> {
this.hinters = CodeEditor.startAutocomplete(
editor,
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
[...this.hintHelper, ...this.props.hinting!], // ! since defaultProps are set
this.props.hinting!, // ! since defaultProps are set
this.props.dynamicData,
this.props.entitiesForNavigation, // send navigation here
);

View File

@ -18,6 +18,8 @@ import { AutocompleteDataType } from "utils/autocomplete/AutocompleteDataType";
import LazyCodeEditor from "components/editorComponents/LazyCodeEditor";
import ColorPickerComponent from "./ColorPickerComponentV2";
import { assistiveBindingHinter } from "components/editorComponents/CodeEditor/assistiveBindingHinter";
import { bindingHintHelper } from "components/editorComponents/CodeEditor/hintHelpers";
import { slashCommandHintHelper } from "components/editorComponents/CodeEditor/commandsHelper";
const Wrapper = styled.div`
background-color: var(--ads-v2-color-bg-subtle);
@ -145,7 +147,11 @@ function DataControlComponent(props: RenderComponentProps) {
dataTreePath={`${dataTreePath}.seriesName`}
evaluatedValue={evaluated?.seriesName}
expected={expectedSeriesName}
hinting={[assistiveBindingHinter]}
hinting={[
bindingHintHelper,
assistiveBindingHinter,
slashCommandHintHelper,
]}
input={{
value: item.seriesName,
onChange: (
@ -196,7 +202,11 @@ function DataControlComponent(props: RenderComponentProps) {
dataTreePath={`${dataTreePath}.data`}
evaluatedValue={evaluated?.data}
expected={expectedSeriesData}
hinting={[assistiveBindingHinter]}
hinting={[
bindingHintHelper,
assistiveBindingHinter,
slashCommandHintHelper,
]}
input={{
value: item.data,
onChange: (

View File

@ -10,6 +10,8 @@ import {
} from "components/editorComponents/CodeEditor/EditorConfig";
import LazyCodeEditor from "components/editorComponents/LazyCodeEditor";
import { assistiveBindingHinter } from "components/editorComponents/CodeEditor/assistiveBindingHinter";
import { bindingHintHelper } from "components/editorComponents/CodeEditor/hintHelpers";
import { slashCommandHintHelper } from "components/editorComponents/CodeEditor/commandsHelper";
class CodeEditorControl extends BaseControl<ControlProps> {
render() {
@ -30,7 +32,11 @@ class CodeEditorControl extends BaseControl<ControlProps> {
return (
<LazyCodeEditor
additionalDynamicData={this.props.additionalAutoComplete}
hinting={[assistiveBindingHinter]}
hinting={[
bindingHintHelper,
assistiveBindingHinter,
slashCommandHintHelper,
]}
input={{ value: propertyValue, onChange: this.onChange }}
mode={EditorModes.TEXT_WITH_BINDING}
positionCursorInsideBinding

View File

@ -16,6 +16,8 @@ import { isString } from "utils/helpers";
import { JSToString, stringToJS } from "./utils";
import LazyCodeEditor from "components/editorComponents/LazyCodeEditor";
import { assistiveBindingHinter } from "components/editorComponents/CodeEditor/assistiveBindingHinter";
import { bindingHintHelper } from "components/editorComponents/CodeEditor/hintHelpers";
import { slashCommandHintHelper } from "components/editorComponents/CodeEditor/commandsHelper";
const PromptMessage = styled.span`
line-height: 17px;
@ -65,7 +67,11 @@ export function InputText(props: {
dataTreePath={dataTreePath}
evaluatedValue={evaluatedValue}
expected={expected}
hinting={[assistiveBindingHinter]}
hinting={[
bindingHintHelper,
assistiveBindingHinter,
slashCommandHintHelper,
]}
input={{
value: value,
onChange: onChange,

View File

@ -15,6 +15,8 @@ import { CollapseContext } from "pages/Editor/PropertyPane/PropertySection";
import LazyCodeEditor from "../editorComponents/LazyCodeEditor";
import type { AdditionalDynamicDataTree } from "utils/autocomplete/customTreeTypeDefCreator";
import { assistiveBindingHinter } from "components/editorComponents/CodeEditor/assistiveBindingHinter";
import { bindingHintHelper } from "components/editorComponents/CodeEditor/hintHelpers";
import { slashCommandHintHelper } from "components/editorComponents/CodeEditor/commandsHelper";
export function InputText(props: {
label: string;
@ -57,7 +59,11 @@ export function InputText(props: {
evaluatedValue={evaluatedValue}
expected={expected}
hideEvaluatedValue={hideEvaluatedValue}
hinting={[assistiveBindingHinter]}
hinting={[
bindingHintHelper,
assistiveBindingHinter,
slashCommandHintHelper,
]}
hoverInteraction
input={{
value: value,

View File

@ -24,6 +24,8 @@ import {
} from "widgets/JSONFormWidget/constants";
import LazyCodeEditor from "components/editorComponents/LazyCodeEditor";
import { assistiveBindingHinter } from "components/editorComponents/CodeEditor/assistiveBindingHinter";
import { bindingHintHelper } from "components/editorComponents/CodeEditor/hintHelpers";
import { slashCommandHintHelper } from "components/editorComponents/CodeEditor/commandsHelper";
const PromptMessage = styled.span`
line-height: 17px;
@ -139,7 +141,11 @@ export function InputText(props: {
dataTreePath={dataTreePath}
evaluatedValue={evaluatedValue}
expected={expected}
hinting={[assistiveBindingHinter]}
hinting={[
bindingHintHelper,
assistiveBindingHinter,
slashCommandHintHelper,
]}
input={{
value: value,
onChange: onChange,

View File

@ -21,6 +21,8 @@ import type { ColumnProperties } from "widgets/TableWidgetV2/component/Constants
import { getUniqueKeysFromSourceData } from "widgets/MenuButtonWidget/widget/helper";
import LazyCodeEditor from "components/editorComponents/LazyCodeEditor";
import { assistiveBindingHinter } from "components/editorComponents/CodeEditor/assistiveBindingHinter";
import { bindingHintHelper } from "components/editorComponents/CodeEditor/hintHelpers";
import { slashCommandHintHelper } from "components/editorComponents/CodeEditor/commandsHelper";
const PromptMessage = styled.span`
line-height: 17px;
@ -72,7 +74,11 @@ function InputText(props: InputTextProp) {
dataTreePath={dataTreePath}
evaluatedValue={evaluatedValue}
expected={expected}
hinting={[assistiveBindingHinter]}
hinting={[
bindingHintHelper,
assistiveBindingHinter,
slashCommandHintHelper,
]}
input={{
value: value,
onChange: onChange,

View File

@ -13,6 +13,8 @@ import { getDynamicBindings, isDynamicValue } from "utils/DynamicBindingUtils";
import { isString } from "utils/helpers";
import LazyCodeEditor from "components/editorComponents/LazyCodeEditor";
import { assistiveBindingHinter } from "components/editorComponents/CodeEditor/assistiveBindingHinter";
import { bindingHintHelper } from "components/editorComponents/CodeEditor/hintHelpers";
import { slashCommandHintHelper } from "components/editorComponents/CodeEditor/commandsHelper";
export const getBindingTemplate = (widgetName: string) => {
const prefixTemplate = `{{ ((options, serverSideFiltering) => ( `;
@ -74,7 +76,11 @@ function InputText(props: InputTextProp) {
dataTreePath={dataTreePath}
evaluatedValue={evaluatedValue}
expected={expected}
hinting={[assistiveBindingHinter]}
hinting={[
bindingHintHelper,
assistiveBindingHinter,
slashCommandHintHelper,
]}
input={{
value: value,
onChange: onChange,

View File

@ -17,6 +17,8 @@ import { JSToString, stringToJS } from "./utils";
import type { AdditionalDynamicDataTree } from "utils/autocomplete/customTreeTypeDefCreator";
import LazyCodeEditor from "components/editorComponents/LazyCodeEditor";
import { assistiveBindingHinter } from "components/editorComponents/CodeEditor/assistiveBindingHinter";
import { bindingHintHelper } from "components/editorComponents/CodeEditor/hintHelpers";
import { slashCommandHintHelper } from "components/editorComponents/CodeEditor/commandsHelper";
const PromptMessage = styled.span`
line-height: 17px;
@ -68,7 +70,11 @@ function InputText(props: InputTextProp) {
dataTreePath={dataTreePath}
evaluatedValue={evaluatedValue}
expected={expected}
hinting={[assistiveBindingHinter]}
hinting={[
bindingHintHelper,
assistiveBindingHinter,
slashCommandHintHelper,
]}
input={{
value: value,
onChange: onChange,

View File

@ -25,6 +25,8 @@ import {
TABLE_WIDGET_VALIDATION_ASSIST_PROMPT,
} from "@appsmith/constants/messages";
import { assistiveBindingHinter } from "components/editorComponents/CodeEditor/assistiveBindingHinter";
import { bindingHintHelper } from "components/editorComponents/CodeEditor/hintHelpers";
import { slashCommandHintHelper } from "components/editorComponents/CodeEditor/commandsHelper";
export const PromptMessage = styled.span`
line-height: 17px;
@ -82,7 +84,11 @@ export function InputText(props: InputTextProp) {
dataTreePath={dataTreePath}
evaluatedValue={evaluatedValue}
expected={expected}
hinting={[assistiveBindingHinter]}
hinting={[
bindingHintHelper,
assistiveBindingHinter,
slashCommandHintHelper,
]}
input={{
value: value,
onChange: onChange,

View File

@ -16,6 +16,8 @@ import type { AdditionalDynamicDataTree } from "utils/autocomplete/customTreeTyp
import LazyCodeEditor from "components/editorComponents/LazyCodeEditor";
import type { WidgetProps } from "widgets/BaseWidget";
import { assistiveBindingHinter } from "components/editorComponents/CodeEditor/assistiveBindingHinter";
import { bindingHintHelper } from "components/editorComponents/CodeEditor/hintHelpers";
import { slashCommandHintHelper } from "components/editorComponents/CodeEditor/commandsHelper";
type InputTextProp = {
label: string;
@ -48,7 +50,11 @@ function InputText(props: InputTextProp) {
dataTreePath={dataTreePath}
evaluatedValue={evaluatedValue}
expected={expected}
hinting={[assistiveBindingHinter]}
hinting={[
bindingHintHelper,
assistiveBindingHinter,
slashCommandHintHelper,
]}
input={{
value: value,
onChange: onChange,