<template>
  <Block :title="$_tr('title')" title-tag="h3" class="mb-xxl">
    <FullGed
      :link-types="null"
      :folder-types="folderTypes"
      :document-types="documentTypes"
      :home-with-cards="false"
      :use-tree="false"
      :use-search="false"
      date-key="updated_at"
    />
  </Block>
</template>

<script>
import Block from '@inside-commons/components/lib/Block'

import FullGed from '@inside-ged/components/lib/Full'

export default {
  name: 'SpaceGed',
  components: { Block, FullGed },
  $_i18nRootPath: 'customs.SPACE.GED',
  computed: {
    folderTypes() {
      return {
        contents: ['franchised_spaces_folders'],
        filtersInFields: false,
        filters: {
          'status:eq': 1,
          sort: 'title:asc',
          franchised_spaces: {
            'slug:eq': this.$route.params.slug
          }
        },
        fields: [
          'uuid',
          'title',
          'content_type',
          'updated_at',
          'admin',
          'color',
          'pid',
          'parent_tree',
          'status',
          'is_media_folder',
          'image',
          { franchised_spaces_folders: ['uuid', 'title'] },
          { franchised_spaces: ['uuid', 'title', 'slug'] }
        ]
      }
    },
    documentTypes() {
      return {
        contents: ['franchised_spaces_documents'],
        singleAdditionEnabled: false,
        filters: { 'status:eq': 1 },
        fields: [
          'uuid',
          'title',
          'content_type',
          'admin',
          'updated_at',
          'file',
          'content',
          'status',
          { franchised_spaces_folders: ['uuid', 'title'] }
        ]
      }
    }
  }
}
</script>
