Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: Migrate client code for emoji components and conversation services #10021

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

asliayk
Copy link
Contributor

@asliayk asliayk commented Dec 14, 2024

Checklist

General

Client

Motivation and Context

For the client migration, the following files need to be updated:

-- File Path Standalone Signals Inject
47 /shared/metis/conversations/channel.service.ts
48 /shared/metis/conversations/conversation.service.ts
49 /shared/metis/conversations/group-chat.service.ts
50 /shared/metis/conversations/one-to-one-chat.service.ts
52 /shared/metis/emoji/emoji-picker.component.html
53 /shared/metis/emoji/emoji-picker.component.ts
54 /shared/metis/emoji/emoji.component.html
55 /shared/metis/emoji/emoji.component.ts

Description

  • EmojiComponent and EmojiPickerComponent have been updated to use signals and converted into standalone components.
  • ChannelService, ConversationService, GroupChatService, and OneToOneChatService have been updated to use inject.

Steps for Testing

Prerequisites:

  • 1 Instructor
  • 1 Course with Communication enabled
  1. Log in to Artemis.
  2. Navigate to the Communication section of a course.
  3. Click on the plus button on the top of the sidebar to create a channel, direct chat, and group chat. Verify that these actions function as expected.
  4. Send a message to a random channel and add some emoji reactions to it. Ensure that the message and reactions are displayed correctly.
  5. Send an emoji by opening the emoji picker on the input area. Confirm that the emoji is sent and displayed as intended.

Testserver States

Note

These badges show the state of the test servers.
Green = Currently available, Red = Currently locked
Click on the badges to get to the test servers.







Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

Class/File Line Coverage Confirmation (assert/expect)
channel.service.ts 100%
conversation.service.ts 96.55% ✅ ❌
group-chat.service.ts 100%
one-to-one-chat.service.ts 100%
emoji-picker.component.ts 100%
emoji.component.ts 100%

Summary by CodeRabbit

  • New Features

    • Enhanced dependency injection for services, streamlining initialization.
    • Dynamic property bindings in the emoji picker component for improved flexibility.
    • Standalone components introduced for EmojiPickerComponent and EmojiComponent.
  • Bug Fixes

    • No specific bug fixes were noted.
  • Documentation

    • Updated component structure and property declarations for better modularity.
  • Chores

    • Refactored module exports and imports to optimize component accessibility.

@asliayk asliayk added client Pull requests that update TypeScript code. (Added Automatically!) chore small labels Dec 14, 2024
@asliayk asliayk self-assigned this Dec 14, 2024
@asliayk asliayk requested a review from a team as a code owner December 14, 2024 12:58
Copy link

coderabbitai bot commented Dec 14, 2024

Walkthrough

The pull request introduces a series of modernization changes across several TypeScript files in the Metis module, primarily focusing on dependency injection and component architecture. The modifications involve transitioning from traditional constructor-based dependency injection to Angular's new inject() function, making components standalone, and updating property bindings. These changes simplify the codebase, enhance modularity, and align with the latest Angular best practices without altering the core functionality of the services and components.

Changes

File Change Summary
src/main/webapp/app/shared/metis/conversations/channel.service.ts Refactored dependency injection using inject(), removed constructor
src/main/webapp/app/shared/metis/conversations/conversation.service.ts Updated dependency injection with inject(), removed constructor
src/main/webapp/app/shared/metis/conversations/group-chat.service.ts Simplified dependency injection using inject(), removed constructor
src/main/webapp/app/shared/metis/conversations/one-to-one-chat.service.ts Updated dependency injection with inject()
src/main/webapp/app/shared/metis/emoji/emoji-picker.component.html Modified property bindings to use function calls
src/main/webapp/app/shared/metis/emoji/emoji-picker.component.ts Made component standalone, updated input/output properties using input()/output()
src/main/webapp/app/shared/metis/emoji/emoji.component.html Updated emoji property binding to use function call
src/main/webapp/app/shared/metis/emoji/emoji.component.ts Made component standalone, updated emoji input using input()
src/main/webapp/app/shared/metis/metis.module.ts Removed EmojiComponent and EmojiPickerComponent from declarations, added to exports

Possibly related PRs

Suggested labels

tests, ready to merge, component:Communication, refactoring

Suggested reviewers

  • HawKhiem
  • sachmii
  • florian-glombik
  • JohannesWt
  • az108
  • krusche

Tip

CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. This feature will be included in our Pro Plan when released.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (7)
src/main/webapp/app/shared/metis/conversations/group-chat.service.ts (1)

Line range hint 18-21: Consider enhancing error handling for HTTP requests.

The HTTP requests could benefit from proper error handling using catchError operator.

Consider adding error handling:

 create(courseId: number, loginsOfChatPartners: string[]): Observable<HttpResponse<GroupChatDTO>> {
     return this.http
         .post<OneToOneChatDTO>(`${this.resourceUrl}${courseId}/group-chats`, loginsOfChatPartners, { observe: 'response' })
-        .pipe(map(this.conversationService.convertDateFromServer));
+        .pipe(
+            map(this.conversationService.convertDateFromServer),
+            catchError(error => {
+                console.error('Error creating group chat:', error);
+                throw error;
+            })
+        );
 }
src/main/webapp/app/shared/metis/conversations/channel.service.ts (2)

Line range hint 17-76: Consider organizing methods by responsibility.

The service has grown quite large with many methods. Consider organizing them into logical groups using private methods or even splitting into smaller services.

Consider grouping methods by responsibility:

// Channel Management
private channelManagementMethods = {
    create: (courseId: number, channelDTO: ChannelDTO) => {...},
    update: (courseId: number, channelId: number, channelDTO: ChannelDTO) => {...},
    delete: (courseId: number, channelId: number) => {...},
};

// Channel Status
private channelStatusMethods = {
    archive: (courseId: number, channelId: number) => {...},
    unarchive: (courseId: number, channelId: number) => {...},
};

// User Management
private userManagementMethods = {
    registerUsers: (courseId: number, channelId: number, options: ChannelRegistrationOptions) => {...},
    deregisterUsers: (courseId: number, channelId: number, logins?: string[]) => {...},
};

Line range hint 77-96: Consider using a type for registration options.

The registerUsersToChannel method has multiple optional parameters. Consider using a type to make it more maintainable.

Consider this improvement:

interface ChannelRegistrationOptions {
    addAllStudents?: boolean;
    addAllTutors?: boolean;
    addAllInstructors?: boolean;
    logins?: string[];
}

registerUsersToChannel(
    courseId: number,
    channelId: number,
    options: ChannelRegistrationOptions = {}
): Observable<HttpResponse<void>> {
    const userLogins = options.logins ?? [this.accountService.userIdentity?.login];
    let params = new HttpParams();
    
    if (options.addAllStudents) {
        params = params.set('addAllStudents', 'true');
    }
    // ... rest of the implementation
}
src/main/webapp/app/shared/metis/conversations/conversation.service.ts (1)

1-1: LGTM! Consider grouping related imports.

The migration to inject() function follows Angular's latest best practices and maintains the correct access modifiers. The implementation is clean and type-safe.

Consider grouping the Angular core imports together for better organization:

-import { Injectable, inject } from '@angular/core';
+import { inject, Injectable } from '@angular/core';

Also applies to: 37-39

src/main/webapp/app/shared/metis/emoji/emoji-picker.component.html (1)

9-9: Consider adding aria-label for accessibility.

While translations are properly implemented, consider adding an aria-label to improve accessibility for screen readers.

    [i18n]="{ search: 'artemisApp.metis.searchEmoji' | artemisTranslate, categories: { recent: 'artemisApp.metis.courseEmojiSelectionCategory' | artemisTranslate } }"
+   [aria-label]="'artemisApp.metis.emojiPicker' | artemisTranslate"
src/main/webapp/app/shared/metis/emoji/emoji.component.ts (1)

19-19: Consider cleanup for computed signal subscription.

While the computed signal is correctly implemented, consider cleanup to prevent potential memory leaks in certain scenarios.

export class EmojiComponent {
    private themeService = inject(ThemeService);
+   private destroyed = false;
    utils = EmojiUtils;
    emoji = input<string>('');
-   dark = computed(() => this.themeService.currentTheme() === Theme.DARK);
+   dark = computed(() => !this.destroyed && this.themeService.currentTheme() === Theme.DARK);

+   ngOnDestroy() {
+       this.destroyed = true;
+   }
}
src/main/webapp/app/shared/metis/emoji/emoji-picker.component.ts (1)

17-20: Consider using a specific type instead of 'any' for emojiSelect

While the migration to signal-based input/output is good, the emojiSelect output uses type any. Consider defining a specific interface for the emoji selection event.

-    emojiSelect = output<any>();
+    emojiSelect = output<{ emoji: EmojiData }>();
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a6ba30 and 2dd65a1.

📒 Files selected for processing (9)
  • src/main/webapp/app/shared/metis/conversations/channel.service.ts (2 hunks)
  • src/main/webapp/app/shared/metis/conversations/conversation.service.ts (2 hunks)
  • src/main/webapp/app/shared/metis/conversations/group-chat.service.ts (1 hunks)
  • src/main/webapp/app/shared/metis/conversations/one-to-one-chat.service.ts (2 hunks)
  • src/main/webapp/app/shared/metis/emoji/emoji-picker.component.html (1 hunks)
  • src/main/webapp/app/shared/metis/emoji/emoji-picker.component.ts (1 hunks)
  • src/main/webapp/app/shared/metis/emoji/emoji.component.html (1 hunks)
  • src/main/webapp/app/shared/metis/emoji/emoji.component.ts (1 hunks)
  • src/main/webapp/app/shared/metis/metis.module.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (9)
src/main/webapp/app/shared/metis/emoji/emoji.component.html (1)

Pattern src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

src/main/webapp/app/shared/metis/metis.module.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

src/main/webapp/app/shared/metis/conversations/one-to-one-chat.service.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

src/main/webapp/app/shared/metis/emoji/emoji.component.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

src/main/webapp/app/shared/metis/conversations/conversation.service.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

src/main/webapp/app/shared/metis/conversations/channel.service.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

src/main/webapp/app/shared/metis/conversations/group-chat.service.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

src/main/webapp/app/shared/metis/emoji/emoji-picker.component.html (1)

Pattern src/main/webapp/**/*.html: @if and @for are new and valid Angular syntax replacing *ngIf and *ngFor. They should always be used over the old style.

src/main/webapp/app/shared/metis/emoji/emoji-picker.component.ts (1)

Pattern src/main/webapp/**/*.ts: angular_style:https://angular.io/guide/styleguide;methods_in_html:false;lazy_loading:true;code_reuse:true;tests:meaningful;types:PascalCase;enums:PascalCase;funcs:camelCase;props:camelCase;no_priv_prefix:true;strings:single_quotes;localize:true;btns:functionality;links:navigation;icons_text:newline;labels:associate;code_style:arrow_funcs,curly_braces,open_braces_same_line,indent_4;memory_leak_prevention:true;routes:naming_schema;chart_framework:ngx-charts;responsive_layout:true

🔇 Additional comments (14)
src/main/webapp/app/shared/metis/conversations/one-to-one-chat.service.ts (1)

1-1: LGTM! Modern dependency injection implementation.

The migration to using inject() function aligns with Angular's modern dependency injection pattern. The implementation is clean and maintains the service's functionality while reducing boilerplate code.

Also applies to: 12-13

src/main/webapp/app/shared/metis/conversations/group-chat.service.ts (1)

6-6: LGTM! Clean dependency injection implementation.

The migration to inject() function is well implemented for all three dependencies.

Also applies to: 13-15

src/main/webapp/app/shared/metis/conversations/channel.service.ts (1)

1-1: LGTM! Consistent dependency injection implementation.

The migration to inject() function follows the same pattern as other services and is well implemented.

Also applies to: 13-15

src/main/webapp/app/shared/metis/conversations/conversation.service.ts (2)

Line range hint 41-182: Verify error handling for HTTP calls.

The service methods make HTTP calls but don't handle potential errors. Consider adding error handling to improve robustness.

Let's check if error handling exists in components using this service:

Consider adding error handling using catchError operator:

return this.http.get<ConversationDTO[]>(...).pipe(
  map(this.convertDateArrayFromServer),
  catchError(error => {
    console.error('Error fetching conversations:', error);
    return throwError(() => error);
  })
);

Line range hint 41-182: Check for potential memory leaks in components using this service.

The service returns Observables but doesn't handle unsubscription. Ensure components properly handle subscription cleanup.

Let's check component implementations:

Consider these approaches to prevent memory leaks:

  1. Use async pipe in templates where possible
  2. Implement ngOnDestroy to unsubscribe from subscriptions
  3. Use takeUntil operator with a destroy$ subject
✅ Verification successful

Memory leak concerns in conversation service usage are properly handled

The codebase shows proper subscription management through multiple approaches:

  1. Components using takeUntil with a destroy subject:

    • conversation-members.component.ts
    • conversation-messages.component.ts
    • conversation-header.component.ts
    • course-conversations.component.ts
    • conversation-options.component.ts
  2. Services implementing ngOnDestroy:

    • metis.service.ts
    • metis-conversation.service.ts
    • Both properly unsubscribe from websocket topics and clean up subscriptions
  3. Components implementing proper cleanup in ngOnDestroy:

    • All components using the conversation service properly unsubscribe from their subscriptions
    • Websocket subscriptions are properly cleaned up
    • Multiple subscriptions are tracked and cleaned up individually

The review comment's concern about memory leaks is unfounded as the codebase demonstrates consistent and thorough subscription management practices.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for proper subscription handling in components
ast-grep --pattern 'conversation.service.$$$).subscribe($$$)'

Length of output: 187


Script:

#!/bin/bash
# Let's try a different approach to find component usages of the conversation service
# First, find files that import the conversation service
rg -l "import.*ConversationService" --type ts

# Then, let's look for subscription patterns in components
rg "subscribe\(" --type ts -A 2

# Also search for ngOnDestroy implementations
ast-grep --pattern 'ngOnDestroy() {
  $$$
}'

Length of output: 69698


Script:

#!/bin/bash
# Let's search for conversation service usage in components and check their cleanup
rg -l "import.*ConversationService" --type ts | xargs rg "ngOnDestroy|takeUntil|unsubscribe" -B 2 -A 2

Length of output: 57744

src/main/webapp/app/shared/metis/emoji/emoji.component.html (2)

2-2: LGTM! Correct usage of new Angular control flow syntax.

The @if/@else syntax follows the new Angular guidelines, replacing *ngIf.

Also applies to: 4-4


3-3: Verify emoji() signal implementation.

The emoji property is now accessed as a function call, which suggests it's using Angular's new input signal syntax. This is the correct approach, but ensure that all parent components are passing the emoji value correctly.

Also applies to: 5-5

✅ Verification successful

Let me verify the implementation of the emoji signal and its usage by checking the component files.


Let me check the actual implementation of these components to verify the emoji property usage.


Signal implementation and usage are correctly implemented

The emoji component correctly uses Angular's new input signal syntax with emoji = input<string>(''), and the parent components are passing the emoji value correctly using property binding syntax [emoji]="...". The implementation aligns with Angular's latest practices for input handling.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for components that use jhi-emoji to verify correct property binding
rg -t html '<jhi-emoji.*\[emoji\]' 

Length of output: 817


Script:

#!/bin/bash
# Check the emoji component implementation
ast-grep --pattern 'export class EmojiComponent {
  $$$
  emoji$$$
  $$$
}'

# Check the components using jhi-emoji to verify their emoji property implementations
rg -l "class.*PostReactionsBarComponent|class.*AnswerPostReactionsBarComponent" --type ts

Length of output: 395


Script:

#!/bin/bash
# Check the emoji component implementation
cat src/main/webapp/app/shared/metis/emoji/emoji.component.ts

# Check how emoji is used in the parent components
rg -A 5 "emoji.*=" src/main/webapp/app/shared/metis/posting-reactions-bar/post-reactions-bar/post-reactions-bar.component.ts
rg -A 5 "emoji.*=" src/main/webapp/app/shared/metis/posting-reactions-bar/answer-post-reactions-bar/answer-post-reactions-bar.component.ts

Length of output: 1241

src/main/webapp/app/shared/metis/emoji/emoji-picker.component.html (1)

2-3: LGTM! Proper implementation of signal-based properties.

All properties correctly use function calls to access signal values.

Also applies to: 8-11

src/main/webapp/app/shared/metis/emoji/emoji.component.ts (2)

10-11: LGTM! Proper standalone component configuration.

The component is correctly configured as standalone with the necessary imports.


17-17: LGTM! Correct implementation of input signal.

The emoji input is properly implemented using the new signal-based input syntax with an appropriate default value.

src/main/webapp/app/shared/metis/emoji/emoji-picker.component.ts (2)

1-1: LGTM: Import organization follows Angular style guide

The imports are well-organized, following the Angular style guide with third-party imports separated from application imports.

Also applies to: 5-6


11-12: LGTM: Proper standalone component configuration

The component is correctly configured as standalone with necessary imports. This aligns with modern Angular practices for better modularity and tree-shaking.

src/main/webapp/app/shared/metis/metis.module.ts (2)

68-69: LGTM: Proper standalone component integration

The EmojiComponent and EmojiPickerComponent are correctly added to the imports array as they are now standalone components. This maintains backward compatibility while benefiting from the standalone architecture.


68-69: Verify component usage across the application

Let's ensure all usages of these components have been updated to work with the standalone versions.

✅ Verification successful

Let me check the actual usage of these components to verify if they're properly updated for standalone versions.


Let me check one final thing to verify if these components are properly imported in the components that use them.


Let me fix the regex and try one last time to verify the component configurations.


Components are properly configured as standalone

The verification shows that both components are correctly configured as standalone components and are being used in templates. The components:

  • Are marked with standalone: true
  • Have their required imports configured in their decorators
  • Are properly used in templates with <jhi-emoji> and <jhi-emoji-picker> selectors
  • No issues found with their integration in the application
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining module imports of these components
rg -l "import.*EmojiComponent.*from|import.*EmojiPickerComponent.*from" --type ts

# Search for component usage in templates
rg -l "jhi-emoji|jhi-emoji-picker" --type html

Length of output: 952


Script:

#!/bin/bash
# Check the component declarations in the test files
rg "import.*EmojiComponent|import.*EmojiPickerComponent" -A 5 src/test/javascript/spec/component/shared/metis/postings-reactions-bar/answer-post-reactions-bar/answer-post-reactions-bar.component.spec.ts src/test/javascript/spec/component/shared/metis/postings-reactions-bar/post-reactions-bar/post-reactions-bar.component.spec.ts src/test/javascript/spec/component/emoji/emoji-picker.component.spec.ts

# Check how these components are used in the HTML templates
rg "<jhi-emoji|<jhi-emoji-picker" -A 5 src/main/webapp/app/shared/metis/posting-reactions-bar/post-reactions-bar/post-reactions-bar.component.html src/main/webapp/app/shared/metis/post/post.component.html src/main/webapp/app/shared/metis/posting-reactions-bar/answer-post-reactions-bar/answer-post-reactions-bar.component.html src/main/webapp/app/shared/metis/answer-post/answer-post.component.html

# Check the component imports in the corresponding TS files
rg "import.*EmojiComponent|import.*EmojiPickerComponent" src/main/webapp/app/shared/metis/posting-reactions-bar/post-reactions-bar/post-reactions-bar.component.ts src/main/webapp/app/shared/metis/post/post.component.ts src/main/webapp/app/shared/metis/posting-reactions-bar/answer-post-reactions-bar/answer-post-reactions-bar.component.ts src/main/webapp/app/shared/metis/answer-post/answer-post.component.ts

Length of output: 10921


Script:

#!/bin/bash
# Check the imports in the component files that use these components
rg "^import.*{.*EmojiComponent.*}|^import.*{.*EmojiPickerComponent.*}" src/main/webapp/app/shared/metis/posting-reactions-bar/post-reactions-bar/post-reactions-bar.component.ts src/main/webapp/app/shared/metis/post/post.component.ts src/main/webapp/app/shared/metis/posting-reactions-bar/answer-post-reactions-bar/answer-post-reactions-bar.component.ts src/main/webapp/app/shared/metis/answer-post/answer-post.component.ts

# Also check if these components are marked as standalone
rg "@Component.*standalone" -B 5 src/main/webapp/app/shared/metis/emoji/emoji.component.ts src/main/webapp/app/shared/metis/emoji/emoji-picker.component.ts

Length of output: 740


Script:

#!/bin/bash
# Check the imports in the component files that use these components
rg "import.*\{.*EmojiComponent.*\}|import.*\{.*EmojiPickerComponent.*\}" src/main/webapp/app/shared/metis/posting-reactions-bar/post-reactions-bar/post-reactions-bar.component.ts src/main/webapp/app/shared/metis/post/post.component.ts src/main/webapp/app/shared/metis/posting-reactions-bar/answer-post-reactions-bar/answer-post-reactions-bar.component.ts src/main/webapp/app/shared/metis/answer-post/answer-post.component.ts

# Check the component decorators
rg "@Component" -A 5 src/main/webapp/app/shared/metis/emoji/emoji.component.ts src/main/webapp/app/shared/metis/emoji/emoji-picker.component.ts

Length of output: 1660

Copy link

⚠️ Unable to deploy to test servers ⚠️

Testserver "artemis-test5.artemis.cit.tum.de" is already in use by PR #9933.

@github-actions github-actions bot added the deployment-error Added by deployment workflows if an error occured label Dec 14, 2024
@HawKhiem HawKhiem added deploy:artemis-test6 and removed deployment-error Added by deployment workflows if an error occured labels Dec 14, 2024
@HawKhiem HawKhiem temporarily deployed to artemis-test6.artemis.cit.tum.de December 14, 2024 15:37 — with GitHub Actions Inactive
Copy link

@HawKhiem HawKhiem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on TS6. Everything works as intended! Also I want to ask whether the functionality to make underline emojis and or making them italic intended

image

Copy link

@sachmii sachmii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on TS2, everything works fine.

Copy link

@JerroyTan JerroyTan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Tested on TS1]
Everything works as expected

Copy link
Contributor

@ole-ve ole-ve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code

@krusche krusche added this to the 7.8.0 milestone Dec 20, 2024
@krusche krusche merged commit 4e94c01 into develop Dec 20, 2024
125 of 134 checks passed
@krusche krusche deleted the chore/emoji-and-conversation-services-migration branch December 20, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore client Pull requests that update TypeScript code. (Added Automatically!) ready to merge small
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

6 participants