Skip to content

Commit

Permalink
fix it so tags hang in there
Browse files Browse the repository at this point in the history
  • Loading branch information
alnutile committed Aug 21, 2023
1 parent d9b0f6d commit 4d46fed
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/MessageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public function edit(Message $message)
{
return inertia('Messages/Edit', [
'message' => new MessageResource($message),
'tags' => Tag::orderBy('label')->get(),
'meta_data' => MetaData::query()->where('user_id', auth()->user()->id)->get(),
]);
}
Expand Down
1 change: 1 addition & 0 deletions config/copy.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
return [
'messages' => [
'create_info' => 'Start your thread. Then when you click save the LLM will start to reply to you.',
'update_info' => 'Update the thread, this will trigger a new build and remove all previous replies',
'show_info' => 'You can trigger the query or reply to get more info. Below this area you will see scheduled tasks and more',
],
'meta_data' => [
Expand Down
20 changes: 17 additions & 3 deletions resources/js/Pages/Messages/Edit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,21 @@
<div class="mx-auto grid max-w-2xl grid-cols-1 grid-rows-1 items-start gap-x-8 gap-y-8 lg:mx-0 lg:max-w-none lg:grid-cols-3">
<div class="lg:col-start-3 lg:row-end-1 rounded p-4">
<div class="lg:col-start-3 lg:row-end-1 rounded border-gray-200 border dark:border-gray-500 p-4">
<HTwo>Start your Thread</HTwo>
<Copy section="messages" copy="create_info"/>
<HTwo>Update your Thread</HTwo>
<Copy section="messages" copy="update_info"/>
</div>
<div class="mt-4">
<HTwo>Attach some meta Data</HTwo>
<Picker @selectedEmit="selectedEmit"
:selected="form.meta_data"
:selectables="meta_data"></Picker>
</div>
<div class="mt-4">
<HTwo>Attach Tags</HTwo>
<TagPicker @selectedEmit="selectedTagEmit"
:selected="form.tags"
:selectables="tags"></TagPicker>
</div>
</div>
<div class="-mx-4 px-4 py-8 shadow-sm ring-1 ring-gray-900/5 sm:mx-0 sm:rounded-lg sm:px-8 sm:pb-14 lg:col-span-2 lg:row-span-2 lg:row-end-2 xl:px-16 xl:pb-20 xl:pt-2">
<form @submit.prevent="submit">
Expand Down Expand Up @@ -47,6 +53,7 @@ import Copy from "@/Components/Copy.vue";
import HTwo from "@/Components/HTwo.vue";
import InputLabel from "@/Components/InputLabel.vue";
import Picker from "@/Pages/MetaData/Components/Picker.vue";
import TagPicker from "@/Components/Picker.vue";
import TextArea from "@/Components/TextArea.vue";
import {useForm} from "@inertiajs/vue3";
import InputError from "@/Components/InputError.vue";
Expand All @@ -61,12 +68,14 @@ const toast = useToast();
const props = defineProps({
meta_data: Array,
tags: Array,
message: Object
})
const form = useForm({
content: props.message.data.content,
meta_data: props.message.data.meta_data
meta_data: props.message.data.meta_data,
tags: props.message.data.tags
})
const submit = () => {
Expand All @@ -80,6 +89,11 @@ const submit = () => {
});
}
const selectedTagEmit = (item) => {
console.log(item)
form.tags = item;
}
const selectedEmit = (item) => {
console.log(item)
form.meta_data = item;
Expand Down

0 comments on commit 4d46fed

Please sign in to comment.