forked from jaegertracing/jaeger-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Timeline Expand and Collapse Features (jaegertracing#221)
* Add expansion and collapsing features Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Use Icon component Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Use spans upstream Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Improve css Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Rotate collapse buttons Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Remove debug logging Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Remove spans from TimelineHeaderRow Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Add unit test for TimelineCollapser Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Use popover Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Add TimelineCollapser test Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Revert "Use popover" This reverts commit 6152402 Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Add tests for duck.js Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Add more tests for duck.js Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Add more tests for index.js Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Add keyboard shortcuts Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Update changelog Signed-off-by: Davit Yeghshatyan <davo@uber.com> * Make review changes Signed-off-by: Davit Yeghshatyan <davo@uber.com> Signed-off-by: vvvprabhakar <vvvprabhakar@gmail.com>
- Loading branch information
Showing
15 changed files
with
460 additions
and
48 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
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
30 changes: 30 additions & 0 deletions
30
...r-ui/src/components/TracePage/TraceTimelineViewer/TimelineHeaderRow/TimelineCollapser.css
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,30 @@ | ||
/* | ||
Copyright (c) 2017 Uber Technologies, Inc. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
.TimelineCollapser { | ||
float: right; | ||
margin: 0 0.8rem 0 0; | ||
display: inline-block; | ||
} | ||
|
||
.TimelineCollapser--btn, | ||
.TimelineCollapser--btn-expand { | ||
margin-right: 0.3rem; | ||
} | ||
|
||
.TimelineCollapser--btn-expand { | ||
transform: rotate(90deg); | ||
} |
48 changes: 48 additions & 0 deletions
48
...er-ui/src/components/TracePage/TraceTimelineViewer/TimelineHeaderRow/TimelineCollapser.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,48 @@ | ||
// @flow | ||
|
||
// Copyright (c) 2017 Uber Technologies, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import React from 'react'; | ||
|
||
import { Tooltip, Icon } from 'antd'; | ||
|
||
import './TimelineCollapser.css'; | ||
|
||
type CollapserProps = { | ||
onCollapseAll: () => void, | ||
onCollapseOne: () => void, | ||
onExpandOne: () => void, | ||
onExpandAll: () => void, | ||
}; | ||
|
||
export default function TimelineCollapser(props: CollapserProps) { | ||
const { onExpandAll, onExpandOne, onCollapseAll, onCollapseOne } = props; | ||
return ( | ||
<span className="TimelineCollapser"> | ||
<Tooltip title="Expand +1"> | ||
<Icon type="right" onClick={onExpandOne} className="TimelineCollapser--btn-expand" /> | ||
</Tooltip> | ||
<Tooltip title="Collapse +1"> | ||
<Icon type="right" onClick={onCollapseOne} className="TimelineCollapser--btn" /> | ||
</Tooltip> | ||
<Tooltip title="Expand All"> | ||
<Icon type="double-right" onClick={onExpandAll} className="TimelineCollapser--btn-expand" /> | ||
</Tooltip> | ||
<Tooltip title="Collapse All"> | ||
<Icon type="double-right" onClick={onCollapseAll} className="TimelineCollapser--btn" /> | ||
</Tooltip> | ||
</span> | ||
); | ||
} |
32 changes: 32 additions & 0 deletions
32
.../src/components/TracePage/TraceTimelineViewer/TimelineHeaderRow/TimelineCollapser.test.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,32 @@ | ||
// Copyright (c) 2017 Uber Technologies, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
|
||
import TimelineCollapser from './TimelineCollapser'; | ||
|
||
describe('<TimelineCollapser>', () => { | ||
it('renders without exploding', () => { | ||
const props = { | ||
onCollapseAll: () => {}, | ||
onCollapseOne: () => {}, | ||
onExpandAll: () => {}, | ||
onExpandOne: () => {}, | ||
}; | ||
const wrapper = shallow(<TimelineCollapser {...props} />); | ||
expect(wrapper).toBeDefined(); | ||
expect(wrapper.find('.TimelineCollapser').length).toBe(1); | ||
}); | ||
}); |
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
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
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
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
Oops, something went wrong.