Skip to content

Commit

Permalink
make all standalone via script
Browse files Browse the repository at this point in the history
  • Loading branch information
cremertim committed Nov 29, 2024
1 parent f81e35b commit d47da0a
Show file tree
Hide file tree
Showing 26 changed files with 254 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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<AnswerPost> implements OnInit, OnChanges {
@Input() lastReadDate?: dayjs.Dayjs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/main/webapp/app/shared/metis/emoji/emoji.component.ts
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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<Post | AnswerPost> implements OnInit {
warningDismissed = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<AnswerPost> implements OnInit, OnChanges {
warningDismissed = false;
Expand Down
2 changes: 0 additions & 2 deletions src/main/webapp/app/shared/metis/metis.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ import { ProfilePictureComponent } from 'app/shared/profile-picture/profile-pict
MatDialogModule,
LinkPreviewModule,
ProfilePictureComponent,
],
declarations: [
PostingThreadComponent,
PostHeaderComponent,
AnswerPostHeaderComponent,
Expand Down
35 changes: 31 additions & 4 deletions src/main/webapp/app/shared/metis/post/post.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,30 @@ 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';
import { AnswerPostCreateEditModalComponent } from 'app/shared/metis/posting-create-edit-modal/answer-post-create-edit-modal/answer-post-create-edit-modal.component';
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',
Expand All @@ -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<Post> implements OnInit, OnChanges, AfterContentChecked {
@Input() lastReadDate?: dayjs.Dayjs;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<AnswerPost> {
@Input() createEditAnswerPostContainerRef: ViewContainerRef;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ <h4 class="modal-title">{{ modalTitle | artemisTranslate }}</h4>
</div>
</div>
}
<!-- top K similar posts, only shown if there are similar posts (i.e. not during updating a post), announcements will not be compared -->
<!--
top K similar posts, only shown if there are similar posts (i.e. not during updating a post), announcements will not be compared
@if (similarPosts.length > 0) {
<div class="mb-3">
<div ngbAccordion>
Expand Down Expand Up @@ -60,6 +61,7 @@ <h4 class="modal-title">{{ modalTitle | artemisTranslate }}</h4>
</div>
</div>
}
-->
<!-- content -->
<div class="position-relative mb-1">
<div>
Expand Down
Loading

0 comments on commit d47da0a

Please sign in to comment.