Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid Generator Version 2 #8

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
chore: more cleanup
foosint authored and GalenReich committed Aug 7, 2024

Verified

This commit was signed with the committer’s verified signature.
jschlyter Jakob Schlyter
commit bfecb9ff2b95c6a49e565bc43a3eb21e0b50631e
12 changes: 1 addition & 11 deletions src/components/Form.vue
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
</template>

<script setup>
import { computed, reactive, watch } from 'vue';
import { reactive, watch } from 'vue';
import GridSizeSlider from './GridSizeSlider.vue';
import { cleanCoordinate } from '@/lib/misc';
import { useCoordinatesStore } from '@/stores/coordinatesStore';
@@ -52,12 +52,6 @@ watch(
{ deep: true },
);
// Object to store validation errors
const errors = reactive({
c1: '',
c2: '',
});
// Validation rules
const validateCoordinate = (key, value) => {
const { coordinate, error } = cleanCoordinate(value);
@@ -81,8 +75,4 @@ const validateCoordinate = (key, value) => {
// console.log('validation error, no update');
}
};
const hasErrors = computed(() =>
Object.values(errors).some((error) => error !== ''),
);
</script>
2 changes: 1 addition & 1 deletion src/components/Map.vue
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ watch(
// if booth are not null, clean map, create new drawing based on given coordinates
const { c1, c2 } = newCoordinates;
if (c1 !== '' && c2 !== '') {
console.log('received 2 valid coordinates, draw a new polygon');
// console.log('received 2 valid coordinates, draw a new polygon');
const p1 = c1.split(',');
const p2 = c2.split(',');
onCustomCoordinates(p1, p2);