Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cdauth committed Mar 5, 2024
1 parent f713ace commit b211800
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = {
ignorePatterns: ["**/dist/*", "**/out/*", "**/out.*/*"],
parserOptions: {
parser: "@typescript-eslint/parser",
project: ["./*/tsconfig.json", "./*/tsconfig.node.json"],
project: ["*/tsconfig.json", "*/tsconfig.node.json"],
extraFileExtensions: [".vue"]
},
plugins: ["@typescript-eslint", "import"],
Expand Down
15 changes: 3 additions & 12 deletions frontend/src/lib/components/pad-settings-dialog/pad-id-edit.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<script setup lang="ts">
import { padIdValidator, type CRU, type PadData } from "facilmap-types";
import { computed, ref } from "vue";
import { computed } from "vue";
import { getUniqueId, getZodValidator, validateRequired } from "../../utils/utils";
import copyToClipboard from "copy-to-clipboard";
import { useToasts } from "../ui/toasts/toasts.vue";
import { injectContextRequired } from "../facil-map-context-provider/facil-map-context-provider.vue";
import CopyToClipboardInput from "../ui/copy-to-clipboard-input.vue";
Expand All @@ -12,8 +10,6 @@
const context = injectContextRequired();
const toasts = useToasts();
const props = defineProps<{
padData: PadData<CRU.CREATE>;
idProp: IdProp;
Expand All @@ -40,23 +36,18 @@
return "The same link cannot be used for different access levels.";
}
}
function copy(text: string): void {
copyToClipboard(text);
toasts.showToast(undefined, "Map link copied", "The map link was copied to the clipboard.", { variant: "success", autoHide: true });
}
</script>

<template>
<div class="row mb-3">
<label :for="`${id}-input`" class="col-sm-3 col-form-label">{{props.label}}</label>
<div class="col-sm-9 position-relative">
<CopyToClipboardInput
v-model="padData[idProp]"
v-model="value"
:prefix="context.baseUrl"
shortDescription="Map link"
longDescription="The map link"
:fullUrl="`${context.baseUrl}${encodeURIComponent(padData[idProp])}`"
:fullUrl="`${context.baseUrl}${encodeURIComponent(value)}`"
:validators="[validateRequired, getZodValidator(padIdValidator), validateDistinctPadId]"
></CopyToClipboardInput>

Expand Down
9 changes: 0 additions & 9 deletions frontend/src/lib/components/share-dialog.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<script setup lang="ts">
import { getLayers } from "facilmap-leaflet";
import copyToClipboard from "copy-to-clipboard";
import { getLegendItems } from "./legend/legend-utils";
import type { Writable } from "facilmap-types";
import { quoteHtml, round } from "facilmap-utils";
import { computed, ref } from "vue";
import { useToasts } from "./ui/toasts/toasts.vue";
import ModalDialog from "./ui/modal-dialog.vue";
import { getUniqueId } from "../utils/utils";
import { injectContextRequired, requireClientContext, requireMapContext } from "./facil-map-context-provider/facil-map-context-provider.vue";
Expand All @@ -15,8 +13,6 @@
const client = requireClientContext(context);
const mapContext = requireMapContext(context);
const toasts = useToasts();
const emit = defineEmits<{
hidden: [];
}>();
Expand Down Expand Up @@ -69,11 +65,6 @@
const embedCode = computed(() => {
return `<iframe style="height:500px; width:100%; border:none;" src="${quoteHtml(url.value)}"></iframe>`;
});
function copyEmbedCode(): void {
copyToClipboard(embedCode.value);
toasts.showToast(undefined, "Embed code copied", `The code to embed ${context.appName} was copied to the clipboard.`, { variant: "success", autoHide: true });
}
</script>

<template>
Expand Down
6 changes: 1 addition & 5 deletions frontend/src/lib/components/ui/copy-to-clipboard-input.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import copyToClipboard from "copy-to-clipboard";
import { computed, ref, type VNodeRef } from "vue";
import { computed, ref } from "vue";
import { useToasts } from "./toasts/toasts.vue";
import QrcodeVue from "qrcode.vue";
import Popover from "./popover.vue";
Expand Down Expand Up @@ -28,10 +28,6 @@
const modelValue = defineModel<string>({ required: true });
const emit = defineEmits<{
hidden: [];
}>();
const qrButtonRef = ref<HTMLButtonElement>();
const showQr = ref(false);
Expand Down
2 changes: 1 addition & 1 deletion server/src/export/geojson.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { jsonStream, asyncIteratorToArray, streamPromiseToStream } from "../utils/streams.js";
import { compileExpression, normalizeLineName, normalizeMarkerName, normalizePadName } from "facilmap-utils";
import { compileExpression } from "facilmap-utils";
import type { Marker, MarkerFeature, LineFeature, PadId } from "facilmap-types";
import Database from "../database/database.js";
import { cloneDeep, keyBy, mapValues, omit } from "lodash-es";
Expand Down

0 comments on commit b211800

Please sign in to comment.