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

remove the class name from the appbarr #13183

Merged
Merged
Changes from 2 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
25 changes: 1 addition & 24 deletions kolibri/plugins/coach/assets/src/composables/useCoreCoach.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import find from 'lodash/find';
import logger from 'kolibri-logging';
import { get } from '@vueuse/core';
import { computed, getCurrentInstance } from 'vue';
import { currentLanguage, isRtl } from 'kolibri/utils/i18n';
import useUser from 'kolibri/composables/useUser';
import useFacilities from 'kolibri-common/composables/useFacilities';
import { coachStrings } from '../views/common/commonCoachStrings';

const logging = logger.getLogger(__filename);
Expand All @@ -17,28 +14,8 @@ export default function useCoreCoach(store) {
const authorized = computed(() => store.getters.userIsAuthorizedForCoach);
const classId = computed(() => get(route).params.classId);
const groups = computed(() => store.getters['classSummary/groups']);
const { isSuperuser } = useUser();
const { facilities } = useFacilities();

function getAppBarTitle() {
let facilityName;
// Using coachStrings.$tr() here because mixins are not applied
// prior to props being processed.
const { facility_id, name } = store.state.classSummary;
if (facility_id && get(facilities).length > 1 && get(isSuperuser)) {
const match = find(get(facilities), { id: facility_id }) || {};
facilityName = match.name;
}
if (facilityName && name) {
return coachStrings.$tr('coachLabelWithOneTwoNames', {
name1: facilityName,
name2: name,
});
} else if (name) {
return coachStrings.$tr('coachLabelWithOneName', { name });
} else {
return coachStrings.$tr('coachLabel');
}
return coachStrings.$tr('coachLabel');
}

function formatPageTitle() {
Expand Down
Loading