fix: Update title casing for action selector fields (#22270)

## Description
This PR makes sure that the casing is consistent in the Action Selector.

Fixes #22225 
## Type of change

- Bug fix (non-breaking change which fixes an issue)


## How Has This Been Tested?
- 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
- [ ] 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:
- [ ] Test plan has been approved by relevant developers
- [ ] Test plan has been peer reviewed by QA
- [ ] Cypress test cases have been added and approved by either SDET or
manual QA
- [ ] Organized project review call with relevant stakeholders after
Round 1/2 of QA
- [ ] Added Test Plan Approved label after reveiwing all Cypress test
This commit is contained in:
Ravi Kumar Prasad 2023-05-23 11:17:47 +05:30 committed by GitHub
parent 9c3c295e1a
commit 17a5cfbe3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 51 additions and 43 deletions

View File

@ -135,7 +135,7 @@ describe("JS to non-JS mode in Action Selector", () => {
_.agHelper.GetNClick(_.propPane._actionCard, 3);
_.agHelper.GetNAssertElementText(
_.propPane._selectorViewButton,
"Select Modal",
"Select modal",
);
});
@ -559,18 +559,18 @@ describe("JS to non-JS mode in Action Selector", () => {
);
_.agHelper.GetNClick(_.propPane._actionCard, 0);
_.agHelper.AssertElementVisible(_.propPane._navigateToType("Page Name"));
_.agHelper.AssertElementVisible(_.propPane._navigateToType("Page name"));
_.agHelper.GetNAssertElementText(
_.propPane._actionOpenDropdownSelectPage,
"Select Page",
"Select page",
"have.text",
0,
);
_.agHelper.GetNAssertElementText(
_.propPane._actionPopupTextLabel,
"Query Params",
"Query params",
"have.text",
0,
);
@ -598,7 +598,7 @@ describe("JS to non-JS mode in Action Selector", () => {
);
_.agHelper.GetNClick(_.propPane._actionCard, 0);
_.agHelper.AssertElementVisible(_.propPane._navigateToType("Page Name"));
_.agHelper.AssertElementVisible(_.propPane._navigateToType("Page name"));
_.agHelper.GetNAssertElementText(
_.propPane._actionOpenDropdownSelectPage,
@ -609,7 +609,7 @@ describe("JS to non-JS mode in Action Selector", () => {
_.agHelper.GetNAssertElementText(
_.propPane._actionPopupTextLabel,
"Query Params",
"Query params",
"have.text",
0,
);
@ -648,7 +648,7 @@ describe("JS to non-JS mode in Action Selector", () => {
_.agHelper.GetNAssertElementText(
_.propPane._actionPopupTextLabel,
"Query Params",
"Query params",
"have.text",
1,
);
@ -741,7 +741,7 @@ describe("JS to non-JS mode in Action Selector", () => {
_.agHelper.GetNAssertElementText(
_.propPane._actionOpenDropdownSelectModal,
"Select Modal",
"Select modal",
"have.text",
0,
);
@ -787,7 +787,7 @@ describe("JS to non-JS mode in Action Selector", () => {
_.agHelper.GetNAssertElementText(
_.propPane._actionOpenDropdownSelectModal,
"Select Modal",
"Select modal",
"have.text",
0,
);
@ -894,7 +894,7 @@ describe("JS to non-JS mode in Action Selector", () => {
_.agHelper.GetNAssertElementText(
_.propPane._actionCard,
"Remove valueAdd Key",
"Remove valueAdd key",
"have.text",
0,
);
@ -1098,7 +1098,7 @@ describe("JS to non-JS mode in Action Selector", () => {
_.agHelper.GetNAssertElementText(
_.propPane._selectorViewButton,
"Select Widget",
"Select widget",
"have.text",
0,
);
@ -1188,7 +1188,7 @@ describe("JS to non-JS mode in Action Selector", () => {
_.agHelper.GetNAssertElementText(
_.propPane._selectorViewButton,
"Select Widget",
"Select widget",
"have.text",
0,
);
@ -1279,7 +1279,7 @@ describe("JS to non-JS mode in Action Selector", () => {
_.agHelper.GetNAssertElementText(
_.propPane._actionCard,
"Clear intervalAdd ID",
"Clear intervalAdd Id",
"have.text",
0,
);

View File

@ -25,11 +25,11 @@ describe("Navigate To feature", () => {
});
ee.SelectEntityByName("Button1", "Widgets");
propPane.SelectPlatformFunction("onClick", "Navigate to");
cy.get(".t--open-dropdown-Select-Page").click();
cy.get(".t--open-dropdown-Select-page").click();
agHelper.AssertElementLength(".bp3-menu-item", 2);
cy.get(locator._dropDownValue("Page2")).click();
cy.get("label")
.contains("Query Params")
.contains("Query params")
.siblings()
.find(".CodeEditorTarget")
.then(($el) => {

View File

@ -42,7 +42,7 @@ describe("Binding the multiple Widgets and validating NavigateTo Page", function
cy.openPropertyPane("inputwidgetv2");
cy.get(widgetsPage.defaultInput).type(testdata.defaultInputWidget);
propPane.SelectPlatformFunction("onTextChanged", "Navigate to");
cy.get(".t--open-dropdown-Select-Page").click();
cy.get(".t--open-dropdown-Select-page").click();
cy.get(commonlocators.singleSelectMenuItem)
.contains(pageid)
.click({ force: true });

View File

@ -43,7 +43,7 @@ describe("Table Widget V2 and Navigate to functionality validation", function ()
cy.testJsontext("tabledata", JSON.stringify(testdata.TablePagination));
cy.focused().blur();
propPane.SelectPlatformFunction("onRowSelected", "Navigate to");
cy.get(".t--open-dropdown-Select-Page").click();
cy.get(".t--open-dropdown-Select-page").click();
cy.get(commonlocators.singleSelectMenuItem)
.contains(pageid)
.click({ force: true });

View File

@ -42,7 +42,7 @@ describe("Table Widget and Navigate to functionality validation", function () {
cy.testJsontext("tabledata", JSON.stringify(testdata.TablePagination));
cy.focused().blur();
propPane.SelectPlatformFunction("onRowSelected", "Navigate to");
cy.get(".t--open-dropdown-Select-Page").click();
cy.get(".t--open-dropdown-Select-page").click();
cy.get(commonlocators.singleSelectMenuItem)
.contains(pageid)
.click({ force: true });

View File

@ -1,9 +1,9 @@
{
"selectModal": ".t--open-dropdown-Select-Modal",
"selectModal": ".t--open-dropdown-Select-modal",
"createModalButton": ".t--create-modal-btn",
"controlModalType": ".t--property-control-modaltype .bp3-popover-target",
"modalWidget": ".t--modal-widget",
"modalName": ".t--modal-widget span.t--widget-name",
"modelTextField": ".t--modal-widget .t--widget-textwidget",
"closeButton": ".t--widget-iconwidget"
}
}

View File

@ -139,7 +139,7 @@
"toastActionText": ".ads-v2-toast .ads-v2-toast__body .ads-v2-text",
"defaultColName": "[data-rbd-draggable-id='customColumn1'] input",
"defaultColNameV2": "[data-rbd-draggable-id='customColumn1'] input[type='text']",
"selectWidget": ".t--open-dropdown-Select-Widget",
"selectWidget": ".t--open-dropdown-Select-widget",
"switchWidget": ".t--widget-switchwidget",
"toastMsg": ".ads-v2-toast .ads-v2-toast__body .ads-v2-text",
"deleteToast": "div[class = 'undo-section'] span[type='h6']",

View File

@ -101,7 +101,7 @@
"chooseAction": ".single-select",
"chooseMsgType": ".t--open-dropdown-Select-type",
"onPause": ".t--property-control-onpause .t--open-dropdown-Select-Action",
"chooseWidget": ".t--open-dropdown-Select-Widget",
"chooseWidget": ".t--open-dropdown-Select-widget",
"onClick": ".t--property-control-onclick .t--open-dropdown-Select-Action",
"changeZoomlevel": ".t--property-control-maxzoomlevel input",
"selectedZoomlevel": ".t--property-control-maxzoomlevel .rc-select-selection-item span",

View File

@ -76,9 +76,9 @@ export class PropertyPane {
_actionCallbackTitle = ".action-callback-add";
_actionTreeCollapse = ".callback-collapse";
_actionPopupTextLabel = '[data-testid="text-view-label"]';
_actionOpenDropdownSelectModal = ".t--open-dropdown-Select-Modal";
_actionOpenDropdownSelectModal = ".t--open-dropdown-Select-modal";
_selectorViewButton = ".selector-view .bp3-button-text";
_actionOpenDropdownSelectPage = ".t--open-dropdown-Select-Page";
_actionOpenDropdownSelectPage = ".t--open-dropdown-Select-page";
_sameWindowDropdownOption = ".t--open-dropdown-Same-window";
_navigateToType = (type: string) =>
"div.tab-view span:contains('" + type + "')";

View File

@ -122,7 +122,7 @@ export const FIELD_CONFIG: AppsmithFunctionConfigType = {
view: ViewTypes.TEXT_VIEW,
},
[FieldType.QUERY_PARAMS_FIELD]: {
label: () => "Query Params",
label: () => "Query params",
defaultText: "",
exampleText: "navigateTo('Page1', { a: 1 }, 'SAME_WINDOW')",
options: () => null,
@ -365,9 +365,9 @@ export const FIELD_CONFIG: AppsmithFunctionConfigType = {
view: ViewTypes.TEXT_VIEW,
},
[FieldType.SHOW_MODAL_FIELD]: {
label: () => "Modal Name",
label: () => "Modal name",
options: (props: FieldProps) => props.modalDropdownList,
defaultText: "Select Modal",
defaultText: "Select modal",
exampleText: "showModal('Modal1')",
getter: (value: any) => {
return modalGetter(value);
@ -378,9 +378,9 @@ export const FIELD_CONFIG: AppsmithFunctionConfigType = {
view: ViewTypes.SELECTOR_VIEW,
},
[FieldType.CLOSE_MODAL_FIELD]: {
label: () => "Modal Name",
label: () => "Modal name",
options: (props: FieldProps) => props.modalDropdownList,
defaultText: "Select Modal",
defaultText: "Select modal",
exampleText: "closeModal('Modal1')",
getter: (value: any) => {
return modalGetter(value);
@ -394,7 +394,7 @@ export const FIELD_CONFIG: AppsmithFunctionConfigType = {
label: () => "Widget",
exampleText: "resetWidget('Modal1', true)",
options: (props: FieldProps) => props.widgetOptionTree,
defaultText: "Select Widget",
defaultText: "Select widget",
getter: (value: any) => {
return enumTypeGetter(value, 0);
},
@ -421,10 +421,10 @@ export const FIELD_CONFIG: AppsmithFunctionConfigType = {
view: ViewTypes.SELECTOR_VIEW,
},
[FieldType.PAGE_SELECTOR_FIELD]: {
label: () => "Choose Page",
label: () => "Choose page",
exampleText: "navigateTo('Page1', { a: 1 }, 'SAME_WINDOW')",
options: (props: FieldProps) => props.pageDropdownOptions,
defaultText: "Select Page",
defaultText: "Select page",
getter: (value: any) => {
return enumTypeGetter(value, 0, "");
},

View File

@ -13,7 +13,7 @@ function FieldGroup(props: FieldGroupProps) {
const NAVIGATE_TO_TAB_SWITCHER: Array<SwitchType> = [
{
id: "page-name",
text: "Page Name",
text: "Page name",
action: () => {
setActiveTabNavigateTo(NAVIGATE_TO_TAB_SWITCHER[0]);
},

View File

@ -166,7 +166,7 @@ function getActionHeading(
case AppsmithFunction.removeValue:
return (
FIELD_CONFIG[FieldType.KEY_TEXT_FIELD_REMOVE_VALUE].getter(code) ||
"Add Key"
"Add key"
);
case AppsmithFunction.setInterval:
@ -177,7 +177,7 @@ function getActionHeading(
case AppsmithFunction.clearInterval:
return (
FIELD_CONFIG[FieldType.CLEAR_INTERVAL_ID_FIELD].getter(code) || "Add ID"
FIELD_CONFIG[FieldType.CLEAR_INTERVAL_ID_FIELD].getter(code) || "Add Id"
);
case AppsmithFunction.getGeolocation:

View File

@ -4,7 +4,7 @@ import { TreeDropdown } from "design-system-old";
import { Input } from "design-system";
import { debounce } from "lodash";
import { FIELD_CONFIG } from "../../Field/FieldConfig";
import { FieldType } from "../../constants";
import { AppsmithFunction, FieldType } from "../../constants";
import {
flattenOptions,
getCodeFromMoustache,
@ -113,7 +113,15 @@ export const ActionSelectorView: React.FC<SelectorViewProps> = ({
<TreeDropdown
className="right-8 action-selector-view"
defaultOpen={isOpen}
defaultText={(action || "").toString()}
defaultText={
[
AppsmithFunction.integration,
AppsmithFunction.jsFunction,
"",
].includes(actionType)
? action
: actionType
}
menuHeight={300}
menuWidth={256}
modifiers={{

View File

@ -8,7 +8,7 @@ export function KeyValueView(props: KeyValueViewProps) {
return (
<ControlWrapper className="key-value-view" isAction key={props.label}>
<KeyValueComponent
addLabel={"Query Params"}
addLabel={"Query params"}
pairs={props.get(props.value, false) as SegmentedControlOption[]}
updatePairs={(pageParams: SegmentedControlOption[]) =>
props.set(pageParams)

View File

@ -13,9 +13,9 @@ describe("Selector view component", () => {
value: "'Page1'",
},
],
label: "Choose Page",
label: "Choose page",
value: "{{navigateTo('Page1', {}, 'SAME_WINDOW')}}",
defaultText: "Select Page",
defaultText: "Select page",
displayValue: "",
get: () => {
return 1;
@ -27,7 +27,7 @@ describe("Selector view component", () => {
test("Renders selector view component correctly", () => {
render(<SelectorView {...props} />);
expect(screen.getByTestId("selector-view-label")).toHaveTextContent(
"Choose Page",
"Choose page",
);
});
});

View File

@ -9,7 +9,7 @@ describe("Tab View component", () => {
label: "Type",
activeObj: {
id: "page-name",
text: "Page Name",
text: "Page name",
action: () => {
return 1;
},
@ -17,7 +17,7 @@ describe("Tab View component", () => {
switches: [
{
id: "page-name",
text: "Page Name",
text: "Page name",
action: () => {
return 1;
},