mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +01:00 
			
		
		
		
	fix: add created date for applications
This commit is contained in:
		
							parent
							
								
									31398571b4
								
							
						
					
					
						commit
						82c67aba30
					
				| @ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). | |||||||
| The latest version of this document is always available in | The latest version of this document is always available in | ||||||
| [releases][releases-url]. | [releases][releases-url]. | ||||||
| 
 | 
 | ||||||
|  | # 3.6.2 | ||||||
|  | - fix: show notification when app updates | ||||||
|  | 
 | ||||||
| # 3.6.1 | # 3.6.1 | ||||||
| - fix: minor css tweaks for mobile | - fix: minor css tweaks for mobile | ||||||
| - fix: should support 409 responses as well | - fix: should support 409 responses as well | ||||||
|  | |||||||
| @ -31,8 +31,22 @@ exports[`renders correctly with permissions 1`] = ` | |||||||
|       |       | ||||||
|     test-app |     test-app | ||||||
|   </react-mdl-CardTitle> |   </react-mdl-CardTitle> | ||||||
|   <react-mdl-CardText> |   <react-mdl-CardText | ||||||
|     app description |     style={ | ||||||
|  |       Object { | ||||||
|  |         "paddingTop": "0", | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   > | ||||||
|  |     <p> | ||||||
|  |       app description | ||||||
|  |     </p> | ||||||
|  |     <p> | ||||||
|  |       Created:  | ||||||
|  |       <strong> | ||||||
|  |         Invalid Date | ||||||
|  |       </strong> | ||||||
|  |     </p> | ||||||
|   </react-mdl-CardText> |   </react-mdl-CardText> | ||||||
|   <react-mdl-CardMenu> |   <react-mdl-CardMenu> | ||||||
|     <a |     <a | ||||||
| @ -243,8 +257,22 @@ exports[`renders correctly without permission 1`] = ` | |||||||
|       |       | ||||||
|     test-app |     test-app | ||||||
|   </react-mdl-CardTitle> |   </react-mdl-CardTitle> | ||||||
|   <react-mdl-CardText> |   <react-mdl-CardText | ||||||
|     app description |     style={ | ||||||
|  |       Object { | ||||||
|  |         "paddingTop": "0", | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   > | ||||||
|  |     <p> | ||||||
|  |       app description | ||||||
|  |     </p> | ||||||
|  |     <p> | ||||||
|  |       Created:  | ||||||
|  |       <strong> | ||||||
|  |         Invalid Date | ||||||
|  |       </strong> | ||||||
|  |     </p> | ||||||
|   </react-mdl-CardText> |   </react-mdl-CardText> | ||||||
|   <react-mdl-CardMenu> |   <react-mdl-CardMenu> | ||||||
|     <a |     <a | ||||||
|  | |||||||
| @ -4,7 +4,7 @@ import PropTypes from 'prop-types'; | |||||||
| 
 | 
 | ||||||
| import { Button, Card, CardActions, CardTitle, CardText, CardMenu, Icon, ProgressBar, Tabs, Tab } from 'react-mdl'; | import { Button, Card, CardActions, CardTitle, CardText, CardMenu, Icon, ProgressBar, Tabs, Tab } from 'react-mdl'; | ||||||
| import { IconLink, styles as commonStyles } from '../common'; | import { IconLink, styles as commonStyles } from '../common'; | ||||||
| import { formatFullDateTimeWithLocale } from '../common/util'; | import { formatFullDateTimeWithLocale, formatDateWithLocale } from '../common/util'; | ||||||
| import { UPDATE_APPLICATION } from '../../permissions'; | import { UPDATE_APPLICATION } from '../../permissions'; | ||||||
| import ApplicationView from './application-view'; | import ApplicationView from './application-view'; | ||||||
| import ApplicationUpdate from './application-update'; | import ApplicationUpdate from './application-update'; | ||||||
| @ -30,6 +30,7 @@ class ClientApplications extends PureComponent { | |||||||
|         this.props.fetchApplication(this.props.appName).finally(() => this.setState({ loading: false })); |         this.props.fetchApplication(this.props.appName).finally(() => this.setState({ loading: false })); | ||||||
|     } |     } | ||||||
|     formatFullDateTime = v => formatFullDateTimeWithLocale(v, this.props.location.locale); |     formatFullDateTime = v => formatFullDateTimeWithLocale(v, this.props.location.locale); | ||||||
|  |     formatDate = v => formatDateWithLocale(v, this.props.location.locale); | ||||||
| 
 | 
 | ||||||
|     deleteApplication = async evt => { |     deleteApplication = async evt => { | ||||||
|         evt.preventDefault(); |         evt.preventDefault(); | ||||||
| @ -50,7 +51,7 @@ class ClientApplications extends PureComponent { | |||||||
|             return <p>Application ({this.props.appName}) not found</p>; |             return <p>Application ({this.props.appName}) not found</p>; | ||||||
|         } |         } | ||||||
|         const { application, storeApplicationMetaData, hasPermission } = this.props; |         const { application, storeApplicationMetaData, hasPermission } = this.props; | ||||||
|         const { appName, instances, strategies, seenToggles, url, description, icon = 'apps' } = application; |         const { appName, instances, strategies, seenToggles, url, description, icon = 'apps', createdAt } = application; | ||||||
| 
 | 
 | ||||||
|         const content = |         const content = | ||||||
|             this.state.activeTab === 0 ? ( |             this.state.activeTab === 0 ? ( | ||||||
| @ -71,7 +72,12 @@ class ClientApplications extends PureComponent { | |||||||
|                     <Icon name={icon || 'apps'} /> |                     <Icon name={icon || 'apps'} /> | ||||||
|                      {appName} |                      {appName} | ||||||
|                 </CardTitle> |                 </CardTitle> | ||||||
|                 {description && <CardText>{description}</CardText>} |                 <CardText style={{ paddingTop: '0' }}> | ||||||
|  |                     <p>{description || ''}</p> | ||||||
|  |                     <p> | ||||||
|  |                         Created: <strong>{this.formatDate(createdAt)}</strong> | ||||||
|  |                     </p> | ||||||
|  |                 </CardText> | ||||||
|                 {url && ( |                 {url && ( | ||||||
|                     <CardMenu> |                     <CardMenu> | ||||||
|                         <IconLink url={url} icon="link" /> |                         <IconLink url={url} icon="link" /> | ||||||
|  | |||||||
| @ -8,6 +8,13 @@ const dateTimeOptions = { | |||||||
|     minute: '2-digit', |     minute: '2-digit', | ||||||
|     second: '2-digit', |     second: '2-digit', | ||||||
| }; | }; | ||||||
|  | 
 | ||||||
|  | const dateOptions = { | ||||||
|  |     day: '2-digit', | ||||||
|  |     month: '2-digit', | ||||||
|  |     year: 'numeric', | ||||||
|  | }; | ||||||
|  | 
 | ||||||
| export const formatFullDateTimeWithLocale = (v, locale, tz) => { | export const formatFullDateTimeWithLocale = (v, locale, tz) => { | ||||||
|     if (tz) { |     if (tz) { | ||||||
|         dateTimeOptions.timeZone = tz; |         dateTimeOptions.timeZone = tz; | ||||||
| @ -15,6 +22,13 @@ export const formatFullDateTimeWithLocale = (v, locale, tz) => { | |||||||
|     return new Date(v).toLocaleString(locale, dateTimeOptions); |     return new Date(v).toLocaleString(locale, dateTimeOptions); | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
|  | export const formatDateWithLocale = (v, locale, tz) => { | ||||||
|  |     if (tz) { | ||||||
|  |         dateTimeOptions.timeZone = tz; | ||||||
|  |     } | ||||||
|  |     return new Date(v).toLocaleString(locale, dateOptions); | ||||||
|  | }; | ||||||
|  | 
 | ||||||
| export const trim = value => { | export const trim = value => { | ||||||
|     if (value && value.trim) { |     if (value && value.trim) { | ||||||
|         return value.trim(); |         return value.trim(); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user