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

Communication: Add default message to empty FAQ view #9467

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,15 @@
</div>
</div>
<hr class="" />
@if (faqs.length === 0) {
<h2 class="markdown-preview" jhiTranslate="artemisApp.faq.noExisting"></h2>
}
<div>
@for (faq of this.filteredFaqs; track faq) {
<jhi-course-faq-accordion [faq]="faq"></jhi-course-faq-accordion>
}
</div>
@if (filteredFaqs.length === 0 && faqs.length > 0) {
<h2 class="markdown-preview" jhiTranslate="artemisApp.faq.noMatching"></h2>
}
cremertim marked this conversation as resolved.
Show resolved Hide resolved
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ import { loadCourseFaqCategories } from 'app/faq/faq.utils';
import { CustomExerciseCategoryBadgeComponent } from 'app/shared/exercise-categories/custom-exercise-category-badge/custom-exercise-category-badge.component';
import { onError } from 'app/shared/util/global.utils';
import { SearchFilterComponent } from 'app/shared/search-filter/search-filter.component';
import { ArtemisMarkdownModule } from 'app/shared/markdown.module';

@Component({
selector: 'jhi-course-faq',
templateUrl: './course-faq.component.html',
styleUrls: ['../course-overview.scss', 'course-faq.component.scss'],
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [ArtemisSharedComponentModule, ArtemisSharedModule, CourseFaqAccordionComponent, CustomExerciseCategoryBadgeComponent, SearchFilterComponent],
imports: [ArtemisSharedComponentModule, ArtemisSharedModule, CourseFaqAccordionComponent, CustomExerciseCategoryBadgeComponent, SearchFilterComponent, ArtemisMarkdownModule],
})
export class CourseFaqComponent implements OnInit, OnDestroy {
private ngUnsubscribe = new Subject<void>();
Expand Down
4 changes: 3 additions & 1 deletion src/main/webapp/i18n/de/faq.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"questionAnswer": "Antwort auf die Frage",
"categories": "Kategorien"
},
"course": "Kurs"
"course": "Kurs",
"noExisting": "Momentan existiert für diesen Kurs noch kein FAQ.",
cremertim marked this conversation as resolved.
Show resolved Hide resolved
"noMatching": "Es gibt kein FAQ, das die Kombination aus Filter- und Suchkriterien erfüllt."
cremertim marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
4 changes: 3 additions & 1 deletion src/main/webapp/i18n/en/faq.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"questionAnswer": "Question answer",
"categories": "Categories"
},
"course": "Course"
"course": "Course",
"noExisting": "Currently, there is no FAQ available for this course.",
cremertim marked this conversation as resolved.
Show resolved Hide resolved
"noMatching": "There is no FAQ that matches the combination of filter and search criteria."
cremertim marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Loading