Skip to content

Commit

Permalink
feat: 🎸 Filter suggestions - feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Michał Czapkowicz committed Dec 13, 2021
1 parent 41420ae commit 5824207
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@keen.io/parser": "^2.8.125",
"@keen.io/pubsub": "^1.2.0",
"@keen.io/query": "^1.1.1",
"@keen.io/query-creator": "^1.11.7",
"@keen.io/query-creator": "^1.11.8",
"@keen.io/react-hooks": "^1.4.3",
"@keen.io/time-utils": "^1.2.5",
"@keen.io/toast-notifications": "^1.2.12",
Expand Down
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
disableTimezoneSelection: false,
onViewChange: (view, savedQuery) => {console.log("View changed: ", view, savedQuery)},
confirmExtractionLimit: 5,
disableQueryFilterSuggestions: false,
translations: <%= translationsConfig %>,
dataviz: {
theme: {
Expand Down
3 changes: 2 additions & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@
"filters": "Filters",
"select": "Select",
"event_stream": "Event Stream",
"tooltip": "so we know what properties are available"
"tooltip": "so we know what properties are available",
"matching_values": "Matching values"
},
"query_creator_filter_boolean": {
"placeholder": "value"
Expand Down
2 changes: 2 additions & 0 deletions src/KeenExplorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export class KeenExplorer {
createDashboardUrl,
onViewChange,
savedQuery,
disableQueryFilterSuggestions,
} = props;
const keenAnalysisClient =
keenAnalysis.instance || new KeenAnalysis(keenAnalysis.config);
Expand Down Expand Up @@ -135,6 +136,7 @@ export class KeenExplorer {
enableDashboardsConnection: !!dashboardsApiUrl,
createDashboardUrl,
chartEventsPubSub,
disableQueryFilterSuggestions,
}}
>
<ToastProvider>
Expand Down
3 changes: 3 additions & 0 deletions src/components/Editor/components/Creator/Creator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ type Props = {

const Creator: FC<Props> = ({ onUpdateQuery, onUpdateChartSettings }) => {
const dispatch = useDispatch();
const { disableQueryFilterSuggestions } = useContext(AppContext);

const {
modalContainer,
keenAnalysis: { config },
Expand All @@ -34,6 +36,7 @@ const Creator: FC<Props> = ({ onUpdateQuery, onUpdateChartSettings }) => {
onUpdateChartSettings={onUpdateChartSettings}
defaultTimezoneForQuery={defaultTimezoneForQuery}
disableTimezoneSelection={disableTimezoneSelection}
disableFilterSuggestions={disableQueryFilterSuggestions}
/>
);
};
Expand Down
2 changes: 2 additions & 0 deletions src/contexts/AppContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const AppContext = React.createContext<{
defaultTimezoneForQuery;
disableTimezoneSelection;
chartEventsPubSub: PubSub;
disableQueryFilterSuggestions: boolean;
}>({
keenAnalysis: null,
modalContainer: null,
Expand All @@ -25,6 +26,7 @@ const AppContext = React.createContext<{
defaultTimezoneForQuery: null,
disableTimezoneSelection: null,
chartEventsPubSub: null,
disableQueryFilterSuggestions: false,
});

export default AppContext;
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export type Options = {
confirmExtractionLimit?: number;
onViewChange?: (view: Views) => {};
savedQuery?: string;
disableQueryFilterSuggestions?: boolean;
};

type ComponentSettings =
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1670,10 +1670,10 @@
resolved "https://registry.yarnpkg.com/@keen.io/pubsub/-/pubsub-1.2.0.tgz#845b1647a231b3cb6a755581a08dada6a9ae655a"
integrity sha512-LUrNaw2zvIqeJV1TLz/Gq6EspZAF7FY3vJmTopJtSyp1bFIwPQxuMnfqo/zLg5cemA9yRPKf/cEV5SDyQ9vL3w==

"@keen.io/query-creator@^1.11.7":
version "1.11.7"
resolved "https://registry.yarnpkg.com/@keen.io/query-creator/-/query-creator-1.11.7.tgz#416168c906035763f2cd36d55cd9e2fa22821ca8"
integrity sha512-5tNDCZ8F3/ILIG4Rj0/8cabFW4qTYOgfHCB0SGSaSlH7Kmj7vKQUaiSrgcOC8zVgM3GQr8SiZOaHazTglybj5w==
"@keen.io/query-creator@^1.11.8":
version "1.11.8"
resolved "https://registry.yarnpkg.com/@keen.io/query-creator/-/query-creator-1.11.8.tgz#fac98908cb2c3f3d47e56d5ad9d7d1d5137e0200"
integrity sha512-bxEDcYb4I7L3DC8UxEGq0QmlAPDirs2JJSiqvfqkQosARmo64xIIuEQTttjUA4Vo5B47SRlVwpkKnicMC90qNQ==
dependencies:
"@keen.io/colors" "^1.1.0"
"@keen.io/icons" "^1.2.1"
Expand Down

0 comments on commit 5824207

Please sign in to comment.