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

Changes edit view to json read-only view #112034

Merged
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
74e910a
Changes edit view to json read-only view
TinaHeiligers Sep 3, 2021
0b25760
Adds copy to clipboard functionality
TinaHeiligers Sep 13, 2021
238f6da
Adds link to saved objects api for not found error message
TinaHeiligers Sep 13, 2021
9dfde70
Update i18n
TinaHeiligers Sep 13, 2021
8e31205
Cleans up todo comments
TinaHeiligers Sep 14, 2021
148a2b9
Merge branch 'master' into so-management/read-only-inspect-view
TinaHeiligers Sep 14, 2021
1110ff3
Updates test for ensuring we can inspect a saved object in a non-defa…
TinaHeiligers Sep 14, 2021
8c92317
Updates unit test snapshot and refactors security-related saved objec…
TinaHeiligers Sep 14, 2021
e2c7143
Merge branch 'master' into so-management/read-only-inspect-view
TinaHeiligers Sep 15, 2021
e091640
Merge branch 'master' into so-management/read-only-inspect-view
TinaHeiligers Sep 16, 2021
b31a0a8
removes getEditUrl from saved object loader searchSavedObjectType, cr…
TinaHeiligers Sep 16, 2021
3c89d0b
Addresses draft comments
TinaHeiligers Sep 16, 2021
3f2b30d
improves functional tests
TinaHeiligers Sep 16, 2021
dac2f76
Fixes som api_integration test
TinaHeiligers Sep 17, 2021
8df5007
Updates unit test snapshots, sets available in relationships flyout a…
TinaHeiligers Sep 17, 2021
9de3eb1
Updates api_integration test making editUrl optional in the schema
TinaHeiligers Sep 17, 2021
121283e
Merge branch 'master' into so-management/read-only-inspect-view
kibanamachine Sep 18, 2021
2c19acc
Merge branch 'master' into so-management/read-only-inspect-view
kibanamachine Sep 19, 2021
3cc2504
Merge branch 'master' into so-management/read-only-inspect-view
TinaHeiligers Sep 20, 2021
7b748d0
Removes serviceRegistry from the top most UI layer
TinaHeiligers Sep 20, 2021
ad1d088
moves inline style to scss file
TinaHeiligers Sep 20, 2021
52f2261
Update snapshots
TinaHeiligers Sep 20, 2021
e703655
Moves inline style to stylesheet
TinaHeiligers Sep 21, 2021
940588d
Merge branch 'master' into so-management/read-only-inspect-view
TinaHeiligers Sep 21, 2021
8c75ad8
Addresses nits
TinaHeiligers Sep 21, 2021
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
1 change: 1 addition & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ export class DocLinksService {
kibanaSearchSettings: `${KIBANA_DOCS}advanced-options.html#kibana-search-settings`,
visualizationSettings: `${KIBANA_DOCS}advanced-options.html#kibana-visualization-settings`,
timelionSettings: `${KIBANA_DOCS}advanced-options.html#kibana-timelion-settings`,
savedObjectsApiList: `${KIBANA_DOCS}saved-objects-api.html#saved-objects-api`,
},
ml: {
guide: `${ELASTIC_WEBSITE_URL}guide/en/machine-learning/${DOC_LINK_VERSION}/index.html`,
Expand Down
3 changes: 0 additions & 3 deletions src/plugins/dashboard/server/saved_objects/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ export const createDashboardSavedObjectType = ({
getTitle(obj) {
return obj.attributes.title;
},
getEditUrl(obj) {
Copy link
Contributor Author

@TinaHeiligers TinaHeiligers Sep 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allows us to decouple the loaders from the saved objects management page and still render the underlying saved object in the SOM Inspect view.
We were using the loaders to map from savedDashboards back to dashboard but we're aiming at removing the dependency on the loaders in the saved objects management plugin.

return `/management/kibana/objects/savedDashboards/${encodeURIComponent(obj.id)}`;
},
getInAppUrl(obj) {
return {
path: `/app/dashboards#/view/${encodeURIComponent(obj.id)}`,
Expand Down
3 changes: 0 additions & 3 deletions src/plugins/discover/server/saved_objects/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ export const searchSavedObjectType: SavedObjectsType = {
getTitle(obj) {
return obj.attributes.title;
},
getEditUrl(obj) {
Copy link
Contributor Author

@TinaHeiligers TinaHeiligers Sep 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allows us to decouple the loaders from the saved objects management page and still render the underlying saved object in the SOM Inspect view.

return `/management/kibana/objects/savedSearches/${encodeURIComponent(obj.id)}`;
},
getInAppUrl(obj) {
return {
path: `/app/discover#/view/${encodeURIComponent(obj.id)}`,
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/embeddable/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ export class EmbeddablePublicPlugin implements Plugin<EmbeddableSetup, Embeddabl
);

const commonContract: CommonEmbeddableStartContract = {
getEmbeddableFactory: (this
.getEmbeddableFactory as unknown) as CommonEmbeddableStartContract['getEmbeddableFactory'],
getEmbeddableFactory: this
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier fix after #112359

.getEmbeddableFactory as unknown as CommonEmbeddableStartContract['getEmbeddableFactory'],
getEnhancement: this.getEnhancement,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ beforeEach(async () => {

const contactCardFactory = new ContactCardEmbeddableFactory(
uiActions.executeTriggerActions,
({} as unknown) as OverlayStart
{} as unknown as OverlayStart
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier fix after #112359

);
setup.registerEmbeddableFactory(contactCardFactory.type, contactCardFactory);

Expand Down
8 changes: 4 additions & 4 deletions src/plugins/embeddable/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export class EmbeddableServerPlugin implements Plugin<EmbeddableSetup, Embeddabl

public setup(core: CoreSetup) {
const commonContract: CommonEmbeddableStartContract = {
getEmbeddableFactory: (this
.getEmbeddableFactory as unknown) as CommonEmbeddableStartContract['getEmbeddableFactory'],
getEmbeddableFactory: this
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier fix after #112359

.getEmbeddableFactory as unknown as CommonEmbeddableStartContract['getEmbeddableFactory'],
getEnhancement: this.getEnhancement,
};

Expand All @@ -68,8 +68,8 @@ export class EmbeddableServerPlugin implements Plugin<EmbeddableSetup, Embeddabl

public start(core: CoreStart) {
const commonContract: CommonEmbeddableStartContract = {
getEmbeddableFactory: (this
.getEmbeddableFactory as unknown) as CommonEmbeddableStartContract['getEmbeddableFactory'],
getEmbeddableFactory: this
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettier fix after #112359

.getEmbeddableFactory as unknown as CommonEmbeddableStartContract['getEmbeddableFactory'],
getEnhancement: this.getEnhancement,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,11 @@ export const mountManagementSection = async ({
<I18nProvider>
<Router history={history}>
<Switch>
<Route path={'/:service/:id'} exact={true}>
<Route path={'/:type/:id'} exact={true}>
<RedirectToHomeIfUnauthorized>
<Suspense fallback={<EuiLoadingSpinner />}>
<SavedObjectsEditionPage
coreStart={coreStart}
Comment on lines +65 to 69
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see serviceRegistry is still passed down to <SavedObjectsTablePage>, to then be propagated to <Flyout>, where it apparently no longer have any usage. Do we want to perform the final SOL cleanup in this PR or in a follow-up?

Copy link
Contributor Author

@TinaHeiligers TinaHeiligers Sep 20, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Um, good point! I'll double check to make sure we're not using the serviceRegistry in some sub-component and can probably remove it in this PR if we want to go that way (or at least remove it from the top most UI layer, meaning the <Flyout> and <SavedObjectsTablePage>).

We have an open issue to handle decoupling the SOM from the SOL, so maybe we should defer the cleanup to a different PR to play it safe?

I've realized small changes in one area have some unexpected downstream consequences (as with most things related to legacy code and saved objects 😆 ).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've taken a stab at removing the serviceRegistry up to a point in the top-most UI. I'd prefer to delay removing the rest to a follow up PR.

serviceRegistry={serviceRegistry}
setBreadcrumbs={setBreadcrumbs}
history={history}
/>
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading