Skip to content

Commit

Permalink
nit #209
Browse files Browse the repository at this point in the history
  • Loading branch information
chrabyrd committed Feb 27, 2025
1 parent 525c922 commit a281dd4
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const confirm = useConfirm();
const openEditor =
inject<(componentName: string, tileid?: string) => void>("openEditor");
const forceSectionRefresh = inject<(componentName: string) => void>(
"forceSectionRefresh",
const refreshReportSection = inject<(componentName: string) => void>(
"refreshReportSection",
);
const expandedRows = ref([]);
Expand Down Expand Up @@ -57,7 +57,7 @@ async function deleteSectionValue(tileId: string) {
try {
await deleteLingoTile(props.graphSlug, props.nodegroupAlias, tileId);
forceSectionRefresh!(props.componentName);
refreshReportSection!(props.componentName);
openEditor!(props.componentName, undefined);
} catch (error) {
console.error(error);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const router = useRouter();
const schemeEditorFormRef = inject<Ref<Component | null>>(
"schemeEditorFormRef",
);
const forceSectionRefresh = inject<(componentName: string) => void>(
"forceSectionRefresh",
const refreshReportSection = inject<(componentName: string) => void>(
"refreshReportSection",
);
const formRef = useTemplateRef("form");
Expand Down Expand Up @@ -72,15 +72,15 @@ async function save(e: FormSubmitEvent) {
);
}
forceSectionRefresh!(props.componentName);
refreshReportSection!(props.componentName);
} catch (error) {
console.error(error);
}
}
</script>

<template>
<h4>{{ props.sectionTitle }}</h4>
<h3>{{ props.sectionTitle }}</h3>

<Form
ref="form"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ const metaStringLabel: MetaStringText = {
<div class="section-header">
<h2>{{ props.sectionTitle }}</h2>

<div>
<Button
:label="$gettext('Add New Scheme Label')"
@click="openEditor!(props.componentName)"
></Button>
</div>
<Button
:label="$gettext('Add New Scheme Label')"
@click="openEditor!(props.componentName)"
></Button>
</div>

<MetaStringViewer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const props = defineProps<{
const schemeEditorFormRef = inject<Ref<Component | null>>(
"schemeEditorFormRef",
);
const forceSectionRefresh = inject<(componentName: string) => void>(
"forceSectionRefresh",
const refreshReportSection = inject<(componentName: string) => void>(
"refreshReportSection",
);
const formRef = useTemplateRef("form");
Expand Down Expand Up @@ -68,15 +68,15 @@ async function save(e: FormSubmitEvent) {
);
}
forceSectionRefresh!(props.componentName);
refreshReportSection!(props.componentName);
} catch (error) {
console.error(error);
}
}
</script>

<template>
<h4>{{ props.sectionTitle }}</h4>
<h3>{{ props.sectionTitle }}</h3>

<Form
ref="form"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@ const buttonLabel = computed(() => {
<div class="section-header">
<h2>{{ props.sectionTitle }}</h2>

<div>
<Button
:label="buttonLabel"
@click="
openEditor!(props.componentName, props.tileData?.tileid)
"
></Button>
</div>
<Button
:label="buttonLabel"
@click="openEditor!(props.componentName, props.tileData?.tileid)"
></Button>
</div>

<NonLocalizedStringWidget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ const router = useRouter();
const schemeEditorFormRef = inject<Ref<Component | null>>(
"schemeEditorFormRef",
);
const forceSectionRefresh = inject<(componentName: string) => void>(
"forceSectionRefresh",
const refreshReportSection = inject<(componentName: string) => void>(
"refreshReportSection",
);
const formRef = useTemplateRef("form");
Expand Down Expand Up @@ -73,15 +73,15 @@ async function save(e: FormSubmitEvent) {
);
}
forceSectionRefresh!(props.componentName);
refreshReportSection!(props.componentName);
} catch (error) {
console.error(error);
}
}
</script>

<template>
<h4>{{ props.sectionTitle }}</h4>
<h3>{{ props.sectionTitle }}</h3>

<Form
ref="form"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ const metaStringLabel: MetaStringText = {
<div class="section-header">
<h2>{{ props.sectionTitle }}</h2>

<div>
<Button
:label="$gettext('Add New Scheme Note')"
@click="openEditor!(props.componentName)"
></Button>
</div>
<Button
:label="$gettext('Add New Scheme Note')"
@click="openEditor!(props.componentName)"
></Button>
</div>

<MetaStringViewer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const props = defineProps<{
}>();
const isLoading = ref(false);
const tileData = ref<SchemeCreation[]>([]);
const tileData = ref<SchemeCreation>();
const shouldCreateNewTile = Boolean(props.mode === EDIT && !props.tileId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const props = defineProps<{
const schemeEditorFormRef = inject<Ref<Component | null>>(
"schemeEditorFormRef",
);
const forceSectionRefresh = inject<(componentName: string) => void>(
"forceSectionRefresh",
const refreshReportSection = inject<(componentName: string) => void>(
"refreshReportSection",
);
const formRef = useTemplateRef("form");
Expand Down Expand Up @@ -68,15 +68,15 @@ async function save(e: FormSubmitEvent) {
);
}
forceSectionRefresh!(props.componentName);
refreshReportSection!(props.componentName);
} catch (error) {
console.error(error);
}
}
</script>

<template>
<h4>{{ props.sectionTitle }}</h4>
<h3>{{ props.sectionTitle }}</h3>

<Form
ref="form"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@ const buttonLabel = computed(() => {
<div class="section-header">
<h2>{{ props.sectionTitle }}</h2>

<div>
<Button
:label="buttonLabel"
@click="
openEditor!(props.componentName, props.tileData?.tileid)
"
></Button>
</div>
<Button
:label="buttonLabel"
@click="openEditor!(props.componentName, props.tileData?.tileid)"
></Button>
</div>

<ResourceInstanceMultiSelectWidget
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function resetForm() {
<template>
<div class="container">
<div class="header">
<h3>{{ $gettext("Editor Tools") }}</h3>
<h2>{{ $gettext("Editor Tools") }}</h2>

<div>
<Button
Expand Down
8 changes: 4 additions & 4 deletions arches_lingo/src/arches_lingo/pages/SchemePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ import {
VIEW,
} from "@/arches_lingo/constants.ts";
provide("openEditor", openEditor);
provide("forceSectionRefresh", forceSectionRefresh);
const route = useRoute();
const { $gettext } = useGettext();
Expand Down Expand Up @@ -106,7 +103,7 @@ function minimizeEditor() {
editorState.value = MINIMIZED;
}
function forceSectionRefresh(componentName: string) {
function refreshReportSection(componentName: string) {
const componentDatum = componentData.value.find((componentDatum) => {
return componentDatum.componentName === componentName;
});
Expand All @@ -115,6 +112,9 @@ function forceSectionRefresh(componentName: string) {
componentDatum.key += 1;
}
}
provide("openEditor", openEditor);
provide("refreshReportSection", refreshReportSection);
</script>

<template>
Expand Down

0 comments on commit a281dd4

Please sign in to comment.