Comments (16)
For reference, the discussion above that I posed about defaults in 2.10 is irrelevant of the choices we make around defaults at time shipping - because once an admin changes their own defaults to v7 dark
or next dark
, these issues will still be present.
from security-dashboards-plugin.
To Kroosh's point, theme:version
and theme:darkMode
are configurable parameters in the opensearch_dashboards.yml
file, and whether we decide to change the defaults or not, don't impact the need to make the pages function correctly for those configurations.
from security-dashboards-plugin.
@wbeckler @mnkugler top discussion question for you - my recommendation would be to use the current default since we will not be defaulting to next dark mode in 2.10 any longer.
from security-dashboards-plugin.
Let's use light mode for login, but why not "Next"?
from security-dashboards-plugin.
Is login part of security dashboard plugin?
from security-dashboards-plugin.
@wbeckler "why not next" - until we cut over, it would be potentially very strange to see the new "primary" color and then land in an experience with a different "primary" color
re: security plugin - I am not sure @kgcreative do you know?
from security-dashboards-plugin.
Login is provided by the security dashboards plugin, yes. IIRC it's a standalone page since the application hasn't loaded at that point
from security-dashboards-plugin.
[Triage] Hi @KrooshalUX, can you please provide more information about what actionable items you would like addressed? This is especially important if we want this for 2.10, but it is not clear what is expected on the Security repository's behalf. Thank you.
from security-dashboards-plugin.
There are two main tasks:
- make sure the login pages uses
uiSettings.getOverrideOrDefault('theme:version'))
anduiSettings.getOverrideOrDefault('theme:darkMode'))
if it is dependent on the theme in any way. - make sure the imagery and any styling on the login page work in dark mode:
- if using any SVGs, make sure they are color-scheme-aware like this.
- if you have any styling, make sure they use
$eui...
colors or target dark-mode as well using@media (prefers-color-scheme: dark)
from security-dashboards-plugin.
@kamingleung can you confirm if this has been decided and we're good to go ahead?
from security-dashboards-plugin.
Hi @AMoo-Miki, I was looking at setting up the changes you mentioned.
I went over to the login-page.tsx and tried to add:
const {
services: { http, data, uiSettings, application },
} = useOpenSearchDashboards<CoreStart & AppPluginStartDependencies>();
const IS_DARK_THEME = uiSettings.get('theme:darkMode');
Based off of the pattern shown here: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/a52e95cbcc5075a4716274749d71d7d635704c4f/src/plugins/opensearch_dashboards_overview/public/components/overview/overview.tsx#L76-L81.
I was then going to add this: className={login-wrapper ${IS_DARK_THEME ? 'dark-theme' : 'light-theme'}}
to the EUIListGroup thinking it would then change the color as required.
It seems like this is not the right method of handling this however...
Do you have any suggestions for what I can try? I also added the opensearchDashboardsReact dependency, so I am not sure what I am missing here for the uiSettings to be accessable in the Security Dashboards. Sorry if this is obvious, but I am less familiar with the front end code.
from security-dashboards-plugin.
Hi @KrooshalUX, @AMoo-Miki, @kgcreative
For the login-page I have:
...
interface LoginPageDeps {
http: CoreStart['http'];
uiSettings: CoreStart['uiSettings'];
config: ClientConfigType;
}
interface LoginButtonConfig {
buttonname: string;
showbrandimage: boolean;
brandimage: string;
buttonstyle: string;
}
function redirect(serverBasePath: string) {
// navigate to nextUrl
const urlParams = new URLSearchParams(window.location.search);
let nextUrl = urlParams.get('nextUrl');
if (!nextUrl || nextUrl.toLowerCase().includes('//')) {
// Appending the next url with trailing slash. We do so because in case the serverBasePath is empty, we can simply
// redirect to '/'.
nextUrl = serverBasePath + '/';
}
window.location.href = nextUrl + window.location.hash;
}
export function LoginPage(props: LoginPageDeps) {
const [username, setUsername] = React.useState('');
const [password, setPassword] = React.useState('');
const [loginFailed, setloginFailed] = useState(false);
const [loginError, setloginError] = useState('');
const [usernameValidationFailed, setUsernameValidationFailed] = useState(false);
const [passwordValidationFailed, setPasswordValidationFailed] = useState(false);
const IS_DARK_THEME = props.uiSettings.get('theme:darkMode');
const defaultBrandImage = IS_DARK_THEME ? defaultDarkBrandImage : defaultLightBrandImage
...
This allows us to access the uiSettings from core start by modifying
export function renderApp(
coreStart: CoreStart,
params: AppMountParameters,
config: ClientConfigType
) {
ReactDOM.render(<LoginPage http={coreStart.http} uiSettings={coreStart.uiSettings} config={config} />, params.element);
return () => ReactDOM.unmountComponentAtNode(params.element);
}
I am running into an issue with the use of this setting however. From what I have seen, when this configuration is used, we need elements to swap between:
From Overview.tsx
const getSolutionGraphicURL = (solutionId: string) =>
`/plugins/${PLUGIN_ID}/assets/solutions_${solutionId}_${
IS_DARK_THEME ? 'dark' : 'light'
}_2x.png`;
I am not sure where to get these elements from.
from security-dashboards-plugin.
Messaged Miki since it is not clear to me how to resolve the elements--I assume there are separate assets to be rendered but I do not know where to find these.
from security-dashboards-plugin.
Miki's change here: opensearch-project/oui#871 fixes the second problem
from security-dashboards-plugin.
For the last item, I have refactored OSD's serving of logos in opensearch-project/OpenSearch-Dashboards#4702 and have the changes ready to PR to this repo as soon as that is merged.
from security-dashboards-plugin.
Related Issues (20)
- [RELEASE] Release version 2.10.0 HOT 4
- [BUG] 1.x should contain changes from 1.3 HOT 1
- [BUG] OpenID Token not refreshed HOT 15
- [FEATURE] Password Strength UI HOT 6
- [FEATURE] OpenSearch logo should inherit from OpenSearch Dashboards branding configuration (and be theme-aware) HOT 2
- [RELEASE] Release version 3.0.0 HOT 2
- (OUI Next Theme) Security HOT 23
- [BUG] SSO login redirect to home page instead of nexturl HOT 4
- [BUG] install_dashboards github action is not properly handling multi-digit major or minor versions HOT 1
- [FEATURE] Mimic the pre-commit hooks from OpenSearch Dashboards HOT 1
- [BUG] Issues running selenium tests with headless Firefox HOT 5
- [AUTOCUT] Integration Test failed for securityDashboards: 1.3.12 tar distribution HOT 4
- [AUTOCUT] Integration Test failed for securityDashboards: 1.3.12 rpm distribution HOT 1
- [BUG] 2 failing integration tests in jwt_auth.test.ts in 2.x HOT 4
- Enable SAML Integration tests for windows
- [Cypress12] Ensure cypress functional tests run with Cypress12 HOT 3
- [FEATURE] Add multi tenancy feature flag and whether user is security admin info at request level in authHandler
- [BUG] opensearch login not working with more than 15 roles assign to user HOT 12
- [AUTOCUT] Distribution Build Failed for securityDashboards-2.10.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from security-dashboards-plugin.