Move review to separate model
This commit is contained in:
@@ -8,7 +8,7 @@ const props = defineProps<{
|
||||
points: number;
|
||||
extraPoints: number | null;
|
||||
answer?: {
|
||||
score: number | null;
|
||||
review?: { score: number | null } | null;
|
||||
} | null;
|
||||
};
|
||||
}>();
|
||||
@@ -18,8 +18,8 @@ const props = defineProps<{
|
||||
<span>{{ quest.pictureRequired ? '📸' : '📷' }}</span>
|
||||
<span title="aaa">{{ quest.textRequired ? '❓' : '❔' }}</span>
|
||||
<span class="mx-2">{{ quest.title }}</span>
|
||||
<VaChip v-if="quest.answer?.score" color="success" class="float-right"
|
||||
>{{ quest.answer?.score || 0 }} / {{ quest.points
|
||||
<VaChip v-if="quest.answer?.review?.score" color="success" class="float-right"
|
||||
>{{ quest.answer?.review?.score || 0 }} / {{ quest.points
|
||||
}}{{ quest.extraPoints ? `+${quest.extraPoints}` : '' }}</VaChip
|
||||
>
|
||||
<VaChip v-else class="float-right"
|
||||
|
||||
@@ -6,13 +6,16 @@ const props = defineProps<{
|
||||
text: string | null;
|
||||
updatedAt: string;
|
||||
team: { id: number; name: string };
|
||||
score: number | null;
|
||||
review: string | null;
|
||||
reviewer: { name: string; id: number } | null;
|
||||
final: boolean;
|
||||
review: {
|
||||
internalNote: string | null;
|
||||
rankingValue: number | null;
|
||||
showcase: boolean;
|
||||
score: number | null;
|
||||
review: string | null;
|
||||
reviewer: { name: string; id: number } | null;
|
||||
} | null;
|
||||
member: { name: string; id: number } | null;
|
||||
internalNote: string | null;
|
||||
rankingValue: number | null;
|
||||
showcase: boolean;
|
||||
picture: {
|
||||
url: string;
|
||||
createdAt: string;
|
||||
@@ -35,23 +38,26 @@ const header = computed(() => {
|
||||
props.answer.picture?.url ? '📸✅' : '📷❌',
|
||||
props.answer.text ? '📝✅' : '📝❌',
|
||||
props.answer.review ? '🔍✅' : '🔍❌',
|
||||
props.answer.score ?? 'No points',
|
||||
props.answer.review?.score ?? 'No points',
|
||||
d(props.answer.updatedAt, {
|
||||
dateStyle: 'medium',
|
||||
timeStyle: 'medium'
|
||||
}),
|
||||
props.answer.rankingValue,
|
||||
props.answer.showcase ? '★' : null
|
||||
props.answer.review?.rankingValue,
|
||||
props.answer.review?.showcase ? '★' : null
|
||||
];
|
||||
|
||||
return parts.filter((s) => !!s).join(' – ');
|
||||
});
|
||||
|
||||
const style = computed<[string, string]>(() => {
|
||||
if (props.answer.review && props.answer.score !== null) {
|
||||
if (props.answer.review?.review && props.answer.review?.score !== null) {
|
||||
return ['success', 'check'];
|
||||
}
|
||||
if (props.answer.review || props.answer.score !== null) {
|
||||
if (!props.answer.final) {
|
||||
return ['', ''];
|
||||
}
|
||||
if (props.answer.review?.review || props.answer.review?.score !== null) {
|
||||
return ['danger', 'priority_high'];
|
||||
}
|
||||
if (
|
||||
@@ -71,6 +77,7 @@ const style = computed<[string, string]>(() => {
|
||||
<div
|
||||
class="mb-2 grid grid-cols-3 justify-between gap-8 rounded-lg bg-gray-200 p-4 font-bold md:grid-cols-6"
|
||||
>
|
||||
<p v-if="!answer.final">NOT FINAL</p>
|
||||
<p>
|
||||
{{
|
||||
answer.picture?.url ? '📸✅ Picture done' : '📷❌ Picture missing'
|
||||
@@ -80,14 +87,14 @@ const style = computed<[string, string]>(() => {
|
||||
<p>
|
||||
{{ answer.review ? '🔍✅ Review done' : '🔍❌ Review missing' }}
|
||||
</p>
|
||||
<p v-if="answer.rankingValue">
|
||||
<p v-if="answer.review?.rankingValue">
|
||||
<VaIcon name="leaderboard" color="primary" />
|
||||
{{ answer.rankingValue }}
|
||||
{{ answer.review?.rankingValue }}
|
||||
</p>
|
||||
<p v-if="answer.showcase">
|
||||
<p v-if="answer.review?.showcase">
|
||||
<VaIcon name="auto_awesome" color="warning" /> Showcase
|
||||
</p>
|
||||
<p>{{ answer.score ?? 'No' }} points</p>
|
||||
<p>{{ answer.review?.score ?? 'No' }} points</p>
|
||||
</div>
|
||||
<ClickableImage
|
||||
v-if="answer.picture?.url"
|
||||
|
||||
@@ -21,7 +21,7 @@ const newUser = ref<User>();
|
||||
watchDebounced(
|
||||
search,
|
||||
(newSearch) => {
|
||||
if (newSearch && newSearch.length >= 3) {
|
||||
if (newSearch) {
|
||||
safeSearch.value = newSearch;
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user