Browse Source

fix parameters/teaching cycles table

Olivier Massot 10 months ago
parent
commit
94c598adb8
1 changed files with 7 additions and 52 deletions
  1. 7 52
      pages/parameters/teaching.vue

+ 7 - 52
pages/parameters/teaching.vue

@@ -12,41 +12,9 @@
         :columns-definitions="[{ property: 'originalLabel' }, { property: 'effectiveLabel' }]"
         identifier="value"
         :actions="[TABLE_ACTION.EDIT]"
-        actions-route="/parameters/cycles"
+        @editClicked="goToCycleEditPage"
       />
 
-<!--      <v-table>-->
-<!--        <thead>-->
-<!--          <tr>-->
-<!--            <td>{{ $t('originalLabel') }}</td>-->
-<!--            <td>{{ $t('effectiveLabel') }}</td>-->
-<!--            <td>{{ $t('actions') }}</td>-->
-<!--          </tr>-->
-<!--        </thead>-->
-
-<!--        <tbody>-->
-<!--          <tr v-for="enumItem in cycleEnum" :key="enumItem.value">-->
-<!--            <td>{{ $t(enumItem.value) }}</td>-->
-<!--            <td class="cycle-editable-cell">-->
-<!--              {{-->
-<!--                orderedCycles[enumItem.value]-->
-<!--                  ? orderedCycles[enumItem.value].label-->
-<!--                  : $t(enumItem.value)-->
-<!--              }}-->
-<!--            </td>-->
-<!--            <td style="max-width: 24px">-->
-<!--              <v-btn-->
-<!--                v-if="orderedCycles[enumItem.value]"-->
-<!--                :flat="true"-->
-<!--                icon="fa fa-pen"-->
-<!--                class="cycle-edit-icon"-->
-<!--                @click="goToCycleEditPage(orderedCycles[enumItem.value].id)"-->
-<!--              />-->
-<!--            </td>-->
-<!--          </tr>-->
-<!--        </tbody>-->
-<!--      </v-table>-->
-
       <UiInputCheckbox
         v-model="parameters.showEducationIsACollectivePractice"
         field="showEducationIsACollectivePractice"
@@ -122,29 +90,16 @@ const tableItems = computed(() => {
     return {
       value: item.value,
       originalLabel: item.label,
-      effectiveLabel: item.label
+      effectiveLabel: (orderedCycles.value[item.value] ?? item).label,
     }
   }) || []
 })
-</script>
-
-<style scoped lang="scss">
-.v-table {
-  width: 100%;
-  max-width: 800px;
 
-  thead {
-    td {
-      border-bottom: thin solid rgba(var(--v-border-color), var(--v-border-opacity));
-    }
-  }
-}
-
-.cycle-edit-icon {
-  color: rgb(var(--v-theme-neutral-strong));
+const goToCycleEditPage = (item: object) => {
+  const cycle = orderedCycles.value[item.value]
+  navigateTo(`/parameters/cycles/${cycle.id}`)
 }
+</script>
 
-:deep(.cycle-edit-icon .v-icon) {
-  font-size: 18px;
-}
+<style scoped lang="scss">
 </style>