-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Getting Started page #11673
Merged
Merged
Getting Started page #11673
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
8973dd8
Initial code
ycombinator f6060fc
Renaming files/folders
ycombinator ba02794
Notes and changes from HTML/CSS review
ycombinator fba0b1a
CSS changes
ycombinator 2814cc6
Fixing transform units
ycombinator 9f750c9
Fleshing out logo circle
ycombinator 7b37341
Adding logos
ycombinator 0a3f128
Un-nesting styles
ycombinator c4cbd5c
Adding kuiText class on <p> elements
ycombinator 56655f7
Making shield icon 404 go away
ycombinator 8ed8eea
Using trustAsHtml filter; using registry
ycombinator 4e874b9
Adding code for registry
ycombinator 7b1b1ff
Adding images
ycombinator 7e6ba59
Hooking up the opt-out link
ycombinator 56139ea
Fixing linter issues
ycombinator f12ed8c
Fix issue with refresh bringing back nav
ycombinator 79b32a3
Removing load_default module
ycombinator 385da99
Use GETTING_STARTED_ROUTE constant
ycombinator dbcad09
Allow topMessage to be a directive
ycombinator b88c29f
Adding kuiLink CSS class to anchor elements
ycombinator 117bb2d
Adding alt text to images
ycombinator e7d7f49
Replace getters with regular methods
ycombinator 1c3e84a
Remove leftover comment
ycombinator 22fb2b5
Removing unnecessary comment
ycombinator 8d28c81
Fixing typo in comment
ycombinator dc25749
Adding comments for message properties
ycombinator b501cb4
Fixing typo in method name
ycombinator 7ebe20d
Defining custom CSS class
ycombinator 2449291
Fixing method call
ycombinator 5259d0f
Creating custom CSS classes
ycombinator 99d88bf
Adding documentation links
ycombinator f09ac10
Use a instead of button for demo link
ycombinator bb0837f
Allow directives in manage and monitor messages
ycombinator 235c1cf
Refactoring shared code into single ui/public/getting_started folder
ycombinator 65a4a64
Adding README
ycombinator 38c27f2
Fixing whitespace in/around links
ycombinator 28d3bad
Trim messages before setting them
ycombinator 80d823c
Decorate in-app links with opt-out attribute
ycombinator 74dfc6c
Opt out of the Getting Started page if the user already has index pat…
ycombinator 11c1e9e
Adding more commentary around expectations of setTopMessage use
ycombinator bb1ba65
Using ng-src and ng-href attributes where attr values are angular exp…
ycombinator b8cf9bb
Importing the directive before using it
ycombinator 29a1fc3
Using ui/registry for message registries
ycombinator ab700ea
Renaming service => helpers to clarify intent
ycombinator f7bc721
Adding explanatory comment
ycombinator d442a82
Adding "or"
ycombinator ccc0694
Fixing div id
ycombinator a4fac82
Breaks out the inject logic into another directive
BigFunger ea7470c
Adding Getting Started page object for functional tests
ycombinator 7ef9805
Fixes incorrect classes
BigFunger 9eb07ac
Changes how styles are applied to injected-items items
BigFunger 41b9bbb
Consolidate into one registry
ycombinator 0e50bfa
Modifying class name per CSS style guide
ycombinator 348ce24
Adding getting started doc link
ycombinator 2ee7357
Removing unused import
ycombinator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default function (kibana) { | ||
|
||
return new kibana.Plugin({ | ||
uiExports: { | ||
managementSections: ['plugins/getting_started'] | ||
} | ||
}); | ||
} |
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,4 @@ | ||
{ | ||
"name": "getting_started", | ||
"version": "kibana" | ||
} |
179 changes: 179 additions & 0 deletions
179
src/core_plugins/getting_started/public/components/getting_started/getting_started.html
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,179 @@ | ||
<div class="kuiViewContent gettingStartedContent"> | ||
|
||
<div | ||
ng-if="!gettingStarted.hasOptedOut()" | ||
class="kuiBar gettingStartedOptOutContent" | ||
> | ||
<div class="kuiBarSection"> | ||
<p class="kuiText kuiSubduedText"> | ||
<a | ||
kbn-href="#/management" | ||
class="kuiLink" | ||
kbn-getting-started-opt-out | ||
data-test-subj="lnkGettingStartedOptOut" | ||
>I'm a pro, skip this stuff ></a> | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div class="kuiViewContentItem kuiVerticalRhythm gettingStartedWelcome"> | ||
<h1 class="kuiTitle gettingStartedTitle"> | ||
Welcome to Kibana | ||
</h1> | ||
</div> | ||
|
||
<div class="kuiViewContentItem kuiVerticalRhythm gettingStartedLogo"> | ||
<img | ||
ng-src="{{ gettingStarted.imageUrls.kibanaLogo }}" | ||
alt="Kibana logo" | ||
/> | ||
</div> | ||
|
||
<div class="kuiViewContentItem kuiVerticalRhythm"> | ||
<injected-items items="gettingStarted.topMessages"></injected-items> | ||
</div> | ||
|
||
<div class="kuiViewContentItem kuiVerticalRhythm"> | ||
<div class="kuiCardGroup kuiCardGroup"> | ||
<div class="kuiCard kuiCardGroup__card gettingStartedCard"> | ||
<div class="kuiCard__description"> | ||
<div class="kuiCard__descriptionTitle"> | ||
<h2 class="kuiSubTitle"> | ||
First, add your data | ||
</h2> | ||
</div> | ||
|
||
<div class="kuiCard__descriptionText gettingStartedCard__descriptionText"> | ||
<div class="gettingStartedLogoRow"> | ||
<img | ||
class="gettingStartedLogoRow__logo" | ||
ng-src="{{ gettingStarted.imageUrls.beatsLogo }}" | ||
alt="Beats logo" | ||
/> | ||
<img | ||
class="gettingStartedLogoRow__logo" | ||
ng-src="{{ gettingStarted.imageUrls.logstashLogo }}" | ||
alt="Logstash logo" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="kuiCard__footer"> | ||
<p class="kuiText"> | ||
Pull in data from the | ||
<a | ||
ng-href="{{ gettingStarted.documentationLinks.elasticsearch.docs }}" | ||
class="kuiLink" | ||
target="_blank" | ||
>Elasticsearch API</a>, | ||
<a | ||
ng-href="{{ gettingStarted.documentationLinks.beats.docs }}" | ||
class="kuiLink" | ||
target="_blank" | ||
>Beats</a>, or | ||
<a | ||
ng-href="{{ gettingStarted.documentationLinks.logstash.docs }}" | ||
class="kuiLink" | ||
target="_blank" | ||
>Logstash</a>. | ||
Not sure how to do that? | ||
<a | ||
ng-href="{{ gettingStarted.documentationLinks.gettingStarted }}" | ||
class="kuiLink" | ||
target="_blank" | ||
>Read this introduction.</a> | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div class="kuiCard kuiCardGroup__card gettingStartedCard"> | ||
<div class="kuiCard__description"> | ||
<div class="kuiCard__descriptionTitle"> | ||
<h2 class="kuiSubTitle"> | ||
Visualize and explore | ||
</h2> | ||
</div> | ||
|
||
<div class="kuiCard__descriptionText gettingStartedCard__descriptionText"> | ||
<div class="gettingStartedLogoRow"> | ||
<img | ||
class="gettingStartedLogoRow__logo" | ||
ng-src="{{ gettingStarted.imageUrls.dashboardIcon }}" | ||
alt="Dashboard icon" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="kuiCard__footer"> | ||
<p class="kuiText">Once you've added data, you'll need to | ||
<a | ||
href="#/management/kibana/index" | ||
class="kuiLink" | ||
kbn-getting-started-opt-out | ||
>configure an index pattern</a> | ||
for your data before using our Discover and Visualize applications.</p> | ||
</div> | ||
</div> | ||
|
||
<div | ||
class="kuiCard kuiCardGroup__card gettingStartedCard" | ||
ng-show="gettingStarted.hasManageAndMonitorMessages()" | ||
> | ||
<div class="kuiCard__description"> | ||
<div class="kuiCard__descriptionTitle"> | ||
<h2 class="kuiSubTitle"> | ||
Manage and monitor | ||
</h2> | ||
</div> | ||
|
||
<div class="kuiCard__descriptionText gettingStartedCard__descriptionText"> | ||
<div class="gettingStartedLogoRow"> | ||
<img | ||
class="gettingStartedLogoRow__logo" | ||
ng-src="{{ gettingStarted.imageUrls.shieldIcon }}" | ||
alt="Shield icon" | ||
/> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="kuiCard__footer"> | ||
<injected-items items="gettingStarted.manageAndMonitorMessages"></injected-items> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="kuiViewContentItem kuiVerticalRhythm"> | ||
<div class="kuiFieldGroup"> | ||
<div class="kuiFieldGroupSection"> | ||
<p class="kuiText">Just want to see what Kibana is capable of doing?</p> | ||
</div> | ||
|
||
<div class="kuiFieldGroupSection"> | ||
<a | ||
class="kuiButton kuiButton--primary" | ||
ng-href="{{ gettingStarted.documentationLinks.demoSite }}" | ||
target="_blank" | ||
> | ||
<span class="kuiButton__inner"> | ||
<span>View the demo site</span> | ||
</span> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="kuiViewContentItem kuiVerticalRhythm"> | ||
<p class="kuiText"> | ||
<a | ||
ng-href="{{ gettingStarted.documentationLinks.kibana.docs }}" | ||
class="kuiLink" | ||
target="_blank" | ||
>Kibana documentation</a> | ||
is always available to help. | ||
</p> | ||
</div> | ||
</div> |
65 changes: 65 additions & 0 deletions
65
src/core_plugins/getting_started/public/components/getting_started/getting_started.js
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,65 @@ | ||
import { uiModules } from 'ui/modules'; | ||
import uiChrome from 'ui/chrome'; | ||
import 'ui/getting_started/opt_out_directive'; | ||
import { GettingStartedRegistryProvider } from 'ui/getting_started/registry'; | ||
import { GETTING_STARTED_REGISTRY_TYPES } from 'ui/getting_started/constants'; | ||
import { hasOptedOutOfGettingStarted } from 'ui/getting_started/opt_out_helpers'; | ||
import { documentationLinks } from 'ui/documentation_links'; | ||
|
||
import kibanaLogo from 'ui/images/logo-kibana-small.svg'; | ||
import beatsLogo from 'ui/images/logo-beats-small.svg'; | ||
import logstashLogo from 'ui/images/logo-logstash-small.svg'; | ||
import dashboardIcon from 'ui/images/icon-dashboard.svg'; | ||
import shieldIcon from 'ui/images/icon-shield.svg'; | ||
|
||
import template from './getting_started.html'; | ||
import './getting_started.less'; | ||
import '../injected_items'; | ||
|
||
const app = uiModules.get('kibana'); | ||
|
||
app.directive('gettingStarted', function ($injector) { | ||
const Private = $injector.get('Private'); | ||
|
||
const registry = Private(GettingStartedRegistryProvider); | ||
|
||
return { | ||
restrict: 'E', | ||
template: template, | ||
scope: { | ||
}, | ||
bindToController: true, | ||
controllerAs: 'gettingStarted', | ||
controller: class GettingStartedController { | ||
constructor() { | ||
if (this.hasOptedOut()) { | ||
uiChrome.setVisible(true); | ||
} else { | ||
uiChrome.setVisible(false); | ||
} | ||
|
||
const registeredTopMessages = registry.byType[GETTING_STARTED_REGISTRY_TYPES.TOP_MESSAGE] || []; | ||
this.topMessages = registeredTopMessages.map(item => item.template); | ||
|
||
const registeredManageAndMonitorMessages = registry.byType[GETTING_STARTED_REGISTRY_TYPES.MANAGE_AND_MONITOR_MESSAGE] || []; | ||
this.manageAndMonitorMessages = registeredManageAndMonitorMessages.map(item => item.template); | ||
|
||
this.imageUrls = { | ||
kibanaLogo, | ||
beatsLogo, | ||
logstashLogo, | ||
dashboardIcon, | ||
shieldIcon | ||
}; | ||
|
||
this.documentationLinks = documentationLinks; | ||
} | ||
|
||
hasManageAndMonitorMessages = () => { | ||
return this.manageAndMonitorMessages.length > 0; | ||
} | ||
|
||
hasOptedOut = hasOptedOutOfGettingStarted; | ||
} | ||
}; | ||
}); |
65 changes: 65 additions & 0 deletions
65
src/core_plugins/getting_started/public/components/getting_started/getting_started.less
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,65 @@ | ||
.gettingStartedContent { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
padding-top: 0; | ||
} | ||
|
||
.gettingStartedOptOutContent { | ||
position: absolute; | ||
top: 20px; | ||
right: 30px; | ||
} | ||
|
||
.gettingStartedWelcome { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
height: 200px; | ||
width: 100%; | ||
background-color: #f7f7f7; | ||
} | ||
|
||
.gettingStartedTitle { | ||
transform: translateY(10px); | ||
} | ||
|
||
.gettingStartedLogo { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
|
||
border: 1px solid #D7DBDD; | ||
width: 100px; | ||
height: 100px; | ||
border-radius: 100%; | ||
|
||
background-color: #ffffff; | ||
|
||
transform: translateY(-60px); | ||
} | ||
|
||
.gettingStartedLogoRow { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: center; | ||
} | ||
|
||
.gettingStartedLogoRow__logo { | ||
height: 80px; | ||
|
||
& + & { | ||
margin-left: 40px; | ||
} | ||
} | ||
|
||
.gettingStartedCard__descriptionText { | ||
margin-top: 32px; | ||
margin-bottom: 32px; | ||
} | ||
|
||
.gettingStartedCard { | ||
width: 340px; | ||
} |
1 change: 1 addition & 0 deletions
1
src/core_plugins/getting_started/public/components/getting_started/index.js
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 @@ | ||
import './getting_started'; |
1 change: 1 addition & 0 deletions
1
src/core_plugins/getting_started/public/components/injected_items/index.js
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 @@ | ||
import './injected_items'; |
1 change: 1 addition & 0 deletions
1
src/core_plugins/getting_started/public/components/injected_items/injected_items.html
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 @@ | ||
<div></div> |
38 changes: 38 additions & 0 deletions
38
src/core_plugins/getting_started/public/components/injected_items/injected_items.js
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,38 @@ | ||
import { isArray } from 'lodash'; | ||
import { uiModules } from 'ui/modules'; | ||
import angular from 'angular'; | ||
|
||
import template from './injected_items.html'; | ||
import './injected_items.less'; | ||
|
||
function makeAngularParseableExpression(item) { | ||
return `<div class="injectedItems__item">${item} </div>`; | ||
} | ||
|
||
const app = uiModules.get('kibana'); | ||
|
||
app.directive('injectedItems', function ($injector) { | ||
const $compile = $injector.get('$compile'); | ||
|
||
return { | ||
restrict: 'E', | ||
replace: true, | ||
template: template, | ||
scope: { | ||
items: '=' | ||
}, | ||
link: ($scope, $el) => { | ||
const items = $scope.items; | ||
|
||
if (isArray(items) && items.length > 0) { | ||
items.forEach(item => { | ||
// Compile itemHtml with current $scope and append it into the container DOM element. | ||
// We do this because we want to dynamically inject content (strings) into the DOM. This content | ||
// may contain Angular directives so it must first be $compiled with the current $scope. | ||
const itemHtml = $compile(makeAngularParseableExpression(item))($scope); | ||
angular.element($el).append(itemHtml); | ||
}); | ||
} | ||
} | ||
}; | ||
}); |
3 changes: 3 additions & 0 deletions
3
src/core_plugins/getting_started/public/components/injected_items/injected_items.less
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,3 @@ | ||
.injectedItems__item { | ||
display: inline; | ||
} |
1 change: 1 addition & 0 deletions
1
src/core_plugins/getting_started/public/getting_started_route.html
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 @@ | ||
<getting-started></getting-started> |
14 changes: 14 additions & 0 deletions
14
src/core_plugins/getting_started/public/getting_started_route.js
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,14 @@ | ||
import routes from 'ui/routes'; | ||
import template from './getting_started_route.html'; | ||
import './components/getting_started'; | ||
import { GETTING_STARTED_ROUTE } from './lib/constants'; | ||
|
||
routes | ||
.when(GETTING_STARTED_ROUTE, { | ||
template: template, | ||
controllerAs: 'gettingStartedRoute', | ||
controller: class GettingStartedRouteController { | ||
constructor() { | ||
} | ||
} | ||
}); |
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,3 @@ | ||
import './lib/add_setup_work'; | ||
import './lib/register_management_section'; | ||
import './getting_started_route'; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It seems weird to drop a user in Management, where there's really nothing clear to do or read. Wouldn't we still want to funnel them to the index-pattern creation UI?
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.
That was the direction I got from @skearns64 and @tbragin. I think the thinking is that users may want to opt out because they want to do other things in the Management area that are not index pattern creation. But I could be remembering that wrong -- Steve, Tanya?