Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render: function() {
var image = this.props.image,
type = stores.ProfileStore.get().get("icon_set"),
imageTags = stores.TagStore.getImageTags(image),
imageCreationDate = moment(image.get("start_date"))
.tz(globals.TZ_REGION)
.format("MMM Do YYYY hh:mm a z"),
hasLoggedInUser = context.hasLoggedInUser(),
iconSize = 45,
icon;
// always use the Gravatar icons
icon = (
);
// Hide bookmarking on the public page
var bookmark;
let endDated;
if (this.props.isEndDated) {
endDated = (
<div style="{{"></div>
// metric = imageMetric.get('metrics');
// if (metric) {
// seriesData = this.getChartData(image, metric);
// labels = this.getLabels(metric);
// if (labels.length > 0) {
// graphDiv = ();
// }
// }
// }
// }
let imageCreationDate = moment(image.get("start_date"))
.tz(globals.TZ_REGION)
.format("MMM Do YY hh:mm ");
let converter = new Showdown.Converter();
let description = image.get("description");
if (!description) {
description = "No Description Provided.";
} else if (description.length > 90) {
description = description.substring(0, 90) + " ...";
}
let name = image.get("name");
if (name.length > 30) {
name = name.substring(0, 30) + " ...";
}
render: function() {
var image = this.props.image,
endDate = moment(image.get("end_date"));
if (endDate.isValid()) {
let formatDate = endDate
.tz(globals.TZ_REGION)
.format("M/DD/YYYY hh:mm a z");
endDate = formatDate;
} else {
// Hide this from view when end date isn't available
// Based on API permissions, this means only STAFF
// and ImageOwners will see this view.
return <div>;
}
return (
<div>
<h4>Removed:</h4>
<p>{endDate}</p>
</div>
);
}</div>
renderDateCreated: function(project) {
var start_date = project
.get("start_date")
.tz(globals.TZ_REGION)
.format("MMM Do YYYY hh:mm a z");
return (
<div>
<h4>Created</h4>
<p>{start_date}</p>
</div>
);
},
setEndDateNow: function(e) {
var now_time = moment(new Date()),
new_value = now_time
.tz(globals.TZ_REGION)
.format("M/DD/YYYY hh:mm a z");
this.setState({
value: new_value
});
if (this.props.onChange != null) {
this.props.onChange(new_value);
}
},
renderDateString(version) {
let date_str;
let dateCreated = moment(version.get("start_date"))
.tz(globals.TZ_REGION)
.format("MMM Do YY, hh:mm");
if (version.get("end_date")) {
let dateArchived = moment(version.get("end_date"))
.tz(globals.TZ_REGION)
.format("MMM Do YY, hh:mm");
date_str = dateCreated + " - " + dateArchived;
} else {
date_str = dateCreated;
}
return date_str;
},
renderDateString(version) {
let date_str;
let dateCreated = moment(version.get("start_date"))
.tz(globals.TZ_REGION)
.format("MMM Do YY, hh:mm");
if (version.get("end_date")) {
let dateArchived = moment(version.get("end_date"))
.tz(globals.TZ_REGION)
.format("MMM Do YY, hh:mm");
date_str = dateCreated + " - " + dateArchived;
} else {
date_str = dateCreated;
}
return date_str;
},
getInitialState: function() {
var image = this.props.image,
endDate = image.isEndDated()
? image
.get("end_date")
.tz(globals.TZ_REGION)
.format("M/DD/YYYY hh:mm a z")
: "";
var imageTags = stores.TagStore.getImageTags(image);
var imageAccessList = stores.PatternMatchStore.getImageAccess(image);
return {
name: image.get("name"),
description: image.get("description"),
is_public: image.get("is_public"),
accessList: imageAccessList,
endDate: endDate,
tags: imageTags
};
},