From d47da0ae521696984da94a8fb8730b3ca9d55ec2 Mon Sep 17 00:00:00 2001 From: Tim Cremer Date: Fri, 29 Nov 2024 15:01:50 +0100 Subject: [PATCH] make all standalone via script --- .../link-preview-container.component.ts | 3 ++ .../link-preview/link-preview.component.ts | 5 +++ .../answer-post/answer-post.component.ts | 24 ++++++++++- .../metis/emoji/emoji-picker.component.ts | 4 ++ .../app/shared/metis/emoji/emoji.component.ts | 3 ++ .../message-inline-input.component.ts | 8 +++- .../message-reply-inline-input.component.ts | 8 +++- .../webapp/app/shared/metis/metis.module.ts | 2 - .../app/shared/metis/post/post.component.ts | 35 ++++++++++++++-- .../posting-button.component.ts | 3 ++ .../enlarge-slide-image.component.ts | 1 + .../posting-content-part.components.ts | 6 +++ .../posting-content.components.ts | 7 ++++ ...answer-post-create-edit-modal.component.ts | 7 +++- .../post-create-edit-modal.component.html | 4 +- .../post-create-edit-modal.component.ts | 40 ++++++++++++++++++- .../post-tag-selector.component.ts | 27 +++++++++++-- .../post-footer/post-footer.component.ts | 4 ++ .../answer-post-header.component.ts | 8 ++++ .../post-header/post-header.component.ts | 8 ++++ .../posting-markdown-editor.component.ts | 5 +++ .../answer-post-reactions-bar.component.ts | 24 +++++++++++ .../post-reactions-bar.component.ts | 29 ++++++++++++++ .../posting-thread.component.ts | 3 ++ .../pipes/html-for-posting-markdown.pipe.ts | 1 + .../pipes/reacting-users-on-posting.pipe.ts | 1 + 26 files changed, 254 insertions(+), 16 deletions(-) diff --git a/src/main/webapp/app/shared/link-preview/components/link-preview-container/link-preview-container.component.ts b/src/main/webapp/app/shared/link-preview/components/link-preview-container/link-preview-container.component.ts index 1349476f4d0c..14d1278478c2 100644 --- a/src/main/webapp/app/shared/link-preview/components/link-preview-container/link-preview-container.component.ts +++ b/src/main/webapp/app/shared/link-preview/components/link-preview-container/link-preview-container.component.ts @@ -3,12 +3,15 @@ import { LinkPreview, LinkPreviewService } from 'app/shared/link-preview/service import { Link, LinkifyService } from 'app/shared/link-preview/services/linkify.service'; import { User } from 'app/core/user/user.model'; import { Posting } from 'app/entities/metis/posting.model'; +import { LinkPreviewComponent } from '../link-preview/link-preview.component'; @Component({ selector: 'jhi-link-preview-container', templateUrl: './link-preview-container.component.html', styleUrls: ['./link-preview-container.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [LinkPreviewComponent], }) export class LinkPreviewContainerComponent implements OnInit, OnChanges { private readonly linkPreviewService: LinkPreviewService = inject(LinkPreviewService); diff --git a/src/main/webapp/app/shared/link-preview/components/link-preview/link-preview.component.ts b/src/main/webapp/app/shared/link-preview/components/link-preview/link-preview.component.ts index 0da0625bcc0d..3ba304bf7bac 100644 --- a/src/main/webapp/app/shared/link-preview/components/link-preview/link-preview.component.ts +++ b/src/main/webapp/app/shared/link-preview/components/link-preview/link-preview.component.ts @@ -4,11 +4,16 @@ import { faTimes } from '@fortawesome/free-solid-svg-icons'; import { MetisService } from 'app/shared/metis/metis.service'; import { Posting } from 'app/entities/metis/posting.model'; import { urlRegex } from 'app/shared/link-preview/services/linkify.service'; +import { ArtemisConfirmIconModule } from '../../../confirm-icon/confirm-icon.module'; +import { NgClass } from '@angular/common'; +import { ArtemisSharedCommonModule } from '../../../shared-common.module'; @Component({ selector: 'jhi-link-preview', templateUrl: './link-preview.component.html', styleUrls: ['./link-preview.component.scss'], + standalone: true, + imports: [ArtemisConfirmIconModule, NgClass, ArtemisSharedCommonModule], }) export class LinkPreviewComponent implements OnInit { @Input() linkPreview: LinkPreview; diff --git a/src/main/webapp/app/shared/metis/answer-post/answer-post.component.ts b/src/main/webapp/app/shared/metis/answer-post/answer-post.component.ts index 0c16f1be06ce..344575e50c6d 100644 --- a/src/main/webapp/app/shared/metis/answer-post/answer-post.component.ts +++ b/src/main/webapp/app/shared/metis/answer-post/answer-post.component.ts @@ -21,8 +21,15 @@ import { animate, style, transition, trigger } from '@angular/animations'; import { Posting } from 'app/entities/metis/posting.model'; import { Reaction } from 'app/entities/metis/reaction.model'; import { faBookmark, faPencilAlt, faSmile, faTrash } from '@fortawesome/free-solid-svg-icons'; -import { DOCUMENT } from '@angular/common'; +import { DOCUMENT, NgClass, NgIf, NgStyle } from '@angular/common'; import { AnswerPostReactionsBarComponent } from 'app/shared/metis/posting-reactions-bar/answer-post-reactions-bar/answer-post-reactions-bar.component'; +import { FaIconComponent } from '@fortawesome/angular-fontawesome'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; +import { AnswerPostCreateEditModalComponent } from '../posting-create-edit-modal/answer-post-create-edit-modal/answer-post-create-edit-modal.component'; +import { PostingContentComponent } from 'app/shared/metis/posting-content/posting-content.components'; +import { AnswerPostHeaderComponent } from 'app/shared/metis/posting-header/answer-post-header/answer-post-header.component'; +import { TranslateDirective } from 'app/shared/language/translate.directive'; +import { EmojiPickerComponent } from 'app/shared/metis/emoji/emoji-picker.component'; @Component({ selector: 'jhi-answer-post', @@ -35,6 +42,21 @@ import { AnswerPostReactionsBarComponent } from 'app/shared/metis/posting-reacti transition(':leave', [animate('300ms ease-out', style({ opacity: 0 }))]), ]), ], + standalone: true, + imports: [ + NgClass, + FaIconComponent, + TranslateDirective, + AnswerPostHeaderComponent, + PostingContentComponent, + AnswerPostReactionsBarComponent, + AnswerPostCreateEditModalComponent, + NgIf, + NgStyle, + CdkOverlayOrigin, + CdkConnectedOverlay, + EmojiPickerComponent, + ], }) export class AnswerPostComponent extends PostingDirective implements OnInit, OnChanges { @Input() lastReadDate?: dayjs.Dayjs; diff --git a/src/main/webapp/app/shared/metis/emoji/emoji-picker.component.ts b/src/main/webapp/app/shared/metis/emoji/emoji-picker.component.ts index e37e83152d1a..0f4fe8ded876 100644 --- a/src/main/webapp/app/shared/metis/emoji/emoji-picker.component.ts +++ b/src/main/webapp/app/shared/metis/emoji/emoji-picker.component.ts @@ -2,10 +2,14 @@ import { Component, EventEmitter, Input, Output, computed, inject } from '@angul import { Theme, ThemeService } from 'app/core/theme/theme.service'; import { EmojiUtils } from 'app/shared/metis/emoji/emoji.utils'; import { EmojiData } from '@ctrl/ngx-emoji-mart/ngx-emoji'; +import { PickerComponent } from '@ctrl/ngx-emoji-mart'; +import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module'; @Component({ selector: 'jhi-emoji-picker', templateUrl: './emoji-picker.component.html', + standalone: true, + imports: [PickerComponent, ArtemisSharedCommonModule], }) export class EmojiPickerComponent { private themeService = inject(ThemeService); diff --git a/src/main/webapp/app/shared/metis/emoji/emoji.component.ts b/src/main/webapp/app/shared/metis/emoji/emoji.component.ts index 00e651bf19b7..46b471c40b12 100644 --- a/src/main/webapp/app/shared/metis/emoji/emoji.component.ts +++ b/src/main/webapp/app/shared/metis/emoji/emoji.component.ts @@ -1,11 +1,14 @@ import { Component, Input, computed, inject } from '@angular/core'; import { Theme, ThemeService } from 'app/core/theme/theme.service'; import { EmojiUtils } from 'app/shared/metis/emoji/emoji.utils'; +import { EmojiComponent as EmojiComponent_1 } from '@ctrl/ngx-emoji-mart/ngx-emoji'; @Component({ selector: 'jhi-emoji', templateUrl: './emoji.component.html', styleUrls: ['./emoji.component.scss'], + standalone: true, + imports: [EmojiComponent_1], }) export class EmojiComponent { private themeService = inject(ThemeService); diff --git a/src/main/webapp/app/shared/metis/message/message-inline-input/message-inline-input.component.ts b/src/main/webapp/app/shared/metis/message/message-inline-input/message-inline-input.component.ts index 5292d11e7384..84c0de7e1c10 100644 --- a/src/main/webapp/app/shared/metis/message/message-inline-input/message-inline-input.component.ts +++ b/src/main/webapp/app/shared/metis/message/message-inline-input/message-inline-input.component.ts @@ -1,18 +1,24 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { AnswerPost } from 'app/entities/metis/answer-post.model'; import { MetisService } from 'app/shared/metis/metis.service'; -import { FormBuilder, Validators } from '@angular/forms'; +import { FormBuilder, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { Post } from 'app/entities/metis/post.model'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { PostContentValidationPattern } from 'app/shared/metis/metis.util'; import { PostingCreateEditDirective } from 'app/shared/metis/posting-create-edit.directive'; import { LocalStorageService } from 'ngx-webstorage'; +import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module'; +import { PostingButtonComponent } from 'app/shared/metis/posting-button/posting-button.component'; +import { PostingMarkdownEditorComponent } from 'app/shared/metis/posting-markdown-editor/posting-markdown-editor.component'; +import { TranslateDirective } from 'app/shared/language/translate.directive'; @Component({ selector: 'jhi-message-inline-input', templateUrl: './message-inline-input.component.html', styleUrls: ['./message-inline-input.component.scss'], encapsulation: ViewEncapsulation.None, + standalone: true, + imports: [FormsModule, ReactiveFormsModule, PostingMarkdownEditorComponent, TranslateDirective, PostingButtonComponent, ArtemisSharedCommonModule], }) export class MessageInlineInputComponent extends PostingCreateEditDirective implements OnInit { warningDismissed = false; diff --git a/src/main/webapp/app/shared/metis/message/message-reply-inline-input/message-reply-inline-input.component.ts b/src/main/webapp/app/shared/metis/message/message-reply-inline-input/message-reply-inline-input.component.ts index 6bdffeb2548a..09779d8301a7 100644 --- a/src/main/webapp/app/shared/metis/message/message-reply-inline-input/message-reply-inline-input.component.ts +++ b/src/main/webapp/app/shared/metis/message/message-reply-inline-input/message-reply-inline-input.component.ts @@ -2,17 +2,23 @@ import { Component, EventEmitter, OnChanges, OnInit, Output, SimpleChanges, View import { AnswerPost } from 'app/entities/metis/answer-post.model'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { MetisService } from 'app/shared/metis/metis.service'; -import { FormBuilder, Validators } from '@angular/forms'; +import { FormBuilder, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { PostContentValidationPattern } from 'app/shared/metis/metis.util'; import { PostingCreateEditDirective } from 'app/shared/metis/posting-create-edit.directive'; import { LocalStorageService } from 'ngx-webstorage'; import { ConversationDTO } from 'app/entities/metis/conversation/conversation.model'; +import { PostingMarkdownEditorComponent } from 'app/shared/metis/posting-markdown-editor/posting-markdown-editor.component'; +import { TranslateDirective } from 'app/shared/language/translate.directive'; +import { PostingButtonComponent } from 'app/shared/metis/posting-button/posting-button.component'; +import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module'; @Component({ selector: 'jhi-message-reply-inline-input', templateUrl: './message-reply-inline-input.component.html', styleUrls: ['./message-reply-inline-input.component.scss'], encapsulation: ViewEncapsulation.None, + standalone: true, + imports: [FormsModule, ReactiveFormsModule, PostingMarkdownEditorComponent, TranslateDirective, PostingButtonComponent, ArtemisSharedCommonModule], }) export class MessageReplyInlineInputComponent extends PostingCreateEditDirective implements OnInit, OnChanges { warningDismissed = false; diff --git a/src/main/webapp/app/shared/metis/metis.module.ts b/src/main/webapp/app/shared/metis/metis.module.ts index 870ec4fce24d..975095ef2937 100644 --- a/src/main/webapp/app/shared/metis/metis.module.ts +++ b/src/main/webapp/app/shared/metis/metis.module.ts @@ -64,8 +64,6 @@ import { ProfilePictureComponent } from 'app/shared/profile-picture/profile-pict MatDialogModule, LinkPreviewModule, ProfilePictureComponent, - ], - declarations: [ PostingThreadComponent, PostHeaderComponent, AnswerPostHeaderComponent, diff --git a/src/main/webapp/app/shared/metis/post/post.component.ts b/src/main/webapp/app/shared/metis/post/post.component.ts index 5deafdbd287b..dc0a0070ef8f 100644 --- a/src/main/webapp/app/shared/metis/post/post.component.ts +++ b/src/main/webapp/app/shared/metis/post/post.component.ts @@ -18,14 +18,14 @@ import { import { Post } from 'app/entities/metis/post.model'; import { PostingDirective } from 'app/shared/metis/posting.directive'; import { MetisService } from 'app/shared/metis/metis.service'; -import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; +import { NgbModalRef, NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; import { ContextInformation, DisplayPriority, PageType, RouteComponents } from '../metis.util'; import { faBookmark, faBullhorn, faCheckSquare, faComments, faPencilAlt, faSmile, faThumbtack, faTrash } from '@fortawesome/free-solid-svg-icons'; import dayjs from 'dayjs/esm'; import { PostFooterComponent } from 'app/shared/metis/posting-footer/post-footer/post-footer.component'; import { OneToOneChatService } from 'app/shared/metis/conversations/one-to-one-chat.service'; import { isCommunicationEnabled, isMessagingEnabled } from 'app/entities/course.model'; -import { Router } from '@angular/router'; +import { Router, RouterLink, RouterLinkActive } from '@angular/router'; import { MetisConversationService } from 'app/shared/metis/metis-conversation.service'; import { getAsChannelDTO } from 'app/entities/metis/conversation/channel.model'; import { AnswerPost } from 'app/entities/metis/answer-post.model'; @@ -33,8 +33,15 @@ import { AnswerPostCreateEditModalComponent } from 'app/shared/metis/posting-cre import { animate, style, transition, trigger } from '@angular/animations'; import { PostCreateEditModalComponent } from 'app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-create-edit-modal.component'; import { PostReactionsBarComponent } from 'app/shared/metis/posting-reactions-bar/post-reactions-bar/post-reactions-bar.component'; -import { CdkOverlayOrigin } from '@angular/cdk/overlay'; -import { DOCUMENT } from '@angular/common'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; +import { DOCUMENT, NgClass, NgIf, NgStyle } from '@angular/common'; +import { FaIconComponent } from '@fortawesome/angular-fontawesome'; +import { PostHeaderComponent } from 'app/shared/metis/posting-header/post-header/post-header.component'; +import { TranslateDirective } from 'app/shared/language/translate.directive'; +import { PostingContentComponent } from 'app/shared/metis/posting-content/posting-content.components'; +import { MessageInlineInputComponent } from 'app/shared/metis/message/message-inline-input/message-inline-input.component'; +import { EmojiPickerComponent } from 'app/shared/metis/emoji/emoji-picker.component'; +import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module'; @Component({ selector: 'jhi-post', @@ -47,6 +54,26 @@ import { DOCUMENT } from '@angular/common'; transition(':leave', [animate('300ms ease-out', style({ opacity: 0 }))]), ]), ], + standalone: true, + imports: [ + NgClass, + FaIconComponent, + TranslateDirective, + PostHeaderComponent, + NgbTooltip, + RouterLinkActive, + RouterLink, + PostingContentComponent, + PostReactionsBarComponent, + MessageInlineInputComponent, + PostFooterComponent, + NgIf, + NgStyle, + CdkOverlayOrigin, + CdkConnectedOverlay, + EmojiPickerComponent, + ArtemisSharedCommonModule, + ], }) export class PostComponent extends PostingDirective implements OnInit, OnChanges, AfterContentChecked { @Input() lastReadDate?: dayjs.Dayjs; diff --git a/src/main/webapp/app/shared/metis/posting-button/posting-button.component.ts b/src/main/webapp/app/shared/metis/posting-button/posting-button.component.ts index 1a4d9eeb1f11..1a693aa4c7f7 100644 --- a/src/main/webapp/app/shared/metis/posting-button/posting-button.component.ts +++ b/src/main/webapp/app/shared/metis/posting-button/posting-button.component.ts @@ -1,11 +1,14 @@ import { Component, HostBinding, Input } from '@angular/core'; import { IconProp } from '@fortawesome/fontawesome-svg-core'; import { faCircleNotch } from '@fortawesome/free-solid-svg-icons'; +import { FaIconComponent } from '@fortawesome/angular-fontawesome'; @Component({ /* eslint-disable-next-line @angular-eslint/component-selector */ selector: 'button[jhi-posting-button]', templateUrl: './posting-button.component.html', + standalone: true, + imports: [FaIconComponent], }) export class PostingButtonComponent { @Input() buttonIcon: IconProp; diff --git a/src/main/webapp/app/shared/metis/posting-content/enlarge-slide-image/enlarge-slide-image.component.ts b/src/main/webapp/app/shared/metis/posting-content/enlarge-slide-image/enlarge-slide-image.component.ts index 11eab0922af2..8decae042f16 100644 --- a/src/main/webapp/app/shared/metis/posting-content/enlarge-slide-image/enlarge-slide-image.component.ts +++ b/src/main/webapp/app/shared/metis/posting-content/enlarge-slide-image/enlarge-slide-image.component.ts @@ -7,6 +7,7 @@ export interface DialogData { @Component({ templateUrl: './enlarge-slide-image.component.html', + standalone: true, }) export class EnlargeSlideImageComponent { constructor(@Inject(MAT_DIALOG_DATA) public data: DialogData) {} diff --git a/src/main/webapp/app/shared/metis/posting-content/posting-content-part/posting-content-part.components.ts b/src/main/webapp/app/shared/metis/posting-content/posting-content-part/posting-content-part.components.ts index 0f2ce0b923ae..b079bc9b40a3 100644 --- a/src/main/webapp/app/shared/metis/posting-content/posting-content-part/posting-content-part.components.ts +++ b/src/main/webapp/app/shared/metis/posting-content/posting-content-part/posting-content-part.components.ts @@ -20,11 +20,17 @@ import { IconProp } from '@fortawesome/fontawesome-svg-core'; import { EnlargeSlideImageComponent } from 'app/shared/metis/posting-content/enlarge-slide-image/enlarge-slide-image.component'; import { MatDialog } from '@angular/material/dialog'; import { AccountService } from 'app/core/auth/account.service'; +import { RouterLink } from '@angular/router'; +import { FaIconComponent } from '@fortawesome/angular-fontawesome'; +import { TranslateDirective } from '../../../language/translate.directive'; +import { HtmlForPostingMarkdownPipe } from 'app/shared/pipes/html-for-posting-markdown.pipe'; @Component({ selector: 'jhi-posting-content-part', templateUrl: './posting-content-part.component.html', styleUrls: ['./../../metis.component.scss'], + standalone: true, + imports: [RouterLink, FaIconComponent, TranslateDirective, HtmlForPostingMarkdownPipe], }) export class PostingContentPartComponent implements OnInit { @Input() postingContentPart: PostingContentPart; diff --git a/src/main/webapp/app/shared/metis/posting-content/posting-content.components.ts b/src/main/webapp/app/shared/metis/posting-content/posting-content.components.ts index 59de56813a99..f4e775957682 100644 --- a/src/main/webapp/app/shared/metis/posting-content/posting-content.components.ts +++ b/src/main/webapp/app/shared/metis/posting-content/posting-content.components.ts @@ -8,12 +8,19 @@ import { PatternMatch, PostingContentPart, ReferenceType } from '../metis.util'; import { User } from 'app/core/user/user.model'; import { Posting } from 'app/entities/metis/posting.model'; import { isCommunicationEnabled } from 'app/entities/course.model'; +import { FaIconComponent } from '@fortawesome/angular-fontawesome'; +import { NgStyle } from '@angular/common'; +import { PostingContentPartComponent } from 'app/shared/metis/posting-content/posting-content-part/posting-content-part.components'; +import { LinkPreviewContainerComponent } from 'app/shared/link-preview/components/link-preview-container/link-preview-container.component'; +import { ArtemisSharedModule } from 'app/shared/shared.module'; @Component({ selector: 'jhi-posting-content', templateUrl: './posting-content.component.html', styleUrls: ['./posting-content.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ArtemisSharedModule, FaIconComponent, NgStyle, PostingContentPartComponent, LinkPreviewContainerComponent], }) export class PostingContentComponent implements OnInit, OnChanges, OnDestroy { @Input() content?: string; diff --git a/src/main/webapp/app/shared/metis/posting-create-edit-modal/answer-post-create-edit-modal/answer-post-create-edit-modal.component.ts b/src/main/webapp/app/shared/metis/posting-create-edit-modal/answer-post-create-edit-modal/answer-post-create-edit-modal.component.ts index e061a67aa20a..c7fa757323b3 100644 --- a/src/main/webapp/app/shared/metis/posting-create-edit-modal/answer-post-create-edit-modal/answer-post-create-edit-modal.component.ts +++ b/src/main/webapp/app/shared/metis/posting-create-edit-modal/answer-post-create-edit-modal/answer-post-create-edit-modal.component.ts @@ -3,15 +3,20 @@ import { PostingCreateEditModalDirective } from 'app/shared/metis/posting-create import { AnswerPost } from 'app/entities/metis/answer-post.model'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { MetisService } from 'app/shared/metis/metis.service'; -import { FormBuilder, Validators } from '@angular/forms'; +import { FormBuilder, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { PostContentValidationPattern } from 'app/shared/metis/metis.util'; import { Posting } from 'app/entities/metis/posting.model'; +import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module'; +import { PostingMarkdownEditorComponent } from 'app/shared/metis/posting-markdown-editor/posting-markdown-editor.component'; +import { PostingButtonComponent } from 'app/shared/metis/posting-button/posting-button.component'; @Component({ selector: 'jhi-answer-post-create-edit-modal', templateUrl: './answer-post-create-edit-modal.component.html', styleUrls: ['answer-post-create-edit-modal.component.scss'], encapsulation: ViewEncapsulation.None, + standalone: true, + imports: [FormsModule, ReactiveFormsModule, PostingMarkdownEditorComponent, PostingButtonComponent, ArtemisSharedCommonModule], }) export class AnswerPostCreateEditModalComponent extends PostingCreateEditModalDirective { @Input() createEditAnswerPostContainerRef: ViewContainerRef; diff --git a/src/main/webapp/app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-create-edit-modal.component.html b/src/main/webapp/app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-create-edit-modal.component.html index cd2a9ff14182..2eabfb14e3c2 100644 --- a/src/main/webapp/app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-create-edit-modal.component.html +++ b/src/main/webapp/app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-create-edit-modal.component.html @@ -31,7 +31,8 @@ } - +
diff --git a/src/main/webapp/app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-create-edit-modal.component.ts b/src/main/webapp/app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-create-edit-modal.component.ts index c88234f1e65b..19aeb661ad7b 100644 --- a/src/main/webapp/app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-create-edit-modal.component.ts +++ b/src/main/webapp/app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-create-edit-modal.component.ts @@ -1,9 +1,19 @@ import { Component, Input, OnChanges, OnInit } from '@angular/core'; import { PostingCreateEditModalDirective } from 'app/shared/metis/posting-create-edit-modal/posting-create-edit-modal.directive'; -import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { + NgbAccordionBody, + NgbAccordionButton, + NgbAccordionCollapse, + NgbAccordionDirective, + NgbAccordionHeader, + NgbAccordionItem, + NgbAccordionToggle, + NgbCollapse, + NgbModal, +} from '@ng-bootstrap/ng-bootstrap'; import { Post } from 'app/entities/metis/post.model'; import { MetisService } from 'app/shared/metis/metis.service'; -import { FormBuilder, Validators } from '@angular/forms'; +import { FormBuilder, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; import { Lecture } from 'app/entities/lecture.model'; import { Exercise } from 'app/entities/exercise.model'; import { Course } from 'app/entities/course.model'; @@ -12,6 +22,7 @@ import { faAngleDown, faAngleUp } from '@fortawesome/free-solid-svg-icons'; import { PageType, PostContentValidationPattern, PostTitleValidationPattern, PostingEditType } from 'app/shared/metis/metis.util'; import { Conversation } from 'app/entities/metis/conversation/conversation.model'; import { getAsChannelDTO } from 'app/entities/metis/conversation/channel.model'; +import { TranslateDirective } from 'app/shared/language/translate.directive'; const TITLE_MAX_LENGTH = 200; @@ -19,10 +30,35 @@ export interface ContextSelectorOption { conversation?: Conversation; } +import { ArtemisSharedComponentModule } from 'app/shared/components/shared-component.module'; +import { PostTagSelectorComponent } from 'app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-tag-selector/post-tag-selector.component'; +import { PostingMarkdownEditorComponent } from 'app/shared/metis/posting-markdown-editor/posting-markdown-editor.component'; +import { PostingButtonComponent } from 'app/shared/metis/posting-button/posting-button.component'; +import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module'; + @Component({ selector: 'jhi-post-create-edit-modal', templateUrl: './post-create-edit-modal.component.html', styleUrls: ['../../metis.component.scss'], + standalone: true, + imports: [ + FormsModule, + ReactiveFormsModule, + TranslateDirective, + ArtemisSharedComponentModule, + PostTagSelectorComponent, + NgbAccordionDirective, + NgbAccordionItem, + NgbAccordionHeader, + NgbAccordionToggle, + NgbAccordionButton, + NgbCollapse, + NgbAccordionCollapse, + NgbAccordionBody, + PostingMarkdownEditorComponent, + PostingButtonComponent, + ArtemisSharedCommonModule, + ], }) export class PostCreateEditModalComponent extends PostingCreateEditModalDirective implements OnInit, OnChanges { @Input() isCommunicationPage: boolean; diff --git a/src/main/webapp/app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-tag-selector/post-tag-selector.component.ts b/src/main/webapp/app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-tag-selector/post-tag-selector.component.ts index 15902d087305..6a4be5084f27 100644 --- a/src/main/webapp/app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-tag-selector/post-tag-selector.component.ts +++ b/src/main/webapp/app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-tag-selector/post-tag-selector.component.ts @@ -2,15 +2,36 @@ import { AfterContentChecked, ChangeDetectorRef, Component, ElementRef, EventEmi import { Observable, Subscription, map, startWith } from 'rxjs'; import { MetisService } from 'app/shared/metis/metis.service'; import { COMMA, ENTER, TAB } from '@angular/cdk/keycodes'; -import { FormControl } from '@angular/forms'; -import { MatChipInputEvent } from '@angular/material/chips'; -import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete'; +import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { MatChipGrid, MatChipInput, MatChipInputEvent, MatChipRemove, MatChipRow } from '@angular/material/chips'; +import { MatAutocomplete, MatAutocompleteSelectedEvent, MatAutocompleteTrigger } from '@angular/material/autocomplete'; import { faTimes } from '@fortawesome/free-solid-svg-icons'; +import { MatFormField } from '@angular/material/form-field'; +import { FaIconComponent } from '@fortawesome/angular-fontawesome'; +import { MatOption } from '@angular/material/core'; +import { AsyncPipe } from '@angular/common'; +import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module'; @Component({ selector: 'jhi-post-tag-selector', templateUrl: './post-tag-selector.component.html', styleUrls: ['./post-tag-selector.component.scss'], + standalone: true, + imports: [ + MatFormField, + MatChipGrid, + MatChipRow, + MatChipRemove, + FaIconComponent, + FormsModule, + MatAutocompleteTrigger, + MatChipInput, + ReactiveFormsModule, + MatAutocomplete, + MatOption, + AsyncPipe, + ArtemisSharedCommonModule, + ], }) export class PostTagSelectorComponent implements OnInit, OnChanges, OnDestroy, AfterContentChecked { @Input() postTags?: string[]; diff --git a/src/main/webapp/app/shared/metis/posting-footer/post-footer/post-footer.component.ts b/src/main/webapp/app/shared/metis/posting-footer/post-footer/post-footer.component.ts index 5808a9b342ba..1855040e260e 100644 --- a/src/main/webapp/app/shared/metis/posting-footer/post-footer/post-footer.component.ts +++ b/src/main/webapp/app/shared/metis/posting-footer/post-footer/post-footer.component.ts @@ -20,6 +20,8 @@ import { AnswerPostCreateEditModalComponent } from 'app/shared/metis/posting-cre import { AnswerPost } from 'app/entities/metis/answer-post.model'; import dayjs from 'dayjs/esm'; import { User } from 'app/core/user/user.model'; +import { AnswerPostComponent } from 'app/shared/metis/answer-post/answer-post.component'; +import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module'; interface PostGroup { author: User | undefined; @@ -30,6 +32,8 @@ interface PostGroup { selector: 'jhi-post-footer', templateUrl: './post-footer.component.html', styleUrls: ['./post-footer.component.scss'], + standalone: true, + imports: [AnswerPostComponent, AnswerPostCreateEditModalComponent, ArtemisSharedCommonModule], }) export class PostFooterComponent extends PostingFooterDirective implements OnInit, OnDestroy, AfterContentChecked, OnChanges { @Input() lastReadDate?: dayjs.Dayjs; diff --git a/src/main/webapp/app/shared/metis/posting-header/answer-post-header/answer-post-header.component.ts b/src/main/webapp/app/shared/metis/posting-header/answer-post-header/answer-post-header.component.ts index 45bd9775fd06..4ad0256b4457 100644 --- a/src/main/webapp/app/shared/metis/posting-header/answer-post-header/answer-post-header.component.ts +++ b/src/main/webapp/app/shared/metis/posting-header/answer-post-header/answer-post-header.component.ts @@ -3,11 +3,19 @@ import { AnswerPost } from 'app/entities/metis/answer-post.model'; import { PostingHeaderDirective } from 'app/shared/metis/posting-header/posting-header.directive'; import { faCheck, faPencilAlt } from '@fortawesome/free-solid-svg-icons'; import dayjs from 'dayjs/esm'; +import { NgClass } from '@angular/common'; +import { FaIconComponent } from '@fortawesome/angular-fontawesome'; +import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; +import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module'; +import { TranslateDirective } from 'app/shared/language/translate.directive'; +import { ProfilePictureComponent } from 'app/shared/profile-picture/profile-picture.component'; @Component({ selector: 'jhi-answer-post-header', templateUrl: './answer-post-header.component.html', styleUrls: ['../../metis.component.scss'], + standalone: true, + imports: [ProfilePictureComponent, NgClass, FaIconComponent, NgbTooltip, TranslateDirective, ArtemisSharedCommonModule], }) export class AnswerPostHeaderComponent extends PostingHeaderDirective implements OnInit, OnChanges { @Input() diff --git a/src/main/webapp/app/shared/metis/posting-header/post-header/post-header.component.ts b/src/main/webapp/app/shared/metis/posting-header/post-header/post-header.component.ts index 2d45812fe382..f4c0c5ad6f25 100644 --- a/src/main/webapp/app/shared/metis/posting-header/post-header/post-header.component.ts +++ b/src/main/webapp/app/shared/metis/posting-header/post-header/post-header.component.ts @@ -5,11 +5,19 @@ import { PostCreateEditModalComponent } from 'app/shared/metis/posting-create-ed import { faCheckSquare, faPencilAlt } from '@fortawesome/free-solid-svg-icons'; import dayjs from 'dayjs/esm'; import { CachingStrategy } from 'app/shared/image/secured-image.component'; +import { ProfilePictureComponent } from '../../../profile-picture/profile-picture.component'; +import { NgClass } from '@angular/common'; +import { FaIconComponent } from '@fortawesome/angular-fontawesome'; +import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; +import { TranslateDirective } from '../../../language/translate.directive'; +import { ArtemisSharedCommonModule } from '../../../shared-common.module'; @Component({ selector: 'jhi-post-header', templateUrl: './post-header.component.html', styleUrls: ['../../metis.component.scss'], + standalone: true, + imports: [ProfilePictureComponent, NgClass, FaIconComponent, NgbTooltip, TranslateDirective, ArtemisSharedCommonModule], }) export class PostHeaderComponent extends PostingHeaderDirective implements OnInit, OnDestroy, OnChanges { @Input() diff --git a/src/main/webapp/app/shared/metis/posting-markdown-editor/posting-markdown-editor.component.ts b/src/main/webapp/app/shared/metis/posting-markdown-editor/posting-markdown-editor.component.ts index 129273c97338..f3a8f9cd6637 100644 --- a/src/main/webapp/app/shared/metis/posting-markdown-editor/posting-markdown-editor.component.ts +++ b/src/main/webapp/app/shared/metis/posting-markdown-editor/posting-markdown-editor.component.ts @@ -42,6 +42,9 @@ import { Overlay, OverlayPositionBuilder } from '@angular/cdk/overlay'; import { BulletedListAction } from 'app/shared/monaco-editor/model/actions/bulleted-list.action'; import { OrderedListAction } from 'app/shared/monaco-editor/model/actions/ordered-list.action'; import { StrikethroughAction } from 'app/shared/monaco-editor/model/actions/strikethrough.action'; +import { ArtemisMarkdownEditorModule } from '../../markdown-editor/markdown-editor.module'; +import { PostingContentComponent } from '../posting-content/posting-content.components'; +import { NgStyle } from '@angular/common'; @Component({ selector: 'jhi-posting-markdown-editor', @@ -55,6 +58,8 @@ import { StrikethroughAction } from 'app/shared/monaco-editor/model/actions/stri ], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ArtemisMarkdownEditorModule, PostingContentComponent, NgStyle], }) export class PostingMarkdownEditorComponent implements OnInit, ControlValueAccessor, AfterContentChecked, AfterViewInit { @ViewChild(MarkdownEditorMonacoComponent, { static: true }) markdownEditor: MarkdownEditorMonacoComponent; diff --git a/src/main/webapp/app/shared/metis/posting-reactions-bar/answer-post-reactions-bar/answer-post-reactions-bar.component.ts b/src/main/webapp/app/shared/metis/posting-reactions-bar/answer-post-reactions-bar/answer-post-reactions-bar.component.ts index eed3ef65d59e..711498ed023c 100644 --- a/src/main/webapp/app/shared/metis/posting-reactions-bar/answer-post-reactions-bar/answer-post-reactions-bar.component.ts +++ b/src/main/webapp/app/shared/metis/posting-reactions-bar/answer-post-reactions-bar/answer-post-reactions-bar.component.ts @@ -5,11 +5,35 @@ import { AnswerPost } from 'app/entities/metis/answer-post.model'; import { faCheck, faPencilAlt, faSmile } from '@fortawesome/free-solid-svg-icons'; import { MetisService } from 'app/shared/metis/metis.service'; import { getAsChannelDTO } from 'app/entities/metis/conversation/channel.model'; +import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; +import { FaIconComponent } from '@fortawesome/angular-fontawesome'; +import { AsyncPipe, KeyValuePipe, NgClass } from '@angular/common'; +import { ReactingUsersOnPostingPipe } from 'app/shared/pipes/reacting-users-on-posting.pipe'; +import { EmojiPickerComponent } from 'app/shared/metis/emoji/emoji-picker.component'; +import { EmojiComponent } from 'app/shared/metis/emoji/emoji.component'; +import { ArtemisConfirmIconModule } from 'app/shared/confirm-icon/confirm-icon.module'; +import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module'; @Component({ selector: 'jhi-answer-post-reactions-bar', templateUrl: './answer-post-reactions-bar.component.html', styleUrls: ['../posting-reactions-bar.component.scss'], + standalone: true, + imports: [ + NgbTooltip, + EmojiComponent, + CdkOverlayOrigin, + FaIconComponent, + CdkConnectedOverlay, + EmojiPickerComponent, + NgClass, + ArtemisConfirmIconModule, + AsyncPipe, + KeyValuePipe, + ArtemisSharedCommonModule, + ReactingUsersOnPostingPipe, + ], }) export class AnswerPostReactionsBarComponent extends PostingsReactionsBarDirective implements OnInit, OnChanges { @Input() diff --git a/src/main/webapp/app/shared/metis/posting-reactions-bar/post-reactions-bar/post-reactions-bar.component.ts b/src/main/webapp/app/shared/metis/posting-reactions-bar/post-reactions-bar/post-reactions-bar.component.ts index 569eec43b75f..c0f6160c350d 100644 --- a/src/main/webapp/app/shared/metis/posting-reactions-bar/post-reactions-bar/post-reactions-bar.component.ts +++ b/src/main/webapp/app/shared/metis/posting-reactions-bar/post-reactions-bar/post-reactions-bar.component.ts @@ -14,11 +14,40 @@ import { AccountService } from 'app/core/auth/account.service'; import { isOneToOneChatDTO } from 'app/entities/metis/conversation/one-to-one-chat.model'; import { ConversationDTO } from 'app/entities/metis/conversation/conversation.model'; import { PostCreateEditModalComponent } from 'app/shared/metis/posting-create-edit-modal/post-create-edit-modal/post-create-edit-modal.component'; +import { FaIconComponent } from '@fortawesome/angular-fontawesome'; + +import { NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; +import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay'; +import { PostCreateEditModalComponent as PostCreateEditModalComponent_1 } from '../../posting-create-edit-modal/post-create-edit-modal/post-create-edit-modal.component'; + +import { ReactingUsersOnPostingPipe } from 'app/shared/pipes/reacting-users-on-posting.pipe'; +import { TranslateDirective } from 'app/shared/language/translate.directive'; +import { EmojiComponent } from 'app/shared/metis/emoji/emoji.component'; +import { EmojiPickerComponent } from 'app/shared/metis/emoji/emoji-picker.component'; +import { ArtemisConfirmIconModule } from 'app/shared/confirm-icon/confirm-icon.module'; +import { AsyncPipe, KeyValuePipe } from '@angular/common'; +import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module'; @Component({ selector: 'jhi-post-reactions-bar', templateUrl: './post-reactions-bar.component.html', styleUrls: ['../posting-reactions-bar.component.scss'], + standalone: true, + imports: [ + FaIconComponent, + TranslateDirective, + EmojiComponent, + NgbTooltip, + CdkOverlayOrigin, + CdkConnectedOverlay, + EmojiPickerComponent, + PostCreateEditModalComponent_1, + ArtemisConfirmIconModule, + AsyncPipe, + KeyValuePipe, + ArtemisSharedCommonModule, + ReactingUsersOnPostingPipe, + ], }) export class PostReactionsBarComponent extends PostingsReactionsBarDirective implements OnInit, OnChanges, OnDestroy { pinTooltip: string; diff --git a/src/main/webapp/app/shared/metis/posting-thread/posting-thread.component.ts b/src/main/webapp/app/shared/metis/posting-thread/posting-thread.component.ts index 8cb7db55b963..b050911b093a 100644 --- a/src/main/webapp/app/shared/metis/posting-thread/posting-thread.component.ts +++ b/src/main/webapp/app/shared/metis/posting-thread/posting-thread.component.ts @@ -1,12 +1,15 @@ import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, inject } from '@angular/core'; import { Post } from 'app/entities/metis/post.model'; import dayjs from 'dayjs/esm'; +import { PostComponent } from '../post/post.component'; @Component({ selector: 'jhi-posting-thread', templateUrl: './posting-thread.component.html', styleUrls: ['../metis.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [PostComponent], }) export class PostingThreadComponent { @Input() lastReadDate?: dayjs.Dayjs; diff --git a/src/main/webapp/app/shared/pipes/html-for-posting-markdown.pipe.ts b/src/main/webapp/app/shared/pipes/html-for-posting-markdown.pipe.ts index c91cd567cc6e..71e687611b86 100644 --- a/src/main/webapp/app/shared/pipes/html-for-posting-markdown.pipe.ts +++ b/src/main/webapp/app/shared/pipes/html-for-posting-markdown.pipe.ts @@ -4,6 +4,7 @@ import { ArtemisMarkdownService } from 'app/shared/markdown.service'; @Pipe({ name: 'htmlForPostingMarkdown', + standalone: true, }) export class HtmlForPostingMarkdownPipe implements PipeTransform { constructor(private markdownService: ArtemisMarkdownService) {} diff --git a/src/main/webapp/app/shared/pipes/reacting-users-on-posting.pipe.ts b/src/main/webapp/app/shared/pipes/reacting-users-on-posting.pipe.ts index 85d82230ba25..7f4ba2929d01 100644 --- a/src/main/webapp/app/shared/pipes/reacting-users-on-posting.pipe.ts +++ b/src/main/webapp/app/shared/pipes/reacting-users-on-posting.pipe.ts @@ -10,6 +10,7 @@ export const PLACEHOLDER_USER_REACTED = 'REPLACE_WITH_TRANSLATED_YOU'; */ @Pipe({ name: 'reactingUsersOnPosting', + standalone: true, }) export class ReactingUsersOnPostingPipe implements PipeTransform { constructor(private translateService: TranslateService) {}