-
Notifications
You must be signed in to change notification settings - Fork 906
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
New homepage #5613
New homepage #5613
Changes from all commits
0e4a30d
1572cac
7babcc1
8a48a5f
f9183d4
ca0eb55
76ec36a
1c00578
c4eea91
f87bb41
cb4538c
35ffb80
6a8ae77
ea5b7e1
f50aa73
c0203d4
e192c1a
06a18f3
1d45b7c
cfe4512
2fc43e4
afedf5b
ad7e3bd
9892fa3
950f892
f66827e
c60d61e
0ffeea4
decff05
ea10edb
b0b9721
dd23069
86e63b3
a91d9aa
70e0ff2
ebaddb6
c24a44e
18cfbe0
0626331
e68b7e0
c9b225a
4d5e2ef
e25eecb
3d5224d
07948ad
063a3f7
a004be0
9f1f88b
e3ccc61
99eedf6
32844b3
bb7d2e3
fc12da9
ae334f9
40ffea4
7f33cd4
f839074
2b16a10
7899ca5
c2176cd
14aa57a
9e4554f
018c984
a61ef5d
cd0da80
083eb3f
9e0d5b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ | |
@import "synopsis"; | ||
@import "welcome"; | ||
@import "tutorial/tutorial"; | ||
@import "homepage/homepage"; |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,9 @@ | ||||||
.home-homepage-pageBody { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit:
Suggested change
following BEM |
||||||
// This is needed to make sure the page body is not wider than the page. | ||||||
// This is otherwise not possible with the props on EuiPageTemplate. | ||||||
padding: 0 $euiSizeL; | ||||||
} | ||||||
|
||||||
.home-homepage-body--fill { | ||||||
min-height: $euiSize * 50; | ||||||
} |
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,105 @@ | ||||||||||
/* | ||||||||||
* Copyright OpenSearch Contributors | ||||||||||
* SPDX-License-Identifier: Apache-2.0 | ||||||||||
*/ | ||||||||||
|
||||||||||
import React from 'react'; | ||||||||||
import { FormattedMessage } from '@osd/i18n/react'; | ||||||||||
import { EuiFlexGroup, EuiFlexItem, EuiButtonEmpty } from '@elastic/eui'; | ||||||||||
import { i18n } from '@osd/i18n'; | ||||||||||
import { CoreStart } from 'opensearch-dashboards/public'; | ||||||||||
import { HOME_APP_BASE_PATH } from '../../../../common/constants'; | ||||||||||
import { | ||||||||||
RedirectAppLinks, | ||||||||||
useOpenSearchDashboards, | ||||||||||
useUiSetting$, | ||||||||||
} from '../../../../../opensearch_dashboards_react/public'; | ||||||||||
|
||||||||||
export const Footer: React.FC = () => { | ||||||||||
BSFishy marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
const [defaultRoute, setDefaultRoute] = useUiSetting$<string>('defaultRoute'); | ||||||||||
const { | ||||||||||
services: { | ||||||||||
application, | ||||||||||
notifications: { toasts }, | ||||||||||
}, | ||||||||||
} = useOpenSearchDashboards<CoreStart>(); | ||||||||||
|
||||||||||
const getUrlForApp = application.getUrlForApp; | ||||||||||
const { show, save } = application.capabilities.advancedSettings ?? {}; | ||||||||||
Comment on lines
+27
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
|
||||||||||
const isAdvancedSettingsEnabled = show && save; | ||||||||||
|
||||||||||
const defaultRouteButton = | ||||||||||
defaultRoute === HOME_APP_BASE_PATH ? ( | ||||||||||
<RedirectAppLinks application={application}> | ||||||||||
<EuiButtonEmpty | ||||||||||
flush="both" | ||||||||||
href={getUrlForApp('management', { path: 'opensearch-dashboards/settings#defaultRoute' })} | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we need to do this for all links since they are internal links and this is how you trigger SPA routing
Suggested change
|
||||||||||
iconType="home" | ||||||||||
size="xs" | ||||||||||
> | ||||||||||
<FormattedMessage | ||||||||||
id="home.footer.changeHomeRouteLink" | ||||||||||
defaultMessage="Display a different page on log in" | ||||||||||
/> | ||||||||||
</EuiButtonEmpty> | ||||||||||
</RedirectAppLinks> | ||||||||||
) : ( | ||||||||||
<EuiButtonEmpty | ||||||||||
flush="both" | ||||||||||
iconType="home" | ||||||||||
onClick={() => { | ||||||||||
setDefaultRoute(HOME_APP_BASE_PATH); | ||||||||||
toasts.addSuccess({ | ||||||||||
title: i18n.translate('home.footer.changeDefaultRouteSuccessToast', { | ||||||||||
defaultMessage: 'Landing page updated', | ||||||||||
}), | ||||||||||
}); | ||||||||||
}} | ||||||||||
size="xs" | ||||||||||
> | ||||||||||
<FormattedMessage | ||||||||||
id="home.footer.makeDefaultRouteLink" | ||||||||||
defaultMessage="Make this my landing page" | ||||||||||
/> | ||||||||||
</EuiButtonEmpty> | ||||||||||
); | ||||||||||
|
||||||||||
return ( | ||||||||||
<EuiFlexGroup direction="row" wrap> | ||||||||||
{isAdvancedSettingsEnabled && <EuiFlexItem grow={false}>{defaultRouteButton}</EuiFlexItem>} | ||||||||||
|
||||||||||
<EuiFlexItem grow={false}> | ||||||||||
<RedirectAppLinks application={application}> | ||||||||||
<EuiButtonEmpty | ||||||||||
flush="both" | ||||||||||
href={getUrlForApp('home', { path: '#/feature_directory' })} | ||||||||||
iconType="apps" | ||||||||||
size="xs" | ||||||||||
> | ||||||||||
<FormattedMessage | ||||||||||
id="home.footer.appDirectoryButtonLabel" | ||||||||||
defaultMessage="View app directory" | ||||||||||
/> | ||||||||||
</EuiButtonEmpty> | ||||||||||
</RedirectAppLinks> | ||||||||||
</EuiFlexItem> | ||||||||||
|
||||||||||
<EuiFlexItem grow={false}> | ||||||||||
<RedirectAppLinks application={application}> | ||||||||||
<EuiButtonEmpty | ||||||||||
flush="both" | ||||||||||
href={getUrlForApp('opensearch_dashboards_overview')} | ||||||||||
iconType="visualizeApp" | ||||||||||
size="xs" | ||||||||||
> | ||||||||||
<FormattedMessage | ||||||||||
id="home.footer.visualizeAndAnalyze" | ||||||||||
defaultMessage="Visualize & Analyze" | ||||||||||
/> | ||||||||||
</EuiButtonEmpty> | ||||||||||
</RedirectAppLinks> | ||||||||||
</EuiFlexItem> | ||||||||||
</EuiFlexGroup> | ||||||||||
); | ||||||||||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React, { FC } from 'react'; | ||
import { EuiPanel } from '@elastic/eui'; | ||
import { RenderFn } from '../../../services/section_type/section_type'; | ||
import { LazyRender } from './lazy_render'; | ||
|
||
interface Props { | ||
render: RenderFn; | ||
} | ||
|
||
export const HeroSection: FC<Props> = ({ render }) => { | ||
return ( | ||
<EuiPanel data-test-subj="homepageHeroSection"> | ||
<LazyRender render={render} /> | ||
</EuiPanel> | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is input that can be passed github so i believe we can just remove this. or if we create a feature branch within this repo and call it
feature/new-home
it will pull automatically.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spoke to Rocky offline:
This is a trick to make sure merging this PR doesn't impact other PRs while the FTR PR is open and vice versa. Creating a feature branch on FTR and pointing this PR to that, and later PRing the feature branch to FTR:
main
will continue to look at the feature branch of FTR; tests will pass because all new PRs will be pointing to the feature branch.main
; OSD tests will continue to point to the feature branch and will continue to pass.main
; OSD tests will continue to pass since FTRmain
has the correct tests that were merged in from the feature branch.This choreography is to make sure we never accept failing tests as a side effect of having new tests added or new functionality added.