BigW Consortium Gitlab

Review changes, improve editable helper spec and add hasUpdated computer to issue_show app

Fix builds by only merge when updated_at_by is presnse Fix issue_show app.vue hasUpdated reference to state Fix missing bracket
parent 07c984d8
......@@ -71,6 +71,11 @@ export default {
titleComponent,
editedComponent,
},
computed: {
hasUpdated() {
return !!this.state.updatedAt;
},
},
created() {
const resource = new Service(this.endpoint);
const poll = new Poll({
......@@ -112,7 +117,7 @@ export default {
:description-text="state.descriptionText"
:task-status="state.taskStatus" />
<edited-component
v-if="!!state.updatedAt"
v-if="hasUpdated"
:updated-at="state.updatedAt"
:updated-by-name="state.updatedByName"
:updated-by-path="state.updatedByPath"
......
......@@ -55,10 +55,10 @@
.issue-details.issuable-details
.detail-page-description.content-block
#js-issuable-app{ "data" => { "endpoint" => realtime_changes_namespace_project_issue_path(@project.namespace, @project, @issue),
"can-update" => can?(current_user, :update_issue, @issue).to_s,
"issuable-ref" => @issue.to_reference,
}.merge(updated_at_by(@issue)) }
- issuable_app_data = { "endpoint" => realtime_changes_namespace_project_issue_path(@project.namespace, @project, @issue), "can-update" => can?(current_user, :update_issue, @issue).to_s, "issuable-ref" => @issue.to_reference }
- updated_at_by = updated_at_by(@issue)
- issuable_app_data.merge(updated_at_by) if updated_at_by.present?
#js-issuable-app{ data: issuable_app_data }
%h2.title= markdown_field(@issue, :title)
- if @issue.description.present?
.description{ class: can?(current_user, :update_issue, @issue) ? 'js-task-list-container' : '' }
......
......@@ -15,8 +15,7 @@ describe EditableHelper do
}
end
it { expect(helper.updated_at_by(unedited_editable)).to eq(nil) }
it { expect(helper.updated_at_by(unedited_editable)).to be_nil }
it { expect(helper.updated_at_by(edited_editable)).to eq(edited_updated_at_by) }
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment