UX: Unify reviewable scores + history
This commit is contained in:
parent
103918af0f
commit
9ebfdaa356
|
@ -30,10 +30,7 @@
|
||||||
</div>
|
</div>
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#component reviewableComponent reviewable=reviewable tagName=''}}
|
{{#component reviewableComponent reviewable=reviewable tagName=''}}
|
||||||
<div class='reviewable-scores-and-history'>
|
{{reviewable-scores reviewable=reviewable tagName=''}}
|
||||||
{{reviewable-scores reviewable=reviewable tagName=''}}
|
|
||||||
{{reviewable-histories histories=reviewable.reviewable_histories tagName=''}}
|
|
||||||
</div>
|
|
||||||
{{/component}}
|
{{/component}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
<tr class='reviewable-score'>
|
<tr class='reviewable-score'>
|
||||||
|
<td>
|
||||||
|
{{format-date rs.created_at}}
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{{d-icon rs.score_type.icon}}
|
{{d-icon rs.score_type.icon}}
|
||||||
{{title}}
|
{{title}}
|
||||||
|
@ -9,8 +12,6 @@
|
||||||
{{avatar rs.user imageSize="tiny"}}
|
{{avatar rs.user imageSize="tiny"}}
|
||||||
{{rs.user.username}}
|
{{rs.user.username}}
|
||||||
{{/user-link}}
|
{{/user-link}}
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
{{user-flag-percentage
|
{{user-flag-percentage
|
||||||
agreed=rs.agree_stats.agreed
|
agreed=rs.agree_stats.agreed
|
||||||
disagreed=rs.agree_stats.disagreed
|
disagreed=rs.agree_stats.disagreed
|
||||||
|
@ -19,10 +20,21 @@
|
||||||
<td>
|
<td>
|
||||||
{{reviewable-status rs.status}}
|
{{reviewable-status rs.status}}
|
||||||
</td>
|
</td>
|
||||||
|
<td class='reviewed-by'>
|
||||||
|
{{#if rs.reviewed_by}}
|
||||||
|
{{#user-link user=rs.reviewed_by}}
|
||||||
|
{{avatar rs.reviewed_by imageSize="tiny"}}
|
||||||
|
{{rs.reviewed_by.username}}
|
||||||
|
{{/user-link}}
|
||||||
|
{{format-date rs.reviewed_at}}
|
||||||
|
{{else}}
|
||||||
|
—
|
||||||
|
{{/if}}
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{{#if rs.reviewable_conversation}}
|
{{#if rs.reviewable_conversation}}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan='3'>
|
<td colspan='4'>
|
||||||
<div class='reviewable-conversation'>
|
<div class='reviewable-conversation'>
|
||||||
{{#each rs.reviewable_conversation.conversation_posts as |p index|}}
|
{{#each rs.reviewable_conversation.conversation_posts as |p index|}}
|
||||||
{{reviewable-conversation-post post=p index=index}}
|
{{reviewable-conversation-post post=p index=index}}
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
{{#if reviewable.reviewable_scores}}
|
{{#if reviewable.reviewable_scores}}
|
||||||
<table class='reviewable-scores'>
|
<table class='reviewable-scores'>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{{i18n "review.scores.date"}}</th>
|
||||||
|
<th>{{i18n "review.scores.type"}}</th>
|
||||||
|
<th>{{i18n "review.scores.submitted_by"}}</th>
|
||||||
|
<th>{{i18n "review.scores.status"}}</th>
|
||||||
|
<th>{{i18n "review.scores.reviewed_by"}}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{#each reviewable.reviewable_scores as |rs|}}
|
{{#each reviewable.reviewable_scores as |rs|}}
|
||||||
{{reviewable-score rs=rs reviewable=reviewable}}
|
{{reviewable-score rs=rs reviewable=reviewable}}
|
||||||
|
|
|
@ -224,15 +224,15 @@
|
||||||
margin-top: 1em;
|
margin-top: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
.reviewable-scores-and-history {
|
|
||||||
display: inline-block;
|
|
||||||
margin-top: 1em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.reviewable-scores,
|
.reviewable-scores,
|
||||||
.reviewable-histories {
|
.reviewable-histories {
|
||||||
min-width: 50%;
|
min-width: 50%;
|
||||||
|
|
||||||
|
.reviewed-by {
|
||||||
|
.date {
|
||||||
|
margin-left: 0.5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
.user {
|
.user {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
@ -251,6 +251,11 @@
|
||||||
line-height: $line-height-medium;
|
line-height: $line-height-medium;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
thead {
|
||||||
|
th {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
}
|
||||||
tbody {
|
tbody {
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
td {
|
td {
|
||||||
|
@ -268,7 +273,7 @@
|
||||||
}
|
}
|
||||||
> tr > th,
|
> tr > th,
|
||||||
> tr > td {
|
> tr > td {
|
||||||
padding: 0.5em;
|
padding: 0.5em 1em 0.5em 0.5em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,7 +180,8 @@ protected
|
||||||
def meta_types
|
def meta_types
|
||||||
{
|
{
|
||||||
created_by: 'user',
|
created_by: 'user',
|
||||||
target_created_by: 'user'
|
target_created_by: 'user',
|
||||||
|
reviewed_by: 'user'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,11 @@ require_dependency 'reviewable_score_type_serializer'
|
||||||
|
|
||||||
class ReviewableScoreSerializer < ApplicationSerializer
|
class ReviewableScoreSerializer < ApplicationSerializer
|
||||||
|
|
||||||
attributes :id, :score, :agree_stats, :status
|
attributes :id, :score, :agree_stats, :status, :created_at, :reviewed_at
|
||||||
has_one :user, serializer: BasicUserSerializer, root: 'users'
|
has_one :user, serializer: BasicUserSerializer, root: 'users'
|
||||||
has_one :score_type, serializer: ReviewableScoreTypeSerializer
|
has_one :score_type, serializer: ReviewableScoreTypeSerializer
|
||||||
has_one :reviewable_conversation, serializer: ReviewableConversationSerializer
|
has_one :reviewable_conversation, serializer: ReviewableConversationSerializer
|
||||||
|
has_one :reviewed_by, serializer: BasicUserSerializer, root: 'users'
|
||||||
|
|
||||||
def agree_stats
|
def agree_stats
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,7 +25,6 @@ class ReviewableSerializer < ApplicationSerializer
|
||||||
has_many :editable_fields, serializer: ReviewableEditableFieldSerializer, embed: :objects
|
has_many :editable_fields, serializer: ReviewableEditableFieldSerializer, embed: :objects
|
||||||
has_many :reviewable_scores, serializer: ReviewableScoreSerializer
|
has_many :reviewable_scores, serializer: ReviewableScoreSerializer
|
||||||
has_many :bundled_actions, serializer: ReviewableBundledActionSerializer
|
has_many :bundled_actions, serializer: ReviewableBundledActionSerializer
|
||||||
has_many :reviewable_histories, serializer: ReviewableHistorySerializer
|
|
||||||
|
|
||||||
# Used to keep track of our payload attributes
|
# Used to keep track of our payload attributes
|
||||||
class_attribute :_payload_for_serialization
|
class_attribute :_payload_for_serialization
|
||||||
|
|
|
@ -426,13 +426,13 @@ en:
|
||||||
category: "Category:"
|
category: "Category:"
|
||||||
conversation:
|
conversation:
|
||||||
view_full: "view full conversation"
|
view_full: "view full conversation"
|
||||||
history:
|
|
||||||
title: "History"
|
|
||||||
edited: "Edited"
|
|
||||||
scores:
|
scores:
|
||||||
description: "Description"
|
date: "Date"
|
||||||
score: "Score"
|
type: "Type"
|
||||||
|
status: "Status"
|
||||||
submitted_by: "Submitted By"
|
submitted_by: "Submitted By"
|
||||||
|
reviewed_by: "Reviewed By"
|
||||||
|
|
||||||
statuses:
|
statuses:
|
||||||
pending:
|
pending:
|
||||||
title: "Pending"
|
title: "Pending"
|
||||||
|
|
Loading…
Reference in New Issue