-
Notifications
You must be signed in to change notification settings - Fork 69
feat: add report creation date #214
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,10 +14,12 @@ class Summary extends Component { | |
| failed: PropTypes.number.isRequired, | ||
| skipped: PropTypes.number.isRequired, | ||
| retries: PropTypes.number.isRequired | ||
| }) | ||
| }), | ||
| date: PropTypes.string.isRequired | ||
| } | ||
|
|
||
| render() { | ||
| const {date} = this.props; | ||
| const {total, passed, failed, skipped, retries} = this.props.stats; | ||
|
|
||
| return ( | ||
|
|
@@ -27,18 +29,20 @@ class Summary extends Component { | |
| <SummaryKey label="Failed" value={failed} isFailed={true}/> | ||
| <SummaryKey label="Skipped" value={skipped}/> | ||
| <SummaryKey label="Retries" value={retries}/> | ||
| <div className='summary__date'>created at {date}</div> | ||
| </dl> | ||
| ); | ||
| } | ||
| } | ||
|
|
||
| export default connect( | ||
| (state) => { | ||
| const {stats} = state; | ||
| const {stats, date} = state; | ||
| const {filteredBrowsers} = state.view; | ||
| const statsToShow = getStats(stats, filteredBrowsers); | ||
|
|
||
| return { | ||
| stats: statsToShow | ||
| stats: statsToShow, | ||
| date | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. я бы одной строкой выводил, тут же всего 2 поля |
||
| }; | ||
| })(Summary); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| 'use strict'; | ||
|
|
||
| const {forOwn, pick, isArray, find, get, values} = require('lodash'); | ||
| const {forOwn, pick, isArray, find, get, values, isEmpty} = require('lodash'); | ||
| const {isFailStatus, isErroredStatus, isSkippedStatus, determineStatus} = require('../../common-utils'); | ||
| const {getCommonErrors} = require('../../constants/errors'); | ||
|
|
||
|
|
@@ -154,6 +154,14 @@ function getStats(stats, filteredBrowsers) { | |
| return resStats; | ||
| } | ||
|
|
||
| function dateToLocaleString(date) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. кажется, ты здесь немного упоролся - давай просто время с AM/PM оставим и все
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Проблема в основном с положением месяцев относительно дней. Нашим пользователям, полагаю, будет удобнее DD.MM.YYYY, а по дефолту MM/DD/YYYY. new Date().toLocaleString() new Date().toLocaleString('en-US') new Date().toLocaleString('en-GB') new Date().toLocaleString('ru')
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. а мне все таки нравится. Я постоянно забываю PM это утро или вечер. Плюс неудобно читать, что дата вторым значением указана. Го голосовать ;)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
рукалицо
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. кулакподбородок |
||
| if (!date) { | ||
| return ''; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. а в каком случае мы можем в это условие попасть? Кажется его выгасить можно
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. если в gui режиме |
||
| } | ||
| const lang = isEmpty(navigator.languages) ? navigator.language : navigator.languages[0]; | ||
| return new Date(date).toLocaleString(lang); | ||
| } | ||
|
|
||
| module.exports = { | ||
| hasNoRefImageErrors, | ||
| hasFails, | ||
|
|
@@ -166,5 +174,6 @@ module.exports = { | |
| setStatusForBranch, | ||
| shouldSuiteBeShownByName, | ||
| shouldSuiteBeShownByBrowser, | ||
| getStats | ||
| getStats, | ||
| dateToLocaleString | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -589,3 +589,8 @@ a:active { | |
| opacity: 0.3; | ||
| background-color: #FF00FF; | ||
| } | ||
|
|
||
| .summary__date { | ||
| float: right; | ||
| color: gray; | ||
| } | ||
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.
почему оно обязательное то?
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.
просто потому, что мы контролируем это в dateToLocaleString