-
Notifications
You must be signed in to change notification settings - Fork 0
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
Updates for namespace section #128
Conversation
7ea336a
to
b141d12
Compare
b1bd6b2
to
c408233
Compare
b138af1
to
2b96c94
Compare
90428f9
to
bf93afd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looking good! Just a few minor things 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming Rob's ok with the model change, yeah?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we discussed this in a lingo standup, but I'll cc @robgaston just to make sure he's aware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, all good!
@@ -0,0 +1,22 @@ | |||
<script lang="ts"> | |||
const UPDATE = "update"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah please roll back the declaring of emit values as constants. Much rather not have the two script tags
</script> | ||
<template> | ||
<div> | ||
<div v-if="!props.mode || props.mode === 'view'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would, however, recommend declaring view
and edit
as consts
@@ -0,0 +1,27 @@ | |||
<script lang="ts"> | |||
const UPDATE = "update"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same. please roll back the string-as-const so there's not two script tags.
@@ -17,37 +43,94 @@ const toggleSize = () => { | |||
emit("side"); | |||
} | |||
}; | |||
|
|||
schemeComponents.map((x) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm typically against single-letter declarations as it makes the code harder to read.
@@ -17,37 +43,94 @@ const toggleSize = () => { | |||
emit("side"); | |||
} | |||
}; | |||
|
|||
schemeComponents.map((x) => { | |||
x.props.mode = "edit"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
declare edit
as a const?
props: { | ||
mode: editMode, | ||
}, | ||
on: { | ||
update: onUpdated, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these may not need to be part of the component config if we expect every component to have the same props/on
logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair, I'll keep it simple till we need otherwise.
const save = async () => { | ||
await updateSchemeNamespace( | ||
route.params.id as string, | ||
schemeNamespace.value as SchemeNamespace, | ||
); | ||
}; | ||
const getSectionValue = async () => { | ||
const response = await fetchSchemeNamespace(route.params.id as string); | ||
schemeNamespace.value = response; | ||
}; | ||
|
||
defineExpose({ save, getSectionValue }); | ||
|
||
onMounted(async () => { | ||
getSectionValue(); | ||
}); | ||
|
||
const onNamespaceNameUpdate = (val: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say declare all functions with function foo()
declarations, and put them on the bottom of the script tag so they're not mixed in with onMounted
and defineExpose
. There's an ordering of stuff in the script tag that I haven't promulgated yet, but for the time being IMO we should still be writing for readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough
@@ -1,5 +1,5 @@ | |||
import type { InjectionKey, Ref } from "vue"; | |||
import type { Language } from "@/arches_vue_utils/types"; | |||
import type { Language } from "@/arches_vue_utils/types.ts"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
00ddb33
to
d077e81
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good, just a few smaller things now
const VIEW = "view"; | ||
const EDIT = "edit"; | ||
|
||
type DataComponentMode = "edit" | "view"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, use the declared consts
import NonLocalizedStringViewer from "@/arches_lingo/components/generic/NonLocalizedStringViewer.vue"; | ||
import NonLocalizedStringEditor from "@/arches_lingo/components/generic/NonLocalizedStringEditor.vue"; | ||
|
||
type DataComponentMode = "edit" | "view"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with the declaring consts here
mode?: DataComponentMode; | ||
}>(); | ||
|
||
defineEmits([OPEN_EDITOR]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, please revert OPEN_EDITOR
to a string so there's no double-script-tag
|
||
<template> | ||
<div> | ||
<div v-if="!mode || mode === 'view'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: same with declaring the string as a const here and with edit
90eccf0
to
95a97c5
Compare
95a97c5
to
eb1fce7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! 🚀
Form based editing of the namespace name (non-localized string)