<commit_before><template>

  <CoreBase
    :immersivePage="false"
    :authorized="userIsAuthorized"
    authorizedRole="adminOrCoach"
    :showSubNav="true"
  >

    <TopNavbar slot="sub-nav" />

    <KPageContainer>

      <ReportsGroupHeader />

      <KGrid>
        <KGridItem :sizes="[100, 100, 50]" percentage>
          <h2>{{ coachStrings.$tr('lessonsAssignedLabel') }}</h2>
          <ul class="list">
            <li v-for="lesson in lessonsList" :key="lesson.id">
              <KLabeledIcon>
                <KIcon slot="icon" lesson />
                <KRouterLink
                  :to="classRoute('ReportsGroupReportLessonPage', { lessonId: lesson.id })"
                  :text="lesson.title"
                />
              </KLabeledIcon>
            </li>
          </ul>
        </KGridItem>
        <KGridItem :sizes="[100, 100, 50]" percentage>
          <h2>{{ coachStrings.$tr('quizzesAssignedLabel') }}</h2>
          <ul class="list">
            <li v-for="exam in examsList" :key="exam.id">
              <KLabeledIcon>
                <KIcon slot="icon" quiz />
                <KRouterLink
                  :to="classRoute('ReportsGroupReportQuizLearnerListPage', { quizId: exam.id })"
                  :text="exam.title"
                />
              </KLabeledIcon>
            </li>
          </ul>
        </KGridItem>
      </KGrid>

    </KPageContainer>
  </CoreBase>

</template>


<script>

  import commonCoach from '../common';
  import ReportsGroupHeader from './ReportsGroupHeader';

  export default {
    name: 'ReportsGroupReportPage',
    components: {
      ReportsGroupHeader,
    },
    mixins: [commonCoach],
    computed: {
      lessonsList() {
        const filtered = this.lessons.filter(lesson => this.isAssigned(lesson.groups));
        return this._.sortBy(filtered, ['title', 'active']);
      },
      examsList() {
        const filtered = this.exams.filter(exam => this.isAssigned(exam.groups));
        return this._.sortBy(filtered, ['title', 'active']);
      },
    },
    methods: {
      isAssigned(groups) {
        return groups.includes(this.$route.params.groupId) || !groups.length;
      },
    },
  };

</script>


<style lang="scss" scoped>

  .list {
    padding: 0;
    margin: 0;
    font-size: 14px;
    line-height: 2em;
    list-style: none;
  }

</style>
<commit_msg>Add empty state for ReportsGroupReportPage assignment lists<commit_after><template>

  <CoreBase
    :immersivePage="false"
    :authorized="userIsAuthorized"
    authorizedRole="adminOrCoach"
    :showSubNav="true"
  >

    <TopNavbar slot="sub-nav" />

    <KPageContainer>

      <ReportsGroupHeader />

      <KGrid>
        <KGridItem :sizes="[100, 100, 50]" percentage>
          <h2>{{ coachStrings.$tr('lessonsAssignedLabel') }}</h2>
          <ul class="list">
            <li v-for="lesson in lessonsList" :key="lesson.id">
              <KLabeledIcon>
                <KIcon slot="icon" lesson />
                <KRouterLink
                  :to="classRoute('ReportsGroupReportLessonPage', { lessonId: lesson.id })"
                  :text="lesson.title"
                />
              </KLabeledIcon>
            </li>
          </ul>
          <p v-if="lessonsList.length === 0">
            {{ coachStrings.$tr('lessonListEmptyState') }}
          </p>
        </KGridItem>
        <KGridItem :sizes="[100, 100, 50]" percentage>
          <h2>{{ coachStrings.$tr('quizzesAssignedLabel') }}</h2>
          <ul class="list">
            <li v-for="exam in examsList" :key="exam.id">
              <KLabeledIcon>
                <KIcon slot="icon" quiz />
                <KRouterLink
                  :to="classRoute('ReportsGroupReportQuizLearnerListPage', { quizId: exam.id })"
                  :text="exam.title"
                />
              </KLabeledIcon>
            </li>
          </ul>
          <p v-if="examsList.length === 0">
            {{ coachStrings.$tr('quizListEmptyState') }}
          </p>
        </KGridItem>
      </KGrid>

    </KPageContainer>
  </CoreBase>

</template>


<script>

  import commonCoach from '../common';
  import ReportsGroupHeader from './ReportsGroupHeader';

  export default {
    name: 'ReportsGroupReportPage',
    components: {
      ReportsGroupHeader,
    },
    mixins: [commonCoach],
    computed: {
      lessonsList() {
        const filtered = this.lessons.filter(lesson => this.isAssigned(lesson.groups));
        return this._.sortBy(filtered, ['title', 'active']);
      },
      examsList() {
        const filtered = this.exams.filter(exam => this.isAssigned(exam.groups));
        return this._.sortBy(filtered, ['title', 'active']);
      },
    },
    methods: {
      isAssigned(groups) {
        return groups.includes(this.$route.params.groupId) || !groups.length;
      },
    },
  };

</script>


<style lang="scss" scoped>

  .list {
    padding: 0;
    margin: 0;
    font-size: 14px;
    line-height: 2em;
    list-style: none;
  }

</style>

{'fraction_non_alphanumeric': 0.15058069683620345, 'fraction_numerical': 0.010412494993992792, 'mean_word_length': 1.9573712255772646, 'pattern_counts': {'":': 0, '<': 83, '<?xml version=': 0, '>': 87, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3752755', 'n_tokens_mistral': 1653, 'n_tokens_neox': 1549, 'n_words': 272}