Skip to content

Commit

Permalink
Communication: Add default message to empty FAQ view (#9467)
Browse files Browse the repository at this point in the history
  • Loading branch information
cremertim authored Oct 13, 2024
1 parent 6549075 commit ba666c4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
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>
}
</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.",
"noMatching": "Es gibt kein FAQ, das die Kombination aus Filter- und Suchkriterien erfüllt."
}
}
}
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.",
"noMatching": "There is no FAQ that matches the combination of filter and search criteria."
}
}
}

0 comments on commit ba666c4

Please sign in to comment.