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