Commit 663e6953 authored by Ben Hayward's avatar Ben Hayward

Updated conflicts

1 merge request!436[Sprint/InterestingIguana](feat) Show error on hashtag limit when editing post #867
Pipeline #81385799 running with stages
......@@ -29,7 +29,7 @@
>
<i class="material-icons">trending_up</i>
<a i18n="@@MINDS__CARDS__ACTIVITY__BOOSTED_LABEL" [hidden]="activity.boosted_onchain">Boosted</a>
<a i18n="@@MINDS__CARDS__ACTIVITY__BOOSTED_LABEL_ONCHAIN" [hidden]="!activity.boosted_onchain">Boosted Onchain</a>
<a i18n="@@MINDS__CARDS__ACTIVITY__BOOSTED_LABEL_ONCHAIN" [hidden]="!activity.boosted_onchain" [routerLink]="['/token']">Boosted Onchain</a>
</div>
<div class="mdl-card__supporting-text is-boosted" *ngIf="isUnlisted()">
<i class="material-icons unlisted">visibility_off</i>
......
......@@ -190,7 +190,6 @@ export class Activity implements OnInit {
save() {
console.log('trying to save your changes to the server', this.activity);
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`;
......
......@@ -2,6 +2,7 @@ import { Component, EventEmitter, ViewChild, ComponentFactoryResolver } from '@a
import { DynamicHostDirective } from '../../../common/directives/dynamic-host.directive';
import { ActivityPreview } from '../../legacy/components/cards/activity/preview';
import { TopbarHashtagsService } from "../../hashtags/service/topbar.service";
// had forwardRef(() => ActivityPreview)
@Component({
......@@ -14,6 +15,12 @@ import { ActivityPreview } from '../../legacy/components/cards/activity/preview'
<div class="m-modal-remind-composer">
<h3 class="m-modal-remind-title" i18n="@@MODALS__REMIND_COMPOSER__REMIND_TITLE">Remind</h3>
<div class="mdl-card mdl-color--red-500 mdl-color-text--blue-grey-50 mdl-shadow--2dp" style="min-height:0;" *ngIf="error">
<div class="mdl-card__supporting-text mdl-color-text--blue-grey-50">
{{ error }}
</div>
</div>
<textarea name="message"
[(ngModel)]="message"
placeholder="Enter your remind status here (optional)"
......@@ -39,12 +46,15 @@ export class RemindComposerModal {
closed: EventEmitter<any> = new EventEmitter();
post: EventEmitter<any> = new EventEmitter();
object: any = {};
message: string = '';
error: string = '';
@ViewChild(DynamicHostDirective, { static: true }) cardHost: DynamicHostDirective;
constructor(private _componentFactoryResolver: ComponentFactoryResolver) { }
constructor(
private _componentFactoryResolver: ComponentFactoryResolver,
private hashtagsService: TopbarHashtagsService
) { }
set _object(object: any) {
this.object = object;
......@@ -63,7 +73,15 @@ export class RemindComposerModal {
this.closed.next(true);
}
/**
* Save the remind and close the popup.
*/
send() {
if (this.hashtagsService.sliceHashTags(this.message).length > 5) {
this.error = `You have exceeded the maximum 5 hashtags in a post`;
return;
}
this.error = '';
this.post.next({
message: this.message
});
......
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