Commit ff0c90e4 authored by Juan Manuel Solaro's avatar Juan Manuel Solaro

(fix) adapt code to reviews

1 merge request!494WIP: epic/post-scheduler
Pipeline #77146232 passed with stages
in 36 minutes and 29 seconds
......@@ -112,7 +112,7 @@
(validThreshold)="validThreshold = $event"
#thresholdInput
></m-wire-threshold-input>
<m-poster-date-selector [date]="time_created" (dateChange)="onTimeCreatedChange($event)"></m-poster-date-selector>
<m-poster-date-selector [date]="blog.time_created" (dateChange)="onTimeCreatedChange($event)"></m-poster-date-selector>
</div>
<div class="mdl-cell mdl-cell--12-col m-blog-edit--metadata mdl-color-text--blue-grey-200" *ngIf="blog.custom_meta">
......
......@@ -32,7 +32,7 @@ export class BlogEdit {
guid: 'new',
title: '',
description: '<p><br></p>',
time_created: Date.now(),
time_created: Math.floor(+Date.now() / 1000),
access_id: 2,
tags: [],
license: 'attribution-sharealike-cc',
......@@ -202,7 +202,7 @@ export class BlogEdit {
if (!this.blog.license)
this.blog.license = '';
this.time_created = response.blog.time_created || Math.floor(+Date.now() / 1000);
this.blog.time_created = response.blog.time_created || Math.floor(+Date.now() / 1000);
}
});
}
......@@ -248,7 +248,7 @@ export class BlogEdit {
blog.mature = blog.mature ? 1: 0;
blog.monetization = blog.monetization ? 1: 0;
blog.monetized = blog.monetized ? 1: 0;
blog.time_created = this.time_created || Math.floor(+Date.now() / 1000);
blog.time_created = blog.time_created || Math.floor(+Date.now() / 1000);
this.editing = false;
this.inProgress = true;
......@@ -258,7 +258,7 @@ export class BlogEdit {
.then((response: any) => {
this.inProgress = false;
this.canSave = true;
this.time_created = null;
this.blog.time_created = null;
if (response.status !== 'success') {
this.error = response.message;
......@@ -332,6 +332,6 @@ export class BlogEdit {
}
onTimeCreatedChange(newDate){
this.time_created = newDate;
this.blog.time_created = newDate;
}
}
......@@ -119,7 +119,7 @@
</ng-container>
<m-wire-threshold-input [(threshold)]="activity.wire_threshold" [(enabled)]="activity.paywall"></m-wire-threshold-input>
<m-poster-date-selector [date]="time_created" (dateChange)="onTimeCreatedChange($event)"></m-poster-date-selector>
<m-poster-date-selector [date]="activity.time_created" (dateChange)="onTimeCreatedChange($event)"></m-poster-date-selector>
<button class="mdl-button mdl-button--raised mdl-color--blue-grey-100" (click)="messageEdit.value = activity.message; editing=false;" i18n="@@M__ACTION__CANCEL">Cancel</button>
<button class="mdl-button mdl-button--colored mdl-button--raised" (click)="activity.message = messageEdit.value; save();" i18n="@@M__ACTION__SAVE">Save</button>
</div>
......
......@@ -173,7 +173,7 @@ export class Activity implements OnInit {
(this.activity.remind_object && this.translationService.isTranslatable(this.activity.remind_object))
);
this.time_created = this.activity.time_created || Date.now();
this.activity.time_created = this.activity.time_created || Math.floor(+Date.now() / 1000);
}
getOwnerIconTime() {
......@@ -195,7 +195,7 @@ export class Activity implements OnInit {
console.log('trying to save your changes to the server', this.activity);
this.editing = false;
this.activity.edited = true;
this.activity.time_created = this.time_created || Math.floor(+Date.now() / 1000);
this.activity.time_created = this.activity.time_created || Math.floor(+Date.now() / 1000);
let data = this.activity;
if (this.attachment.has()) {
......@@ -443,6 +443,6 @@ export class Activity implements OnInit {
}
onTimeCreatedChange(newDate){
this.time_created = newDate;
this.activity.time_created = newDate;
}
}
......@@ -84,7 +84,7 @@
(validThreshold)="validThreshold = $event"
></m-wire-threshold-input>
<m-poster-date-selector [date]="time_created" (dateChange)="onTimeCreatedChange($event)"></m-poster-date-selector>
<m-poster-date-selector [date]="meta.time_created" (dateChange)="onTimeCreatedChange($event)"></m-poster-date-selector>
<button
type="submit"
......
......@@ -27,7 +27,8 @@ export class PosterComponent {
content = '';
meta: any = {
message : '',
wire_threshold: null
wire_threshold: null,
time_created: Math.floor(+Date.now() / 1000)
};
tags = [];
minds = window.Minds;
......@@ -171,7 +172,7 @@ export class PosterComponent {
return;
}
this.meta.time_created = this.time_created || Math.floor(+Date.now() / 1000);
this.meta.time_created = this.meta.time_created || Math.floor(+Date.now() / 1000);
this.errorMessage = "";
......@@ -279,6 +280,6 @@ export class PosterComponent {
}
onTimeCreatedChange(newDate){
this.time_created = newDate;
this.meta.time_created = newDate;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment