Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] added changes for moving notebooks to .kibana #1952

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions .cypress/integration/notebooks_test/notebooks.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,33 +93,16 @@
cy.contains(TEST_NOTEBOOK).should('exist');
});

it('Duplicates a notebook', () => {
cy.get('.euiCheckbox__input[title="Select this row"]').eq(0).click();
cy.get('button[data-test-subj="notebookTableActionBtn"]').click();
cy.get('button[data-test-subj="duplicateNotebookBtn"]').click();
cy.get('button[data-test-subj="custom-input-modal-confirm-button"]').click();

cy.get('.euiCheckbox__input[title="Select this row"]').eq(1).click();
});

it('Renames a notebook', () => {
cy.get('.euiCheckbox__input[title="Select this row"]').eq(0).click();
cy.get('button[data-test-subj="notebookTableActionBtn"]').click();
cy.get('button[data-test-subj="renameNotebookBtn"]').click();
cy.get('input[data-test-subj="custom-input-modal-input"]').focus().type(' (rename)');
cy.get('button[data-test-subj="custom-input-modal-confirm-button"]').click();
});

it('Searches existing notebooks', () => {
cy.get('input.euiFieldSearch').focus().type('this notebook should not exist');
cy.get('.euiTableCellContent__text').contains('No items found').should('exist');
cy.get('.euiFormControlLayoutClearButton').click();
cy.get('input.euiFieldSearch')
.focus()
.type(TEST_NOTEBOOK + ' (copy) (rename)');
.type(TEST_NOTEBOOK);

cy.get('a.euiLink')
.contains(TEST_NOTEBOOK + ' (copy) (rename)')
.contains(TEST_NOTEBOOK)
.should('exist');
});

Expand Down Expand Up @@ -210,7 +193,7 @@

it('Renders input only mode', () => {
cy.get('input[data-test-subj="input_only"]').should('exist');
cy.get('input[data-test-subj="input_only"]').click({ force: true });

Check warning on line 196 in .cypress/integration/notebooks_test/notebooks.spec.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls

cy.get('div.markdown-body').should('not.exist');
cy.get('button[data-test-subj="viewBothLink"]').should('exist');
Expand All @@ -222,7 +205,7 @@

it('Renders output only mode', () => {
cy.get('input[data-test-subj="output_only"]').should('exist');
cy.get('input[data-test-subj="output_only"]').click({ force: true });

Check warning on line 208 in .cypress/integration/notebooks_test/notebooks.spec.js

View workflow job for this annotation

GitHub Actions / Lint

Do not use force on click and type calls
cy.get('button[aria-label="Open paragraph menu"]').should('not.exist');
cy.get('button[data-test-subj="paragraphToggleInputBtn"]').should('not.exist');
cy.get('code').contains('POST').should('exist');
Expand Down
12 changes: 6 additions & 6 deletions common/types/notebooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@
*/

import { RefObject } from 'react';
import { DashboardStart } from "../../../../src/plugins/dashboard/public";
import { NavigationPublicPluginStart } from "../../../../src/plugins/navigation/public";

export interface NotebooksPluginSetup {
getGreeting: () => string;
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface NotebooksPluginStart {}

export interface optionsType {
export interface OptionsType {
baseUrl: string;
payload?: any;

Check warning on line 16 in common/types/notebooks.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
headers?: any;

Check warning on line 17 in common/types/notebooks.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
redirects?: number;
beforeRedirect?: any;

Check warning on line 19 in common/types/notebooks.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
redirected?: any;

Check warning on line 20 in common/types/notebooks.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
timeout?: number; // default: unlimited
maxBytes?: number; // default: unlimited
rejectUnauthorized?: boolean;
Expand All @@ -27,7 +25,7 @@
ciphers?: string; // The TLS ciphers to support
}

export type ParaType = {
export interface ParaType {
uniqueId: string;
isRunning: boolean;
inQueue: boolean;
Expand All @@ -41,8 +39,8 @@
inp: string;
lang: string;
editorLanguage: string;
typeOut: Array<string>;
typeOut: string[];
out: any[];

Check warning on line 43 in common/types/notebooks.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
isInputExpanded: boolean;
isOutputStale: boolean;
paraRef: RefObject<React.ReactElement>;
Expand All @@ -50,4 +48,6 @@
visStartTime?: string;
visEndTime?: string;
visSavedObjId?: string;
};
dataSourceMDSId?: string;
dataSourceMDSLabel?: string;
}
2 changes: 2 additions & 0 deletions common/types/observability_saved_object_attributes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import { SavedQuery, SavedVisualization } from './explorer';

export const VISUALIZATION_SAVED_OBJECT = 'observability-visualization';
export const SEARCH_SAVED_OBJECT = 'observability-search';
export const NOTEBOOK_SAVED_OBJECT = 'observability-notebook';
export const OBSERVABILTY_SAVED_OBJECTS = [
VISUALIZATION_SAVED_OBJECT,
SEARCH_SAVED_OBJECT,
NOTEBOOK_SAVED_OBJECT,
] as const;
export const SAVED_OBJECT_VERSION = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ exports[`Panels View Component render panel view container and refresh panel 1`]
class="euiToolTipAnchor"
>
<button
class="euiButton euiButton--primary euiButton--fill euiSuperUpdateButton"
class="euiButton euiButton--primary euiSuperUpdateButton"
data-test-subj="superDatePickerApplyTimeButton"
type="button"
>
Expand Down Expand Up @@ -734,7 +734,7 @@ exports[`Panels View Component render panel view so container and reload dashboa
class="euiToolTipAnchor"
>
<button
class="euiButton euiButton--primary euiButton--fill euiSuperUpdateButton"
class="euiButton euiButton--primary euiSuperUpdateButton"
data-test-subj="superDatePickerApplyTimeButton"
type="button"
>
Expand Down Expand Up @@ -2334,7 +2334,6 @@ exports[`Panels View Component renders panel view container with visualizations
className="euiSuperUpdateButton"
color="primary"
data-test-subj="superDatePickerApplyTimeButton"
fill={true}
iconType="refresh"
isDisabled={false}
isLoading={false}
Expand All @@ -2354,7 +2353,6 @@ exports[`Panels View Component renders panel view container with visualizations
data-test-subj="superDatePickerApplyTimeButton"
disabled={false}
element="button"
fill={true}
iconType="refresh"
isDisabled={false}
isLoading={false}
Expand All @@ -2369,7 +2367,7 @@ exports[`Panels View Component renders panel view container with visualizations
type="button"
>
<button
className="euiButton euiButton--primary euiButton--fill euiSuperUpdateButton"
className="euiButton euiButton--primary euiSuperUpdateButton"
data-test-subj="superDatePickerApplyTimeButton"
disabled={false}
onBlur={[Function]}
Expand Down Expand Up @@ -4581,7 +4579,6 @@ exports[`Panels View Component renders panel view container without visualizatio
className="euiSuperUpdateButton"
color="primary"
data-test-subj="superDatePickerApplyTimeButton"
fill={true}
iconType="refresh"
isDisabled={false}
isLoading={false}
Expand All @@ -4601,7 +4598,6 @@ exports[`Panels View Component renders panel view container without visualizatio
data-test-subj="superDatePickerApplyTimeButton"
disabled={false}
element="button"
fill={true}
iconType="refresh"
isDisabled={false}
isLoading={false}
Expand All @@ -4616,7 +4612,7 @@ exports[`Panels View Component renders panel view container without visualizatio
type="button"
>
<button
className="euiButton euiButton--primary euiButton--fill euiSuperUpdateButton"
className="euiButton euiButton--primary euiSuperUpdateButton"
data-test-subj="superDatePickerApplyTimeButton"
disabled={false}
onBlur={[Function]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ exports[`Panels View SO Component render panel view container and refresh panel
class="euiToolTipAnchor"
>
<button
class="euiButton euiButton--primary euiButton--fill euiSuperUpdateButton"
class="euiButton euiButton--primary euiSuperUpdateButton"
data-test-subj="superDatePickerApplyTimeButton"
type="button"
>
Expand Down Expand Up @@ -734,7 +734,7 @@ exports[`Panels View SO Component render panel view so container and reload dash
class="euiToolTipAnchor"
>
<button
class="euiButton euiButton--primary euiButton--fill euiSuperUpdateButton"
class="euiButton euiButton--primary euiSuperUpdateButton"
data-test-subj="superDatePickerApplyTimeButton"
type="button"
>
Expand Down Expand Up @@ -1167,7 +1167,7 @@ exports[`Panels View SO Component renders panels view SO container with visualiz
class="euiToolTipAnchor"
>
<button
class="euiButton euiButton--primary euiButton--fill euiSuperUpdateButton"
class="euiButton euiButton--primary euiSuperUpdateButton"
data-test-subj="superDatePickerApplyTimeButton"
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,6 @@ exports[`Metrics Top Menu Component renders Top Menu Component when enabled 1`]
className="euiSuperUpdateButton"
color="primary"
data-test-subj="superDatePickerApplyTimeButton"
fill={true}
iconType="refresh"
isDisabled={false}
isLoading={false}
Expand All @@ -717,7 +716,6 @@ exports[`Metrics Top Menu Component renders Top Menu Component when enabled 1`]
data-test-subj="superDatePickerApplyTimeButton"
disabled={false}
element="button"
fill={true}
iconType="refresh"
isDisabled={false}
isLoading={false}
Expand All @@ -732,7 +730,7 @@ exports[`Metrics Top Menu Component renders Top Menu Component when enabled 1`]
type="button"
>
<button
className="euiButton euiButton--primary euiButton--fill euiSuperUpdateButton"
className="euiButton euiButton--primary euiSuperUpdateButton"
data-test-subj="superDatePickerApplyTimeButton"
disabled={false}
onBlur={[Function]}
Expand Down
Loading
Loading