forked from tektoncd/dashboard
-
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.
Add created time column on all resource list pages
- Add column showing creationTimestamp on all list views - Add column showing duration on PipelineRuns and TaskRuns views - `now - creationTimestamp` for in progress runs - `lastUpdate - creationTimestamp` for completed runs
- Loading branch information
1 parent
256137d
commit 08ab6e6
Showing
22 changed files
with
269 additions
and
65 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
50 changes: 50 additions & 0 deletions
50
packages/components/src/components/FormattedDuration/FormattedDuration.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,50 @@ | ||
/* | ||
Copyright 2019-2020 The Tekton Authors | ||
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 { defineMessages } from 'react-intl'; | ||
import FormattedDuration from 'react-intl-formatted-duration'; | ||
|
||
defineMessages({ | ||
duration: { | ||
id: 'react-intl-formatted-duration.duration', | ||
defaultMessage: '{value} {unit}' | ||
}, | ||
daysUnit: { | ||
id: 'react-intl-formatted-duration.daysUnit', | ||
defaultMessage: '{value, plural, one {day} other {days}}' | ||
}, | ||
hoursUnit: { | ||
id: 'react-intl-formatted-duration.hoursUnit', | ||
defaultMessage: '{value, plural, one {hour} other {hours}}' | ||
}, | ||
minutesUnit: { | ||
id: 'react-intl-formatted-duration.minutesUnit', | ||
defaultMessage: '{value, plural, one {minute} other {minutes}}' | ||
}, | ||
secondsUnit: { | ||
id: 'react-intl-formatted-duration.secondsUnit', | ||
defaultMessage: '{value, plural, one {second} other {seconds}}' | ||
} | ||
}); | ||
|
||
const FormattedDurationWrapper = ({ milliseconds }) => { | ||
return ( | ||
<FormattedDuration | ||
seconds={milliseconds / 1000} | ||
format="{days} {hours} {minutes} {seconds}" | ||
/> | ||
); | ||
}; | ||
|
||
export default FormattedDurationWrapper; |
30 changes: 30 additions & 0 deletions
30
packages/components/src/components/FormattedDuration/FormattedDuration.stories.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,30 @@ | ||
/* | ||
Copyright 2019-2020 The Tekton Authors | ||
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 { storiesOf } from '@storybook/react'; | ||
import { number } from '@storybook/addon-knobs'; | ||
|
||
import FormattedDuration from './FormattedDuration'; | ||
|
||
storiesOf('FormattedDuration', module) | ||
.add('1 second', () => <FormattedDuration milliseconds={1000} />) | ||
.add('1 minute 1 second', () => <FormattedDuration milliseconds={61000} />) | ||
.add('other', () => ( | ||
<FormattedDuration | ||
milliseconds={number( | ||
'milliseconds', | ||
2 * 60 * 60 * 1000 + 1 * 60 * 1000 + 10 * 1000 // 2h 1m 10s | ||
)} | ||
/> | ||
)); |
14 changes: 14 additions & 0 deletions
14
packages/components/src/components/FormattedDuration/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,14 @@ | ||
/* | ||
Copyright 2019-2020 The Tekton Authors | ||
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. | ||
*/ | ||
|
||
export { default } from './FormattedDuration'; |
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.