Skip to content

Commit

Permalink
added changes for moving notebooks to .kibana (#1937)
Browse files Browse the repository at this point in the history
* added changes for moving notebooks to .kibana

Signed-off-by: sumukhswamy <[email protected]>

* updated tests

Signed-off-by: sumukhswamy <[email protected]>

* added changes for older notebooks viewing

Signed-off-by: sumukhswamy <[email protected]>

* mds changes for notebooks -s

Signed-off-by: sumukhswamy <[email protected]>

* resolved conflicts

Signed-off-by: sumukhswamy <[email protected]>

* linter fixes

Signed-off-by: sumukhswamy <[email protected]>

* added changes for mds, persistance and sample notebooks

Signed-off-by: sumukhswamy <[email protected]>

* changed route to /savednotebook

Signed-off-by: sumukhswamy <[email protected]>

* addressed comments

Signed-off-by: sumukhswamy <[email protected]>

* edge cases for migration

Signed-off-by: sumukhswamy <[email protected]>

* adeed unit tests

Signed-off-by: sumukhswamy <[email protected]>

* updated snapshots

Signed-off-by: sumukhswamy <[email protected]>

* updated snapshots

Signed-off-by: sumukhswamy <[email protected]>

* added changes for cypress tests

Signed-off-by: sumukhswamy <[email protected]>

* changed cypress test as rename and duplicate has been removed

Signed-off-by: sumukhswamy <[email protected]>

---------

Signed-off-by: sumukhswamy <[email protected]>
  • Loading branch information
sumukhswamy authored Jul 22, 2024
1 parent 25fb838 commit 2ab8369
Show file tree
Hide file tree
Showing 33 changed files with 1,751 additions and 1,068 deletions.
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 @@ describe('Testing notebooks table', () => {
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
12 changes: 6 additions & 6 deletions common/types/notebooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
*/

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;
headers?: any;
Expand All @@ -27,7 +25,7 @@ export interface optionsType {
ciphers?: string; // The TLS ciphers to support
}

export type ParaType = {
export interface ParaType {
uniqueId: string;
isRunning: boolean;
inQueue: boolean;
Expand All @@ -41,7 +39,7 @@ export type ParaType = {
inp: string;
lang: string;
editorLanguage: string;
typeOut: Array<string>;
typeOut: string[];
out: any[];
isInputExpanded: boolean;
isOutputStale: boolean;
Expand All @@ -50,4 +48,6 @@ export type ParaType = {
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

0 comments on commit 2ab8369

Please sign in to comment.