55 <Notifications :changeSetsNeedingApproval =" changeSetsNeedingApproval" />
66 </template >
77
8- <template v-if =" featureFlagsStore .SQLITE_TOOLS " >
9- <NavbarButton icon =" odin" size =" sm" >
10- <template #dropdownContent >
11- <DropdownMenuItem
12- v-if =" props.workspaceId && props.changeSetId"
13- icon =" niflheim"
14- label =" Re-do Cold Start"
15- @click =" heimdall.muspelheim(props.workspaceId, true)"
16- />
17- <DropdownMenuItem
18- v-if =" props.workspaceId && props.changeSetId"
19- icon =" refresh"
20- label =" Rebuild Index"
21- @click =" rebuild(props.workspaceId, props.changeSetId)"
22- />
23- <DropdownMenuItem icon =" mjolnir" label =" Throw Hammer" @click =" () => modalRef.open()" />
24- <DropdownMenuItem
25- v-if =" props.changeSetId"
26- icon =" odin"
27- label =" Log Sqlite"
28- @click =" () => props.changeSetId && heimdall.odin(props.changeSetId)"
29- />
30- <DropdownMenuItem icon =" trash" label =" Bobby Drop Tables" @click =" () => heimdall.bobby()" />
31- <DropdownMenuItem
32- v-if =" props.workspaceId && props.changeSetId"
33- icon =" trash"
34- label =" Ragnarok"
35- @click ="
36- () => heimdall.ragnarok(props.workspaceId!, props.changeSetId!)
37- "
38- />
39- </template >
40- </NavbarButton >
41- </template >
8+ <SQLiteToolsButton
9+ v-if =" featureFlagsStore.SQLITE_TOOLS && !collapse"
10+ :changeSetId =" changeSetId"
11+ :workspaceId =" workspaceId"
12+ />
4213
4314 <template v-if =" ! collapse " >
4415 <NavbarButton tooltipText =" Documentation" icon =" question-circle" externalLinkTo =" https://docs.systeminit.com/" />
5223 <WorkspaceSettingsMenu />
5324 </template >
5425
55- <ProfileButton :showTopLevelMenuItems =" collapse" />
56-
57- <ApplyChangeSetButton v-if =" !invalidWorkspace" />
26+ <ProfileButton
27+ :showTopLevelMenuItems =" collapse"
28+ :changeSetId =" changeSetId"
29+ :workspaceId =" workspaceId"
30+ />
5831
59- <Modal ref =" modalRef" title =" Throw" >
60- <Stack >
61- <VormInput v-model =" entityKind" label =" Entity Kind" type =" text" />
62- <VormInput v-model =" entityId" label =" ID" type =" text" />
63- <NewButton label =" Mjolnir!" tone =" action" @click =" hammer" />
64- </Stack >
65- </Modal >
32+ <ApplyChangeSetButton
33+ v-if =" !invalidWorkspace"
34+ :squish =" windowWidthReactive < 820"
35+ />
6636 </div >
6737</template >
6838
6939<script lang="ts" setup>
70- import { computed , onBeforeUnmount , onMounted , ref } from " vue" ;
71- import { DropdownMenuItem , VormInput , Modal , Stack , NewButton } from " @si/vue-lib/design-system" ;
72- import { URLPattern , describePattern } from " @si/vue-lib" ;
40+ import { computed } from " vue" ;
7341import { useFeatureFlagsStore } from " @/store/feature_flags.store" ;
74- import * as heimdall from " @/store/realtime/heimdall" ;
75- import { sdfApiInstance } from " @/store/apis.web" ;
76- import { ChangeSetId , ChangeSet } from " @/api/sdf/dal/change_set" ;
77- import { EntityKind } from " @/workers/types/entity_kind_types" ;
42+ import { ChangeSet } from " @/api/sdf/dal/change_set" ;
7843import ApplyChangeSetButton from " @/newhotness/ApplyChangeSetButton.vue" ;
7944import NavbarButton from " @/components/layout/navbar/NavbarButton.vue" ;
8045import Collaborators from " ./Collaborators.vue" ;
8146import Notifications from " ./Notifications.vue" ;
8247import WorkspaceSettingsMenu from " ./WorkspaceSettingsMenu.vue" ;
8348import ProfileButton from " ./ProfileButton.vue" ;
49+ import SQLiteToolsButton from " ./SQLiteToolsButton.vue" ;
50+ import { windowWidthReactive } from " ../logic_composables/emitters" ;
8451
8552const props = defineProps <{
8653 changeSetId: string ;
@@ -90,43 +57,5 @@ const props = defineProps<{
9057}>();
9158
9259const featureFlagsStore = useFeatureFlagsStore ();
93- const modalRef = ref ();
94- const entityId = ref (" " );
95- const entityKind = ref (" " );
96-
97- const windowWidth = ref (window .innerWidth );
98- const collapse = computed (() => windowWidth .value < 1200 );
99-
100- const windowResizeHandler = () => {
101- windowWidth .value = window .innerWidth ;
102- };
103-
104- const rebuild = (workspaceId : string , changeSetId : ChangeSetId ) => {
105- const pattern = [
106- " v2" ,
107- " workspaces" ,
108- { workspaceId },
109- " change-sets" ,
110- { changeSetId },
111- " index" ,
112- " rebuild" ,
113- ] as URLPattern ;
114- const [url] = describePattern (pattern );
115- sdfApiInstance .post (url );
116- };
117-
118- const hammer = () => {
119- if (props .workspaceId && props .changeSetId ) {
120- heimdall .mjolnir (props .workspaceId , props .changeSetId , entityKind .value as EntityKind , entityId .value );
121- modalRef .value .close ();
122- }
123- };
124-
125- onMounted (() => {
126- windowResizeHandler ();
127- window .addEventListener (" resize" , windowResizeHandler );
128- });
129- onBeforeUnmount (() => {
130- window .removeEventListener (" resize" , windowResizeHandler );
131- });
60+ const collapse = computed (() => windowWidthReactive .value < 1200 );
13261 </script >
0 commit comments