Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AmendsenProject
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shaik Janipasha
AmendsenProject
Commits
92f9dca1
Unverified
Commit
92f9dca1
authored
Apr 29, 2019
by
Daniel
Committed by
GitHub
Apr 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix navbar and footer state bugs (#112)
* Fix navbar and footer state bugs
parent
805d5b48
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
24 deletions
+7
-24
index.tsx
amundsen_application/static/js/components/Footer/index.tsx
+4
-12
index.tsx
amundsen_application/static/js/components/NavBar/index.tsx
+3
-12
No files found.
amundsen_application/static/js/components/Footer/index.tsx
View file @
92f9dca1
...
@@ -19,17 +19,9 @@ interface DispatchFromProps {
...
@@ -19,17 +19,9 @@ interface DispatchFromProps {
export
type
FooterProps
=
StateFromProps
&
DispatchFromProps
;
export
type
FooterProps
=
StateFromProps
&
DispatchFromProps
;
interface
FooterState
{
export
class
Footer
extends
React
.
Component
<
FooterProps
>
{
lastIndexed
:
number
;
}
export
class
Footer
extends
React
.
Component
<
FooterProps
,
FooterState
>
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
lastIndexed
:
this
.
props
.
lastIndexed
,
};
}
}
componentDidMount
()
{
componentDidMount
()
{
...
@@ -38,12 +30,12 @@ export class Footer extends React.Component<FooterProps, FooterState> {
...
@@ -38,12 +30,12 @@ export class Footer extends React.Component<FooterProps, FooterState> {
generateDateTimeString
=
()
=>
{
generateDateTimeString
=
()
=>
{
// 'moment.local' will utilize the client's local timezone.
// 'moment.local' will utilize the client's local timezone.
return
moment
.
unix
(
this
.
state
.
lastIndexed
).
local
().
format
(
'MMMM Do YYYY [at] h:mm:ss a'
);
return
moment
.
unix
(
this
.
props
.
lastIndexed
).
local
().
format
(
'MMMM Do YYYY [at] h:mm:ss a'
);
}
}
;
render
()
{
render
()
{
let
content
;
let
content
;
if
(
this
.
state
.
lastIndexed
!==
null
)
{
if
(
this
.
props
.
lastIndexed
!==
null
)
{
content
=
<
div
>
{
`Amundsen was last indexed on ${this.generateDateTimeString()}`
}
</
div
>;
content
=
<
div
>
{
`Amundsen was last indexed on ${this.generateDateTimeString()}`
}
</
div
>;
}
}
return
(
return
(
...
...
amundsen_application/static/js/components/NavBar/index.tsx
View file @
92f9dca1
...
@@ -24,18 +24,9 @@ interface DispatchFromProps {
...
@@ -24,18 +24,9 @@ interface DispatchFromProps {
export
type
NavBarProps
=
StateFromProps
&
DispatchFromProps
;
export
type
NavBarProps
=
StateFromProps
&
DispatchFromProps
;
// State
export
class
NavBar
extends
React
.
Component
<
NavBarProps
>
{
interface
NavBarState
{
loggedInUser
:
LoggedInUser
;
}
export
class
NavBar
extends
React
.
Component
<
NavBarProps
,
NavBarState
>
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
loggedInUser
:
this
.
props
.
loggedInUser
,
};
}
}
componentDidMount
()
{
componentDidMount
()
{
...
@@ -69,9 +60,9 @@ export class NavBar extends React.Component<NavBarProps, NavBarState> {
...
@@ -69,9 +60,9 @@ export class NavBar extends React.Component<NavBarProps, NavBarState> {
{
this
.
generateNavLinks
(
AppConfig
.
navLinks
)
}
{
this
.
generateNavLinks
(
AppConfig
.
navLinks
)
}
{
{
// TODO PEOPLE - Add link to user profile
// TODO PEOPLE - Add link to user profile
this
.
state
.
loggedInUser
&&
this
.
props
.
loggedInUser
&&
<
div
id=
"nav-bar-avatar"
>
<
div
id=
"nav-bar-avatar"
>
<
Avatar
name=
{
this
.
state
.
loggedInUser
.
display_name
}
size=
{
32
}
round=
{
true
}
/>
<
Avatar
name=
{
this
.
props
.
loggedInUser
.
display_name
}
size=
{
32
}
round=
{
true
}
/>
</
div
>
</
div
>
}
}
</
div
>
</
div
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment