Commit b89aad23 authored by Illya Klymov's avatar Illya Klymov

Merge branch '349310-wrong-last-update-time-for-project-group-view' into 'master'

Fix last update time for project in group page

See merge request gitlab-org/gitlab!77356
parents f2aa4d33 a290c395
...@@ -83,7 +83,7 @@ export default { ...@@ -83,7 +83,7 @@ export default {
<gl-badge variant="warning">{{ __('pending deletion') }}</gl-badge> <gl-badge variant="warning">{{ __('pending deletion') }}</gl-badge>
</div> </div>
<div v-if="isProject" class="last-updated"> <div v-if="isProject" class="last-updated">
<time-ago-tooltip :time="item.updatedAt" tooltip-placement="bottom" /> <time-ago-tooltip :time="item.lastActivityAt" tooltip-placement="bottom" />
</div> </div>
</div> </div>
</template> </template>
...@@ -98,6 +98,9 @@ export default class GroupsStore { ...@@ -98,6 +98,9 @@ export default class GroupsStore {
updatedAt: rawGroupItem.updated_at, updatedAt: rawGroupItem.updated_at,
pendingRemoval: rawGroupItem.marked_for_deletion, pendingRemoval: rawGroupItem.marked_for_deletion,
microdata: this.showSchemaMarkup ? getGroupItemMicrodata(rawGroupItem) : {}, microdata: this.showSchemaMarkup ? getGroupItemMicrodata(rawGroupItem) : {},
lastActivityAt: rawGroupItem.last_activity_at
? rawGroupItem.last_activity_at
: rawGroupItem.updated_at,
}; };
if (!isEmpty(rawGroupItem.compliance_management_framework)) { if (!isEmpty(rawGroupItem.compliance_management_framework)) {
......
...@@ -33,6 +33,8 @@ class GroupChildEntity < Grape::Entity ...@@ -33,6 +33,8 @@ class GroupChildEntity < Grape::Entity
end end
# Project only attributes # Project only attributes
expose :last_activity_at, if: lambda { |instance| project? }
expose :star_count, :archived, expose :star_count, :archived,
if: lambda { |_instance, _options| project? } if: lambda { |_instance, _options| project? }
......
...@@ -100,6 +100,7 @@ describe('GroupItemComponent', () => { ...@@ -100,6 +100,7 @@ describe('GroupItemComponent', () => {
wrapper.destroy(); wrapper.destroy();
group.type = 'project'; group.type = 'project';
group.lastActivityAt = '2017-04-09T18:40:39.101Z';
wrapper = createComponent({ group }); wrapper = createComponent({ group });
expect(wrapper.vm.isGroup).toBe(false); expect(wrapper.vm.isGroup).toBe(false);
......
...@@ -38,6 +38,7 @@ describe('ItemStats', () => { ...@@ -38,6 +38,7 @@ describe('ItemStats', () => {
...mockParentGroupItem, ...mockParentGroupItem,
type: ITEM_TYPE.PROJECT, type: ITEM_TYPE.PROJECT,
starCount: 4, starCount: 4,
lastActivityAt: '2017-04-09T18:40:39.101Z',
}; };
createComponent({ item }); createComponent({ item });
......
...@@ -62,6 +62,10 @@ RSpec.describe GroupChildEntity do ...@@ -62,6 +62,10 @@ RSpec.describe GroupChildEntity do
expect(json[:edit_path]).to eq(edit_project_path(object)) expect(json[:edit_path]).to eq(edit_project_path(object))
end end
it 'includes the last activity at' do
expect(json[:last_activity_at]).to be_present
end
it_behaves_like 'group child json' it_behaves_like 'group child json'
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