Browse Source

chore(gui-v2): linting

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/2716/head
Pranav C 2 years ago
parent
commit
5ceb5defa0
  1. 13
      packages/nc-gui-v2/components/smartsheet/Sidebar.vue
  2. 19
      packages/nc-gui-v2/composables/useViews.ts
  3. 4
      packages/nc-gui-v2/utils/viewIcons.ts
  4. 4
      packages/nc-gui-v2/utils/viewUtils.ts

13
packages/nc-gui-v2/components/smartsheet/Sidebar.vue

@ -1,7 +1,8 @@
<script setup lang="ts">
import { inject } from "@vue/runtime-core";
import { TableType } from "nocodb-sdk";
import { onMounted, Ref } from "vue";
import type { TableType } from "nocodb-sdk";
import type { Ref } from "vue";
import { onMounted } from "vue";
import { MetaInj } from "~/components";
import useViews from "~/composables/useViews";
import { viewIcons } from "~/utils/viewUtils";
@ -50,11 +51,11 @@ const selectedViewIdLocal = ref("");
draggable="div"
v-bind="dragOptions"
@change="onMove($event)"
>-->
> -->
<!-- <transition-group
type="transition"
:name="!drag ? 'flip-list' : null"
>-->
> -->
<v-list-item
v-for="(view, i) in views"
:key="view.id"
@ -66,7 +67,7 @@ const selectedViewIdLocal = ref("");
<!-- :class="`body-2 view nc-view-item nc-draggable-child nc-${
viewTypeAlias[view.type]
}-view-item`"
@click="$emit('rerender')"-->
@click="$emit('rerender')" -->
<v-icon
v-if="_isUIAllowed('viewlist-drag-n-drop')"
small
@ -101,7 +102,7 @@ const selectedViewIdLocal = ref("");
<!-- @click.stop
@keydown.enter.stop="updateViewName(view, i)"
@blur="updateViewName(view, i)"-->
@blur="updateViewName(view, i)" -->
<template v-else>
<span v-on="on">{{
view.alias || view.title

19
packages/nc-gui-v2/composables/useViews.ts

@ -1,15 +1,14 @@
import { useNuxtApp } from "#app";
import { TableType } from "nocodb-sdk";
import { Ref } from "vue";
import type { TableType } from 'nocodb-sdk'
import type { Ref } from 'vue'
import { useNuxtApp } from '#app'
export default function(meta: Ref<TableType>) {
const views = ref();
const { $api } = useNuxtApp();
export default function (meta: Ref<TableType>) {
const views = ref()
const { $api } = useNuxtApp()
const loadViews = async () => {
if (meta.value?.id)
views.value = (await $api.dbView.list(meta.value?.id)).list;
};
if (meta.value?.id) views.value = (await $api.dbView.list(meta.value?.id)).list
}
return { views, loadViews };
return { views, loadViews }
}

4
packages/nc-gui-v2/utils/viewIcons.ts

@ -1,11 +1,11 @@
import { ViewTypes } from 'nocodb-sdk'
export const viewIcons = {
export const viewIcons = {
[ViewTypes.GRID]: { icon: 'mdi-grid-large', color: 'blue' },
// [ViewTypes.GRID]: { icon: "mdi-grid-large", color: "blue" },
[ViewTypes.FORM]: { icon: 'mdi-form-select', color: 'pink' },
calendar: { icon: 'mdi-calendar', color: 'purple' },
[ViewTypes.GALLERY]: { icon: 'mdi-camera-image', color: 'orange' },
[ViewTypes.KANBAN]: { icon: 'mdi-tablet-dashboard', color: 'green' },
view: { icon: 'mdi-eye-circle-outline', color: 'blue' }
view: { icon: 'mdi-eye-circle-outline', color: 'blue' },
}

4
packages/nc-gui-v2/utils/viewUtils.ts

@ -1,11 +1,11 @@
import { ViewTypes } from 'nocodb-sdk'
export const viewIcons = {
export const viewIcons = {
[ViewTypes.GRID]: { icon: 'mdi-grid-large', color: 'blue' },
// [ViewTypes.GRID]: { icon: "mdi-grid-large", color: "blue" },
[ViewTypes.FORM]: { icon: 'mdi-form-select', color: 'pink' },
calendar: { icon: 'mdi-calendar', color: 'purple' },
[ViewTypes.GALLERY]: { icon: 'mdi-camera-image', color: 'orange' },
[ViewTypes.KANBAN]: { icon: 'mdi-tablet-dashboard', color: 'green' },
view: { icon: 'mdi-eye-circle-outline', color: 'blue' }
view: { icon: 'mdi-eye-circle-outline', color: 'blue' },
}

Loading…
Cancel
Save