Skip to content

Commit

Permalink
Merge branch 'main' of github.com:elastic/kibana into issue-118820-re…
Browse files Browse the repository at this point in the history
…factor-group-by
  • Loading branch information
simianhacker committed May 2, 2022
2 parents da633bd + 0745196 commit d129cfb
Show file tree
Hide file tree
Showing 855 changed files with 1,692 additions and 1,202 deletions.
7 changes: 6 additions & 1 deletion src/plugins/controls/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ import {
CONTROL_GROUP_TYPE,
OPTIONS_LIST_CONTROL,
RANGE_SLIDER_CONTROL,
TIME_SLIDER_CONTROL,
// TIME_SLIDER_CONTROL,
} from '.';
/*
import {
TimesliderEmbeddableFactory,
TimeSliderControlEmbeddableInput,
} from './control_types/time_slider';
*/
import { controlsService } from './services/kibana/controls';

export class ControlsPlugin
Expand Down Expand Up @@ -104,6 +106,7 @@ export class ControlsPlugin
registerControlType(rangeSliderFactory);

// Time Slider Control Factory Setup
/* Temporary disabling Time Slider
const timeSliderFactoryDef = new TimesliderEmbeddableFactory();
const timeSliderFactory = embeddable.registerEmbeddableFactory(
TIME_SLIDER_CONTROL,
Expand All @@ -113,8 +116,10 @@ export class ControlsPlugin
timeSliderFactoryDef,
timeSliderFactory
);
registerControlType(timeSliderFactory);
*/
});

return {
Expand Down
5 changes: 3 additions & 2 deletions src/plugins/controls/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { PluginSetup as UnifiedSearchSetup } from '@kbn/unified-search-plugin/se
import { setupOptionsListSuggestionsRoute } from './control_types/options_list/options_list_suggestions_route';
import { controlGroupContainerPersistableStateServiceFactory } from './control_group/control_group_container_factory';
import { optionsListPersistableStateServiceFactory } from './control_types/options_list/options_list_embeddable_factory';
import { timeSliderPersistableStateServiceFactory } from './control_types/time_slider/time_slider_embeddable_factory';
// import { timeSliderPersistableStateServiceFactory } from './control_types/time_slider/time_slider_embeddable_factory';

interface SetupDeps {
embeddable: EmbeddableSetup;
Expand All @@ -25,7 +25,8 @@ interface SetupDeps {
export class ControlsPlugin implements Plugin<object, object, SetupDeps> {
public setup(core: CoreSetup, { embeddable, unifiedSearch }: SetupDeps) {
embeddable.registerEmbeddableFactory(optionsListPersistableStateServiceFactory());
embeddable.registerEmbeddableFactory(timeSliderPersistableStateServiceFactory());
// Temporary disabling Time Slider
// embeddable.registerEmbeddableFactory(timeSliderPersistableStateServiceFactory());

embeddable.registerEmbeddableFactory(
controlGroupContainerPersistableStateServiceFactory(embeddable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const DataViewEditor = ({
services,
defaultTypeIsRollup = false,
requireTimestampField = false,
showEmptyPrompt = true,
}: DataViewEditorPropsWithServices) => {
const { Provider: KibanaReactContextProvider } =
createKibanaReactContext<DataViewEditorContext>(services);
Expand All @@ -35,6 +36,7 @@ export const DataViewEditor = ({
onCancel={onCancel}
defaultTypeIsRollup={defaultTypeIsRollup}
requireTimestampField={requireTimestampField}
showEmptyPrompt={showEmptyPrompt}
/>
</EuiFlyout>
</KibanaReactContextProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export interface Props {
onCancel: () => void;
defaultTypeIsRollup?: boolean;
requireTimestampField?: boolean;
showEmptyPrompt?: boolean;
}

const editorTitle = i18n.translate('indexPatternEditor.title', {
Expand All @@ -69,6 +70,7 @@ const IndexPatternEditorFlyoutContentComponent = ({
onCancel,
defaultTypeIsRollup,
requireTimestampField = false,
showEmptyPrompt = true,
}: Props) => {
const {
services: { http, dataViews, uiSettings, searchClient },
Expand Down Expand Up @@ -316,7 +318,12 @@ const IndexPatternEditorFlyoutContentComponent = ({
);

return (
<EmptyPrompts onCancel={onCancel} allSources={allSources} loadSources={loadSources}>
<EmptyPrompts
onCancel={onCancel}
allSources={allSources}
loadSources={loadSources}
showEmptyPrompt={showEmptyPrompt}
>
<FlyoutPanels.Group flyoutClassName={'indexPatternEditorFlyout'} maxWidth={1180}>
<FlyoutPanels.Item className="fieldEditor__mainFlyoutPanel" border="right">
<EuiTitle data-test-subj="flyoutTitle">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ const IndexPatternFlyoutContentContainer = ({
onCancel = () => {},
defaultTypeIsRollup,
requireTimestampField = false,
showEmptyPrompt = true,
}: DataViewEditorProps) => {
const {
services: { dataViews, notifications },
Expand Down Expand Up @@ -48,6 +49,7 @@ const IndexPatternFlyoutContentContainer = ({
onCancel={onCancel}
defaultTypeIsRollup={defaultTypeIsRollup}
requireTimestampField={requireTimestampField}
showEmptyPrompt={showEmptyPrompt}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ interface Props {
onCancel: () => void;
allSources: MatchedItem[];
loadSources: () => void;
showEmptyPrompt?: boolean;
}

export function isUserDataIndex(source: MatchedItem) {
Expand All @@ -45,7 +46,13 @@ export function isUserDataIndex(source: MatchedItem) {
return true;
}

export const EmptyPrompts: FC<Props> = ({ allSources, onCancel, children, loadSources }) => {
export const EmptyPrompts: FC<Props> = ({
allSources,
onCancel,
children,
loadSources,
showEmptyPrompt,
}) => {
const {
services: { docLinks, application, http, searchClient, dataViews },
} = useKibana<DataViewEditorContext>();
Expand Down Expand Up @@ -93,7 +100,7 @@ export const EmptyPrompts: FC<Props> = ({ allSources, onCancel, children, loadSo
<PromptFooter onCancel={onCancel} />
</>
);
} else {
} else if (showEmptyPrompt) {
// first time
return (
<>
Expand All @@ -108,6 +115,8 @@ export const EmptyPrompts: FC<Props> = ({ allSources, onCancel, children, loadSo
<PromptFooter onCancel={onCancel} />
</>
);
} else {
setGoToForm(true);
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/plugins/data_view_editor/public/open_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const getEditorOpener =
onCancel = () => {},
defaultTypeIsRollup = false,
requireTimestampField = false,
showEmptyPrompt = true,
}: DataViewEditorProps): CloseEditor => {
const closeEditor = () => {
if (overlayRef) {
Expand Down Expand Up @@ -77,6 +78,7 @@ export const getEditorOpener =
}}
defaultTypeIsRollup={defaultTypeIsRollup}
requireTimestampField={requireTimestampField}
showEmptyPrompt={showEmptyPrompt}
/>
</I18nProvider>
</KibanaReactContextProvider>,
Expand Down
5 changes: 5 additions & 0 deletions src/plugins/data_view_editor/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ export interface DataViewEditorProps {
* Sets whether a timestamp field is required to create an index pattern. Defaults to false.
*/
requireTimestampField?: boolean;
/**
* If set to false, the screen for prompting a user to create a data view will be skipped, and the user will be taken directly
* to data view creation.
*/
showEmptyPrompt?: boolean;
}

// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,6 @@ export const applicationUsageSchema = {
siem: commonSchema,
space_selector: commonSchema,
uptime: commonSchema,
synthetics: commonSchema,
ux: commonSchema,
};
131 changes: 131 additions & 0 deletions src/plugins/telemetry/schema/oss_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -5891,6 +5891,137 @@
}
}
},
"synthetics": {
"properties": {
"appId": {
"type": "keyword",
"_meta": {
"description": "The application being tracked"
}
},
"viewId": {
"type": "keyword",
"_meta": {
"description": "Always `main`"
}
},
"clicks_total": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application since we started counting them"
}
},
"clicks_7_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 7 days"
}
},
"clicks_30_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 30 days"
}
},
"clicks_90_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 90 days"
}
},
"minutes_on_screen_total": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen since we started counting them."
}
},
"minutes_on_screen_7_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 7 days"
}
},
"minutes_on_screen_30_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 30 days"
}
},
"minutes_on_screen_90_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 90 days"
}
},
"views": {
"type": "array",
"items": {
"properties": {
"appId": {
"type": "keyword",
"_meta": {
"description": "The application being tracked"
}
},
"viewId": {
"type": "keyword",
"_meta": {
"description": "The application view being tracked"
}
},
"clicks_total": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application sub view since we started counting them"
}
},
"clicks_7_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 7 days"
}
},
"clicks_30_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 30 days"
}
},
"clicks_90_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 90 days"
}
},
"minutes_on_screen_total": {
"type": "float",
"_meta": {
"description": "Minutes the application sub view is active and on-screen since we started counting them."
}
},
"minutes_on_screen_7_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 7 days"
}
},
"minutes_on_screen_30_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 30 days"
}
},
"minutes_on_screen_90_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 90 days"
}
}
}
}
}
}
},
"ux": {
"properties": {
"appId": {
Expand Down
6 changes: 3 additions & 3 deletions test/functional/apps/discover/_field_data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
);
await retry.try(async function tryingForTime() {
expect(await PageObjects.discover.getDocHeader()).to.contain('relatedContent');
});

const field = await PageObjects.discover.getDocTableIndex(1);
expect(field).to.contain('og:description');
const field = await PageObjects.discover.getDocTableIndex(1);
expect(field).to.contain('og:description');
});

const marks = await PageObjects.discover.getMarks();
expect(marks.length).to.be(0);
Expand Down
Loading

0 comments on commit d129cfb

Please sign in to comment.