-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3027: Wendy/eng 2114 modeling bugs and UI issues fixing the debug panel r=wendybujalski a=wendybujalski - confirmation model for change set deletion - resources tab has a empty state graphic - code panel supports multiple code outputs Co-authored-by: wendybujalski <[email protected]>
- Loading branch information
Showing
12 changed files
with
269 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<template> | ||
<div> | ||
<template v-if="codeReqStatus.isPending"> Loading code...</template> | ||
<template v-else-if="codeReqStatus.isError"> | ||
<ErrorMessage :requestStatus="codeReqStatus" /> | ||
</template> | ||
<template v-else-if="codeReqStatus.isSuccess && selectedComponentCode"> | ||
<div v-if="selectedComponentCode[0]?.code" class="absolute inset-xs"> | ||
<template v-for="(item, index) in selectedComponentCode" :key="index"> | ||
<div v-if="item.code || item.message" class="pb-md"> | ||
<div | ||
v-if="selectedComponentCode.length > 1" | ||
class="text-lg font-bold pb-xs px-xs" | ||
> | ||
Code Output {{ index + 1 }}: | ||
</div> | ||
<ErrorMessage v-if="item.message" class="mx-1 mb-2"> | ||
{{ item.message }} | ||
</ErrorMessage> | ||
<div class="relative"> | ||
<CodeViewer v-if="item.code" :code="item.code" /> | ||
</div> | ||
</div> | ||
</template> | ||
</div> | ||
<div | ||
v-else | ||
class="flex flex-row items-center justify-center p-md text-lg italic text-neutral-500 dark:text-neutral-400" | ||
> | ||
No code generated yet | ||
</div> | ||
</template> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { computed } from "vue"; | ||
import { ErrorMessage } from "@si/vue-lib/design-system"; | ||
import { useComponentsStore } from "@/store/components.store"; | ||
import CodeViewer from "./CodeViewer.vue"; | ||
const componentsStore = useComponentsStore(); | ||
const selectedComponentId = computed( | ||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
() => componentsStore.selectedComponentId!, | ||
); | ||
const codeReqStatus = componentsStore.getRequestStatus( | ||
"FETCH_COMPONENT_CODE", | ||
selectedComponentId, | ||
); | ||
const selectedComponentCode = computed( | ||
() => componentsStore.selectedComponentCode, | ||
); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<template> | ||
<div> | ||
<dt class="uppercase text-xs italic opacity-80"> | ||
<template v-if="title">{{ title }}</template> | ||
<slot v-else name="title" /> | ||
</dt> | ||
<dd class="p-2 my-2 border-2 border-opacity-10 overflow-x-auto text-xs"> | ||
<pre><template v-if="data">{{ data }}</template><slot v-else name="data" /></pre> | ||
</dd> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { PropType } from "vue"; | ||
defineProps({ | ||
data: { | ||
type: [Object, String, Number, Boolean, null] as PropType< | ||
object | string | number | boolean | null | ||
>, | ||
}, | ||
title: { type: String }, | ||
}); | ||
</script> |
Oops, something went wrong.