Skip to content

Commit

Permalink
Revert "feat(web-core):feedback"
Browse files Browse the repository at this point in the history
This reverts commit 53c56c2.
  • Loading branch information
CzechSebastian committed Nov 27, 2024
1 parent 53c56c2 commit d5216e1
Show file tree
Hide file tree
Showing 15 changed files with 405 additions and 31 deletions.
1 change: 1 addition & 0 deletions @xen-orchestra/lite/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"documentation": "Dokumentation",
"edit-config": "Einstellungen anpassen",
"enabled": "Aktiviert",
"error-no-data": "Fehler beim Datenabruf.",
"error-occurred": "Ein Fehler ist aufgetreten",
"export": "Exportieren",
"export-n-vms": "1 VM exportieren | {n} VMs exportieren",
Expand Down
1 change: 1 addition & 0 deletions @xen-orchestra/lite/src/locales/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"documentation": "مستندات",
"edit-config": "ویرایش پیکربندی",
"enabled": "فعال",
"error-no-data": "خطا، نمی توان داده ها را جمع آوری کرد.",
"error-occurred": "خطایی رخ داده است",
"export": "صادر کردن",
"export-n-vms": "صادر کردن 1 ماشین مجازی | {n} ماشین مجازی را صادر کنید",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<ComponentStory
v-slot="{ properties }"
:params="[prop('type').required().enum('page', 'card', 'table', 'panel').preset('card').widget()]"
:params="[prop('type').required().enum('page', 'card', 'table').preset('card').widget()]"
>
<VtsComingSoonHero v-bind="properties" />
</ComponentStory>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<ComponentStory
v-slot="{ properties }"
:params="[prop('type').required().enum('page', 'card', 'table', 'panel').preset('card').widget()]"
:params="[prop('type').required().enum('page', 'card', 'table').preset('card').widget()]"
>
<VtsErrorNoDataHero v-bind="properties" />
<VtsErrorHero v-bind="properties" />
</ComponentStory>
</template>

<script lang="ts" setup>
import ComponentStory from '@/components/component-story/ComponentStory.vue'
import { prop } from '@/libs/story/story-param'
import VtsErrorNoDataHero from '@core/components/state-hero/VtsErrorNoDataHero.vue'
import VtsErrorHero from '@core/components/state-hero/VtsErrorNoDataHero.vue'
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<ComponentStory
v-slot="{ properties, settings }"
:params="[
prop('type').required().enum('page', 'card', 'table', 'panel').preset('card').widget(),
prop('type').required().enum('page', 'card', 'table').preset('card').widget(),
prop('disabled').bool().widget(),
slot(),
setting('slotContent').preset('Content to show when loader is disabled').widget(),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<ComponentStory
v-slot="{ properties }"
:params="[prop('type').required().enum('page', 'card', 'table', 'panel').preset('card').widget()]"
:params="[prop('type').required().enum('page', 'card', 'table').preset('card').widget()]"
>
<VtsNoDataHero v-bind="properties" />
</ComponentStory>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
<template>
<ComponentStory
v-slot="{ properties }"
:params="[
prop('id').required().str().preset('123-456-789').widget(),
prop('type').required().enum('page', 'card', 'table', 'panel').preset('card').widget(),
]"
>
<ComponentStory v-slot="{ properties }" :params="[prop('id').required().str().preset('123-456-789').widget()]">
<VtsObjectNotFoundHero v-bind="properties" />
</ComponentStory>
</template>
Expand Down
375 changes: 375 additions & 0 deletions @xen-orchestra/web-core/lib/assets/error.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<VtsStateHero image="error-no-data" :type>{{ $t('error-no-data') }}</VtsStateHero>
<VtsStateHero class="vts-error-hero" image="error-no-data" :type>{{ $t('error-no-data') }}</VtsStateHero>
</template>

<script lang="ts" setup>
Expand All @@ -9,3 +9,13 @@ defineProps<{
type: StateHeroType
}>()
</script>

<style scoped lang="postcss">
.vts-error-hero {
background-color: var(--color-danger-background-selected);
:last-child {
color: var(--color-danger-txt-base);
}
}
</style>
19 changes: 7 additions & 12 deletions @xen-orchestra/web-core/lib/components/state-hero/VtsStateHero.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div :class="[type, { error }]" class="vts-state-hero">
<div :class="[type, image]" class="vts-state-hero">
<UiLoader v-if="busy" class="loader" />
<img v-else-if="imageSrc" :src="imageSrc" alt="" class="image" />
<p v-if="slots.default" :class="typoClass" class="text">
Expand All @@ -25,7 +25,6 @@ const slots = defineSlots<{
}>()
const typoClass = computed(() => (props.type === 'page' ? 'typo h2-black' : 'typo h4-medium'))
const error = computed(() => !props.busy && props.image === 'error-no-data')
const imageSrc = computed(() => {
if (!props.image) {
Expand All @@ -44,12 +43,8 @@ const imageSrc = computed(() => {
align-items: center;
justify-content: center;
&.error {
&.error-no-data {
background-color: var(--color-danger-background-selected);
.text {
color: var(--color-danger-txt-base);
}
}
.loader,
Expand Down Expand Up @@ -109,11 +104,11 @@ const imageSrc = computed(() => {
padding-top: 8rem;
.text {
order: 3;
order: 1;
}
.loader {
order: 1;
order: 3;
font-size: 6.4rem;
}
Expand All @@ -128,16 +123,16 @@ const imageSrc = computed(() => {
gap: 2.4rem;
.text {
order: 3;
order: 1;
}
.image {
order: 2;
order: 3;
max-height: 20rem;
}
.loader {
order: 1;
order: 2;
font-size: 10rem;
}
}
Expand Down
1 change: 0 additions & 1 deletion @xen-orchestra/web-core/lib/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

"dashboard": "Dashboard",
"documentation-name": "{name} Dokumentation",
"error-no-data": "Fehler beim Datenabruf.",
"fullscreen": "Vollbild",
"hosts": "Hosts",
"learn-more": "Mehr erfahren",
Expand Down
1 change: 0 additions & 1 deletion @xen-orchestra/web-core/lib/locales/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

"dashboard": "داشبورد",
"documentation-name": "اسناد {name}",
"error-no-data": "خطا، نمی توان داده ها را جمع آوری کرد.",
"fullscreen": "تمام صفحه",
"learn-more": "بیشتر بدانید",
"loading-in-progress": "بارگیری در حال انجام است…",
Expand Down
2 changes: 1 addition & 1 deletion @xen-orchestra/web/src/pages/host/[id].vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<VtsLoadingHero v-if="!isReady" type="page" />
<VtsObjectNotFoundHero v-else-if="!host" :id="route.params.id" type="page" />
<VtsObjectNotFoundHero v-else-if="!host" :id="route.params.id" />
<RouterView v-else v-slot="{ Component }">
<HostHeader :host />
<component :is="Component" :host />
Expand Down
2 changes: 1 addition & 1 deletion @xen-orchestra/web/src/pages/pool/[id].vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<VtsLoadingHero v-if="!isReady" type="page" />
<VtsObjectNotFoundHero v-else-if="!pool" :id="route.params.id" type="page" />
<VtsObjectNotFoundHero v-else-if="!pool" :id="route.params.id" />
<RouterView v-else v-slot="{ Component }">
<PoolHeader :pool />
<component :is="Component" :pool />
Expand Down
2 changes: 1 addition & 1 deletion @xen-orchestra/web/src/pages/vm/[id].vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<VtsLoadingHero v-if="!isReady" type="page" />
<VtsObjectNotFoundHero v-else-if="!vm" :id="route.params.id" type="page" />
<VtsObjectNotFoundHero v-else-if="!vm" :id="route.params.id" />
<RouterView v-else v-slot="{ Component }">
<VmHeader :vm />
<component :is="Component" :vm />
Expand Down

0 comments on commit d5216e1

Please sign in to comment.