fix: gsheets all sheets option enabled behind a feature flag (#37942)
## Description This PR adds back all sheets option which had been removed in PR: https://github.com/appsmithorg/appsmith/pull/36125 Fixes #38002 _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.Datasource, @tag.Widget" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/12311024852> > Commit: e177b648fd593b8ccc8af88c6d90c3958d7c9752 > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=12311024852&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Datasource, @tag.Widget` > Spec: > <hr>Fri, 13 Dec 2024 08:27:08 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [x] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added new options for Google Sheets permissions, enhancing user selection capabilities. - Introduced a feature flag to control the visibility of new Google Sheets options. - **Bug Fixes** - Improved handling of feature flags in the datasource section rendering, ensuring correct visibility based on flags. - **Documentation** - Updated test specifications for Google Sheets datasource to include new dropdown options. - **Chores** - Enhanced the logic for setting default values in the RadioButtonControl component. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: “sneha122” <“sneha@appsmith.com”> Co-authored-by: Alex Golovanov <alex@appsmith.com>
This commit is contained in:
parent
6eb44a11c7
commit
88ec7c7c50
|
|
@ -1,3 +1,4 @@
|
||||||
|
import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags";
|
||||||
import {
|
import {
|
||||||
dataSources,
|
dataSources,
|
||||||
deployMode,
|
deployMode,
|
||||||
|
|
@ -23,6 +24,13 @@ describe(
|
||||||
function () {
|
function () {
|
||||||
let pluginName = "Google Sheets";
|
let pluginName = "Google Sheets";
|
||||||
|
|
||||||
|
before(() => {
|
||||||
|
// intercept features call gsheet all sheets disabled
|
||||||
|
featureFlagIntercept({
|
||||||
|
release_gs_all_sheets_options_enabled: false,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it("1. Verify GSheets dropdown options", function () {
|
it("1. Verify GSheets dropdown options", function () {
|
||||||
dataSources.NavigateToDSCreateNew();
|
dataSources.NavigateToDSCreateNew();
|
||||||
dataSources.CreatePlugIn("Google Sheets");
|
dataSources.CreatePlugIn("Google Sheets");
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ class Response {
|
||||||
}
|
}
|
||||||
|
|
||||||
public openResponseTypeMenu() {
|
public openResponseTypeMenu() {
|
||||||
|
this.switchToResponseTab();
|
||||||
cy.get(this.locators.responseDataContainer).realHover();
|
cy.get(this.locators.responseDataContainer).realHover();
|
||||||
cy.get(this.locators.responseTypeMenuTrigger).click({ force: true });
|
cy.get(this.locators.responseTypeMenuTrigger).click({ force: true });
|
||||||
}
|
}
|
||||||
|
|
@ -46,6 +47,7 @@ class Response {
|
||||||
}
|
}
|
||||||
|
|
||||||
public validateResponseStatus(status: string): void {
|
public validateResponseStatus(status: string): void {
|
||||||
|
this.switchToResponseTab();
|
||||||
cy.get(this.locators.responseStatusInfo).trigger("mouseover");
|
cy.get(this.locators.responseStatusInfo).trigger("mouseover");
|
||||||
cy.get(this.locators.responseStatusInfoTooltip).should(
|
cy.get(this.locators.responseStatusInfoTooltip).should(
|
||||||
"include.text",
|
"include.text",
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,8 @@ export const FEATURE_FLAG = {
|
||||||
release_evaluation_scope_cache: "release_evaluation_scope_cache",
|
release_evaluation_scope_cache: "release_evaluation_scope_cache",
|
||||||
release_table_html_column_type_enabled:
|
release_table_html_column_type_enabled:
|
||||||
"release_table_html_column_type_enabled",
|
"release_table_html_column_type_enabled",
|
||||||
|
release_gs_all_sheets_options_enabled:
|
||||||
|
"release_gs_all_sheets_options_enabled",
|
||||||
} as const;
|
} as const;
|
||||||
|
|
||||||
export type FeatureFlag = keyof typeof FEATURE_FLAG;
|
export type FeatureFlag = keyof typeof FEATURE_FLAG;
|
||||||
|
|
@ -86,6 +88,7 @@ export const DEFAULT_FEATURE_FLAG_VALUE: FeatureFlags = {
|
||||||
ab_request_new_integration_enabled: false,
|
ab_request_new_integration_enabled: false,
|
||||||
release_evaluation_scope_cache: false,
|
release_evaluation_scope_cache: false,
|
||||||
release_table_html_column_type_enabled: false,
|
release_table_html_column_type_enabled: false,
|
||||||
|
release_gs_all_sheets_options_enabled: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AB_TESTING_EVENT_KEYS = {
|
export const AB_TESTING_EVENT_KEYS = {
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,10 @@ function renderComponent(props: renderComponentProps) {
|
||||||
};
|
};
|
||||||
|
|
||||||
const options = props.options || [];
|
const options = props.options || [];
|
||||||
const defaultValue = props.initialValue as string;
|
const selectedValue = props.input?.value;
|
||||||
|
const defaultValue = !!selectedValue
|
||||||
|
? selectedValue
|
||||||
|
: (props.initialValue as string);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledRadioGroup
|
<StyledRadioGroup
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import { isMultipleEnvEnabled } from "ee/utils/planHelpers";
|
||||||
import { selectFeatureFlags } from "ee/selectors/featureFlagsSelectors";
|
import { selectFeatureFlags } from "ee/selectors/featureFlagsSelectors";
|
||||||
import { Text } from "@appsmith/ads";
|
import { Text } from "@appsmith/ads";
|
||||||
import { Table } from "@appsmith/ads-old";
|
import { Table } from "@appsmith/ads-old";
|
||||||
|
import type { FeatureFlags } from "ee/entities/FeatureFlag";
|
||||||
|
|
||||||
const Key = styled.div`
|
const Key = styled.div`
|
||||||
color: var(--ads-v2-color-fg-muted);
|
color: var(--ads-v2-color-fg-muted);
|
||||||
|
|
@ -69,6 +70,7 @@ interface RenderDatasourceSectionProps {
|
||||||
showOnlyCurrentEnv?: boolean;
|
showOnlyCurrentEnv?: boolean;
|
||||||
currentEnv: string;
|
currentEnv: string;
|
||||||
isEnvEnabled: boolean;
|
isEnvEnabled: boolean;
|
||||||
|
featureFlags?: FeatureFlags;
|
||||||
}
|
}
|
||||||
const renderKVArray = (
|
const renderKVArray = (
|
||||||
// TODO: Fix this the next time the file is edited
|
// TODO: Fix this the next time the file is edited
|
||||||
|
|
@ -140,6 +142,7 @@ export function renderDatasourceSection(
|
||||||
currentEnvironment: string,
|
currentEnvironment: string,
|
||||||
datasource: Datasource,
|
datasource: Datasource,
|
||||||
viewMode: boolean | undefined,
|
viewMode: boolean | undefined,
|
||||||
|
featureFlags?: FeatureFlags,
|
||||||
) {
|
) {
|
||||||
return (
|
return (
|
||||||
<React.Fragment key={datasource.id}>
|
<React.Fragment key={datasource.id}>
|
||||||
|
|
@ -148,7 +151,7 @@ export function renderDatasourceSection(
|
||||||
isHidden(
|
isHidden(
|
||||||
datasource.datasourceStorages[currentEnvironment],
|
datasource.datasourceStorages[currentEnvironment],
|
||||||
section.hidden,
|
section.hidden,
|
||||||
undefined,
|
featureFlags,
|
||||||
viewMode,
|
viewMode,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -168,6 +171,7 @@ export function renderDatasourceSection(
|
||||||
currentEnvironment,
|
currentEnvironment,
|
||||||
datasource,
|
datasource,
|
||||||
viewMode,
|
viewMode,
|
||||||
|
featureFlags,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
|
|
@ -320,6 +324,7 @@ class RenderDatasourceInformation extends React.Component<RenderDatasourceSectio
|
||||||
config,
|
config,
|
||||||
currentEnv,
|
currentEnv,
|
||||||
datasource,
|
datasource,
|
||||||
|
featureFlags,
|
||||||
isEnvEnabled,
|
isEnvEnabled,
|
||||||
showOnlyCurrentEnv,
|
showOnlyCurrentEnv,
|
||||||
viewMode,
|
viewMode,
|
||||||
|
|
@ -333,7 +338,13 @@ class RenderDatasourceInformation extends React.Component<RenderDatasourceSectio
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return renderDatasourceSection(config, currentEnv, datasource, viewMode);
|
return renderDatasourceSection(
|
||||||
|
config,
|
||||||
|
currentEnv,
|
||||||
|
datasource,
|
||||||
|
viewMode,
|
||||||
|
featureFlags,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -357,10 +368,12 @@ const mapStateToProps = (state: AppState, ownProps: any) => {
|
||||||
? false
|
? false
|
||||||
: isMultipleEnvEnabled(selectFeatureFlags(state));
|
: isMultipleEnvEnabled(selectFeatureFlags(state));
|
||||||
const currentEnvironmentId = getCurrentEnvironmentId(state);
|
const currentEnvironmentId = getCurrentEnvironmentId(state);
|
||||||
|
const featureFlags = selectFeatureFlags(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
currentEnv: isEnvEnabled ? currentEnvironmentId : getDefaultEnvId(),
|
currentEnv: isEnvEnabled ? currentEnvironmentId : getDefaultEnvId(),
|
||||||
isEnvEnabled,
|
isEnvEnabled,
|
||||||
|
featureFlags,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ public enum FeatureFlagEnum {
|
||||||
release_embed_hide_share_settings_enabled,
|
release_embed_hide_share_settings_enabled,
|
||||||
rollout_datasource_test_rate_limit_enabled,
|
rollout_datasource_test_rate_limit_enabled,
|
||||||
release_google_sheets_shared_drive_support_enabled,
|
release_google_sheets_shared_drive_support_enabled,
|
||||||
|
release_gs_all_sheets_options_enabled,
|
||||||
|
|
||||||
// Deprecated CE flags over here
|
// Deprecated CE flags over here
|
||||||
release_git_autocommit_feature_enabled,
|
release_git_autocommit_feature_enabled,
|
||||||
|
|
|
||||||
|
|
@ -38,11 +38,48 @@
|
||||||
{
|
{
|
||||||
"label": "Read / Write / Delete | Selected google sheets",
|
"label": "Read / Write / Delete | Selected google sheets",
|
||||||
"value": "https://www.googleapis.com/auth/drive.file"
|
"value": "https://www.googleapis.com/auth/drive.file"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Read / Write / Delete | All google sheets",
|
||||||
|
"value": "https://www.googleapis.com/auth/spreadsheets,https://www.googleapis.com/auth/drive"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Read / Write | All google sheets",
|
||||||
|
"value": "https://www.googleapis.com/auth/spreadsheets,https://www.googleapis.com/auth/drive.readonly"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Read | All google sheets",
|
||||||
|
"value": "https://www.googleapis.com/auth/spreadsheets.readonly,https://www.googleapis.com/auth/drive.readonly"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"initialValue": "https://www.googleapis.com/auth/drive.file",
|
"initialValue": "https://www.googleapis.com/auth/drive.file",
|
||||||
"customStyles": {
|
"customStyles": {
|
||||||
"width": "340px"
|
"width": "340px"
|
||||||
|
},
|
||||||
|
"hidden": {
|
||||||
|
"flagValue": "release_gs_all_sheets_options_enabled",
|
||||||
|
"comparison": "FEATURE_FLAG",
|
||||||
|
"value": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Permissions | Scope",
|
||||||
|
"configProperty": "datasourceConfiguration.authentication.scopeString",
|
||||||
|
"controlType": "RADIO_BUTTON",
|
||||||
|
"options": [
|
||||||
|
{
|
||||||
|
"label": "Read / Write / Delete | Selected google sheets",
|
||||||
|
"value": "https://www.googleapis.com/auth/drive.file"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"initialValue": "https://www.googleapis.com/auth/drive.file",
|
||||||
|
"customStyles": {
|
||||||
|
"width": "340px"
|
||||||
|
},
|
||||||
|
"hidden": {
|
||||||
|
"flagValue": "release_gs_all_sheets_options_enabled",
|
||||||
|
"comparison": "FEATURE_FLAG",
|
||||||
|
"value": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user