Commit dde8fef4 authored by Ben Hayward's avatar Ben Hayward

Updated hashtag error to show on editing too many hashtags

1 merge request!436[Sprint/InterestingIguana](feat) Show error on hashtag limit when editing post #867
Pipeline #70188627 running with stages
......@@ -50,7 +50,6 @@
</div>
</a>
</div>
</div>
<div class="mdl-card mdl-color--red-500 mdl-color-text--blue-grey-50 mdl-shadow--2dp" style="min-height:0;" *ngIf="errorString && editing">
......
......@@ -45,7 +45,6 @@ export class Activity implements OnInit {
minds = window.Minds;
activity: any;
errorString : string = '';
boosted: boolean = false;
commentsToggle: boolean = false;
shareToggle: boolean = false;
......@@ -57,21 +56,22 @@ export class Activity implements OnInit {
@Input('boost-toggle')
@Input() showBoostMenuOptions: boolean = false;
@Input() slot: number = -1;
visibilityEvents: boolean = true;
@Input('visibilityEvents') set _visibilityEvents(visibilityEvents: boolean) {
this.visibilityEvents = visibilityEvents;
if (this.activityAnalyticsOnViewService) {
this.activityAnalyticsOnViewService
.setEnabled(this.visibilityEvents);
.setEnabled(this.visibilityEvents);
}
}
type: string;
element: any;
visible: boolean = false;
errorString : string = '';
editing: boolean = false;
@Input() hideTabs: boolean;
......@@ -156,7 +156,7 @@ export class Activity implements OnInit {
) {
this.activity.custom_data[0].src = this.activity.custom_data[0].src.replace(this.minds.site_url, this.minds.cdn_url);
}
if (!this.activity.message) {
this.activity.message = '';
}
......@@ -190,13 +190,15 @@ export class Activity implements OnInit {
save() {
console.log('trying to save your changes to the server', this.activity);
if(this.hashtagsService.sliceHashTags(this.activity.message).length > 5){
console.log("hello");
if (this.hashtagsService.sliceHashTags(this.activity.message).length > 5) {
this.editing = true;
this.errorString = `You have exceeded the maximum 5 hashtags in a post`;
this.detectChanges();
return;
}
this.errorString = '';
this.editing = false;
this.activity.edited = true;
......
......@@ -21,8 +21,9 @@ export class ActivityPreview {
minds = window.Minds;
activity: any;
hideTabs: boolean;
editing: boolean = false;
errorString: string = null;
commentsToggle: boolean = false;
showBoostOptions: boolean = false;
translateToggle: any;
......
......@@ -15,7 +15,7 @@ import { AttachmentService } from '../../../../../services/attachment';
export class Remind {
minds = window.Minds;
errorString: string = '';
activity: any;
@Input() boosted: boolean = false;
hideTabs: boolean;
......
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