<commit_before><!--
  Licensed to Cloudera, Inc. under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  Cloudera, Inc. licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<template>
  <div>
    <div class="autocompleter-header">
      <i
        class="fa fa-fw"
        :class="{
          'fa-database': details.isDatabase(),
          'fa-eye': details.isView(),
          'fa-table': details.isTable(),
          'fa-columns': details.isField()
        }"
      />
      <span>{{ details.getTitle() }}</span>
      <div
        v-if="suggestion.popular && suggestion.relativePopularity"
        class="autocompleter-header-popularity"
      >
        <i class="fa fa-fw fa-star-o popular-color" :title="popularityTitle" />
      </div>
    </div>
    <div class="autocompleter-details-contents">
      <div class="autocompleter-details-contents-inner">
        <div v-if="details.isColumn()">
          <div class="details-attribute">
            <i class="fa fa-table fa-fw" />
            <span>{{ details.path[0] }}.{{ details.path[1] }}</span>
          </div>
        </div>
        <div v-if="details.isPartitionKey()" class="details-attribute">
          <i class="fa fa-key fa-fw" /> {{ I18n('Partition key') }}
        </div>
        <div v-else-if="details.isPrimaryKey()" class="details-attribute">
          <i class="fa fa-key fa-fw" /> {{ I18n('Primary key') }}
        </div>
        <div v-else-if="details.isForeignKey()" class="details-attribute">
          <i class="fa fa-key fa-fw" /> {{ I18n('Foreign key') }}
        </div>

        <div v-if="loading" class="details-comment">
          <spinner size="small" inline="true" />
        </div>
        <div v-else-if="comment" class="details-comment">{{ comment }}</div>
        <div v-else class="details-no-comment">{{ I18n('No description') }}</div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
  import { defineComponent, PropType } from 'vue';

  import { CancellablePromise } from 'api/cancellablePromise';

  import { Suggestion } from '../AutocompleteResults';
  import DataCatalogEntry from 'catalog/DataCatalogEntry';
  import I18n from 'utils/i18n';

  import Spinner from 'components/Spinner.vue';

  const COMMENT_LOAD_DELAY = 1500;

  export default defineComponent({
    name: 'CatalogEntryDetailsPanel',
    components: {
      Spinner
    },

    props: {
      suggestion: {
        type: Object as PropType<Suggestion>,
        required: true
      }
    },
<commit_msg>[frontend] Switch to new icons in the Autcomplete results for editor v2<commit_after><!--
  Licensed to Cloudera, Inc. under one
  or more contributor license agreements.  See the NOTICE file
  distributed with this work for additional information
  regarding copyright ownership.  Cloudera, Inc. licenses this file
  to you under the Apache License, Version 2.0 (the
  "License"); you may not use this file except in compliance
  with the License.  You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<template>
  <div>
    <div class="autocompleter-header">
      <DatabaseIcon v-if="details.isDatabase()" />
      <ViewIcon v-else-if="details.isView()" />
      <TableIcon v-else-if="details.isTable()" />
      <ColumnIcon v-else-if="details.isField()" />
      <span>{{ details.getTitle() }}</span>
      <div
        v-if="suggestion.popular && suggestion.relativePopularity"
        class="autocompleter-header-popularity"
      >
        <i class="fa fa-fw fa-star-o popular-color" :title="popularityTitle" />
      </div>
    </div>
    <div class="autocompleter-details-contents">
      <div class="autocompleter-details-contents-inner">
        <div v-if="details.isColumn()">
          <div class="details-attribute">
            <i class="fa fa-table fa-fw" />
            <span>{{ details.path[0] }}.{{ details.path[1] }}</span>
          </div>
        </div>
        <div v-if="details.isPartitionKey()" class="details-attribute">
          <i class="fa fa-key fa-fw" /> {{ I18n('Partition key') }}
        </div>
        <div v-else-if="details.isPrimaryKey()" class="details-attribute">
          <i class="fa fa-key fa-fw" /> {{ I18n('Primary key') }}
        </div>
        <div v-else-if="details.isForeignKey()" class="details-attribute">
          <i class="fa fa-key fa-fw" /> {{ I18n('Foreign key') }}
        </div>

        <div v-if="loading" class="details-comment">
          <spinner size="small" inline="true" />
        </div>
        <div v-else-if="comment" class="details-comment">{{ comment }}</div>
        <div v-else class="details-no-comment">{{ I18n('No description') }}</div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
  import { defineComponent, PropType } from 'vue';

  import { Suggestion } from '../AutocompleteResults';
  import { CancellablePromise } from 'api/cancellablePromise';
  import DataCatalogEntry from 'catalog/DataCatalogEntry';
  import Spinner from 'components/Spinner.vue';
  import ColumnIcon from 'components/icons/ColumnIcon';
  import DatabaseIcon from 'components/icons/DatabaseIcon';
  import TableIcon from 'components/icons/TableIcon';
  import ViewIcon from 'components/icons/ViewIcon';
  import I18n from 'utils/i18n';

  const COMMENT_LOAD_DELAY = 1500;

  export default defineComponent({
    name: 'CatalogEntryDetailsPanel',
    components: {
      ColumnIcon,
      TableIcon,
      ViewIcon,
      DatabaseIcon,
      Spinner
    },

    props: {
      suggestion: {
        type: Object as PropType<Suggestion>,
        required: true
      }
    },

{'fraction_non_alphanumeric': 0.13768227168073677, 'fraction_numerical': 0.006907137375287797, 'mean_word_length': 2.81275599765945, 'pattern_counts': {'":': 0, '<': 90, '<?xml version=': 0, '>': 90, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7595741', 'n_tokens_mistral': 1969, 'n_tokens_neox': 1913, 'n_words': 539}