Skip to content

Commit

Permalink
Updated Components
Browse files Browse the repository at this point in the history
  • Loading branch information
PaRangger committed Nov 27, 2024
1 parent 83ac531 commit 860ede4
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@if (isLoading) {
@if (isLoading()) {
<div class="d-flex justify-content-center spinner">
<div class="spinner-border" role="status">
<span class="sr-only" jhiTranslate="loading"></span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Component, Input } from '@angular/core';
import { Component, input } from '@angular/core';
import { TranslateDirective } from 'app/shared/language/translate.directive';

@Component({
selector: 'jhi-loading-indicator-container',
templateUrl: './loading-indicator-container.component.html',
styleUrls: ['./loading-indicator-container.component.scss'],
imports: [TranslateDirective],
standalone: true,
})
export class LoadingIndicatorContainerComponent {
@Input() isLoading = false;
isLoading = input<boolean>(false);
}
3 changes: 1 addition & 2 deletions src/main/webapp/app/shared/markdown.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { ArtemisMarkdownEditorModule } from 'app/shared/markdown-editor/markdown
import { HtmlForMarkdownPipe } from 'app/shared/pipes/html-for-markdown.pipe';

@NgModule({
imports: [ArtemisMarkdownEditorModule],
declarations: [HtmlForMarkdownPipe],
imports: [ArtemisMarkdownEditorModule, HtmlForMarkdownPipe],
providers: [ArtemisMarkdownService],
exports: [HtmlForMarkdownPipe],
})
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/app/shared/metis/metis.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import { ProfilePictureComponent } from 'app/shared/profile-picture/profile-pict
MatDialogModule,
LinkPreviewModule,
ProfilePictureComponent,
HtmlForPostingMarkdownPipe,
],
declarations: [
PostingThreadComponent,
Expand All @@ -86,7 +87,6 @@ import { ProfilePictureComponent } from 'app/shared/profile-picture/profile-pict
AnswerPostReactionsBarComponent,
MessageInlineInputComponent,
MessageReplyInlineInputComponent,
HtmlForPostingMarkdownPipe,
ReactingUsersOnPostingPipe,
EmojiComponent,
EmojiPickerComponent,
Expand Down
5 changes: 3 additions & 2 deletions src/main/webapp/app/shared/pipes/html-for-markdown.pipe.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { Pipe, PipeTransform } from '@angular/core';
import { Pipe, PipeTransform, inject } from '@angular/core';
import { SafeHtml } from '@angular/platform-browser';
import { ArtemisMarkdownService } from 'app/shared/markdown.service';
import type { PluginSimple } from 'markdown-it';

@Pipe({
name: 'htmlForMarkdown',
standalone: true,
})
export class HtmlForMarkdownPipe implements PipeTransform {
constructor(private markdownService: ArtemisMarkdownService) {}
private readonly markdownService = inject(ArtemisMarkdownService);

/**
* Converts markdown into html, sanitizes it and then declares it as safe to bypass further security.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Pipe, PipeTransform } from '@angular/core';
import { Pipe, PipeTransform, inject } from '@angular/core';
import { SafeHtml } from '@angular/platform-browser';
import { ArtemisMarkdownService } from 'app/shared/markdown.service';

@Pipe({
name: 'htmlForPostingMarkdown',
standalone: true,
})
export class HtmlForPostingMarkdownPipe implements PipeTransform {
constructor(private markdownService: ArtemisMarkdownService) {}
private readonly markdownService = inject(ArtemisMarkdownService);

/**
* Converts markdown used in posting content into html, sanitizes it and then declares it as safe to bypass further security.
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/app/shared/shared-common.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ import { ArtemisDateRangePipe } from 'app/shared/pipes/artemis-date-range.pipe';
AlertOverlayComponent,
SortByDirective,
SortDirective,
ArtemisTranslatePipe,
ArtemisTimeAgoPipe,
ArtemisDurationFromSecondsPipe,
DurationPipe,
CloseCircleComponent,
ArtemisTranslatePipe,
],
exports: [
ArtemisSharedLibsModule,
Expand Down
3 changes: 1 addition & 2 deletions src/main/webapp/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ import { DetailOverviewNavigationBarComponent } from 'app/shared/detail-overview
import { ScienceDirective } from 'app/shared/science/science.directive';

@NgModule({
imports: [ArtemisSharedLibsModule, ArtemisSharedCommonModule, ArtemisSharedPipesModule, RouterModule],
imports: [ArtemisSharedLibsModule, ArtemisSharedCommonModule, ArtemisSharedPipesModule, RouterModule, LoadingIndicatorContainerComponent],
declarations: [
DetailOverviewNavigationBarComponent,
LoadingIndicatorContainerComponent,
CircularProgressBarComponent,
CompetencySelectionComponent,
AdditionalFeedbackComponent,
Expand Down

0 comments on commit 860ede4

Please sign in to comment.