Commit bac5b68d authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'mw-group-activity-analytics-skeleton' into 'master'

Frontend skeleton for Group-level activity overview

See merge request gitlab-org/gitlab!26649
parents 0787dd39 703019de
......@@ -11,6 +11,8 @@
= render_if_exists 'groups/self_or_ancestor_marked_for_deletion_notice', group: @group
= render_if_exists 'groups/group_activity_analytics', group: @group
.groups-listing{ data: { endpoints: { default: group_children_path(@group, format: :json), shared: group_shared_projects_path(@group, format: :json) } } }
.top-area.group-nav-container.justify-content-between
.scrolling-tabs-container.inner-page-scroll-tabs
......
<script>
export default {
name: 'GroupActivityCard',
props: {
groupFullPath: {
type: String,
required: true,
},
},
};
</script>
<template>
<div></div>
</template>
import Vue from 'vue';
import GroupActivityCard from './components/group_activity_card.vue';
export default () => {
const container = document.getElementById('js-group-activity');
if (!container) return;
const { groupFullPath } = container.dataset;
// eslint-disable-next-line no-new
new Vue({
el: container,
render(h) {
return h(GroupActivityCard, {
props: {
groupFullPath,
},
});
},
});
};
import initSecurityDashboard from 'ee/security_dashboard/index';
import leaveByUrl from '~/namespaces/leave_by_url';
import initGroupDetails from '~/pages/groups/shared/group_details';
import initGroupAnalytics from 'ee/analytics/group_analytics/group_analytics_bundle';
document.addEventListener('DOMContentLoaded', () => {
leaveByUrl('group');
......@@ -10,4 +11,6 @@ document.addEventListener('DOMContentLoaded', () => {
} else {
initGroupDetails();
}
initGroupAnalytics();
});
- return unless show_group_activity_analytics?
#js-group-activity{ data: { group_full_path: @group.full_path } }
# frozen_string_literal: true
require 'spec_helper'
describe 'GroupAnalytics' do
let_it_be(:user) { create(:user) }
let_it_be(:group) { create(:group) }
let(:path) { group_path(group) }
before do
stub_licensed_features(group_activity_analytics: true)
sign_in(user)
end
context 'when the feature is enabled' do
it 'renders the container' do
visit path
expect(page).to have_css('#js-group-activity')
end
end
context 'when the feature is disabled' do
before do
stub_feature_flags(group_activity_analytics: false)
end
it 'does not render the container' do
visit path
expect(page).not_to have_css('#js-group-activity')
end
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