-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADDON-34283: ucc_ui_lib: updated configs and structure to have single…
… entry point js and template file
- Loading branch information
1 parent
6328fdf
commit e04d1db
Showing
10 changed files
with
65 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 0 additions & 31 deletions
31
...ucc_framework/ucc_ui_lib/src/main/resources/splunk/appserver/templates/configuration.html
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...cc_framework/ucc_ui_lib/src/main/resources/splunk/default/data/ui/views/configuration.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0"?> | ||
<view template="${package.name}:/templates/configuration.html" type="html" isDashboard="False"> | ||
<view template="${package.name}:/templates/base.html" type="html" isDashboard="False"> | ||
<label>Configuration</label> | ||
</view> |
2 changes: 1 addition & 1 deletion
2
...dd_on_ucc_framework/ucc_ui_lib/src/main/resources/splunk/default/data/ui/views/inputs.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0"?> | ||
<view template="${package.name}:/templates/inputs.html" type="html" isDashboard="False"> | ||
<view template="${package.name}:/templates/base.html" type="html" isDashboard="False"> | ||
<label>Inputs</label> | ||
</view> |
File renamed without changes.
41 changes: 0 additions & 41 deletions
41
splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/pages/configuration/index.jsx
This file was deleted.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/pages/entry_page.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import React from 'react'; | ||
|
||
import layout from '@splunk/react-page'; | ||
import { SplunkThemeProvider } from '@splunk/themes'; | ||
|
||
import { defaultTheme } from '@splunk/splunk-utils/themes'; | ||
|
||
import TestComponent from '../components/TestComponent'; | ||
import { StyledContainer, StyledGreeting } from './StartStyles'; | ||
|
||
const defaultThemeSplunkThemeProviderMap = { | ||
enterprise: { | ||
family: 'enterprise', | ||
colorScheme: 'light', | ||
density: 'comfortable', | ||
}, | ||
enterpriseDark: { | ||
family: 'enterprise', | ||
colorScheme: 'dark', | ||
density: 'comfortable', | ||
}, | ||
lite: { | ||
family: 'enterprise', | ||
colorScheme: 'light', | ||
density: 'comfortable', | ||
}, | ||
}; | ||
|
||
const themeProviderSettings = | ||
defaultThemeSplunkThemeProviderMap[defaultTheme()] || | ||
defaultThemeSplunkThemeProviderMap.enterprise; | ||
|
||
const url = window.location.pathname; | ||
const urlParts = url.substring(1).split('/'); | ||
const page = urlParts[urlParts.length - 1]; | ||
|
||
if (page === 'inputs') { | ||
layout( | ||
<SplunkThemeProvider {...themeProviderSettings}> | ||
<StyledContainer> | ||
<StyledGreeting>Hello, from inside Inputs!</StyledGreeting> | ||
<div>Your component will appear below.</div> | ||
<TestComponent name="from inside TestComponent" /> | ||
</StyledContainer> | ||
</SplunkThemeProvider>, | ||
{ pageTitle: 'Inputs' } | ||
); | ||
} else if (page === 'configuration') { | ||
layout( | ||
<SplunkThemeProvider {...themeProviderSettings}> | ||
<StyledContainer> | ||
<StyledGreeting>Hello, from inside Configuration!</StyledGreeting> | ||
<div>Your component will appear below.</div> | ||
<TestComponent name="from inside TestComponent" /> | ||
</StyledContainer> | ||
</SplunkThemeProvider>, | ||
{ pageTitle: 'Configuration' } | ||
); | ||
} |
18 changes: 0 additions & 18 deletions
18
splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/pages/inputs/StartStyles.js
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
splunk_add_on_ucc_framework/ucc_ui_lib/src/main/webapp/pages/inputs/index.jsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters