Skip to content
Snippets Groups Projects
Unverified Commit ceb55546 authored by Dalton's avatar Dalton Committed by GitHub
Browse files

Issue #14456 - Enable search in timezone select component (#14519)


* Enable search in timezone select component

* Add simple cypress test for timezone select interaction

* apply cy test suggestions from @nemanjaglumac

Co-authored-by: default avatarNemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>

Co-authored-by: default avatarNemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
parent 3197b9d3
No related branches found
No related tags found
No related merge requests found
......@@ -3,7 +3,7 @@ import React from "react";
import Select, { Option } from "metabase/components/Select";
const SettingSelect = ({
setting: { placeholder, value, options, defaultValue },
setting: { placeholder, value, options, defaultValue, searchProp },
onChange,
disabled,
}) => (
......@@ -12,6 +12,7 @@ const SettingSelect = ({
placeholder={placeholder}
value={value}
defaultValue={defaultValue}
searchProp={searchProp}
onChange={e => onChange(e.target.value)}
>
{options.map(option => {
......
......@@ -233,6 +233,7 @@ const SECTIONS = updateSectionsWithPlugins({
],
note: t`Not all databases support timezones, in which case this setting won't take effect.`,
allowValueCollection: true,
searchProp: "name",
},
{
key: "start-of-week",
......
......@@ -187,6 +187,23 @@ describe("scenarios > admin > settings", () => {
cy.contains(/^February 11, 2019, 9:40 PM$/);
});
it("should search for and select a new timezone", () => {
cy.server();
cy.route("PUT", "**/report-timezone").as("reportTimezone");
cy.visit("/admin/settings/localization");
cy.contains("Report Timezone")
.closest("li")
.find(".AdminSelect")
.click();
cy.findByPlaceholderText("Find...").type("Centr");
cy.findByText("US/Central").click({ force: true });
cy.wait("@reportTimezone");
cy.contains("US/Central");
});
if (version.edition !== "enterprise") {
describe(" > embedding settings", () => {
it("should validate a premium embedding token has a valid format", () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment