Show org stats on organisation page (#18618)

* Add org details

* Added org stat test

* Nit fix
This commit is contained in:
Rajat Talesra 2022-10-25 20:27:54 +05:30 committed by GitHub
parent b482c4215e
commit 926d9f2125
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 52 additions and 0 deletions

View file

@ -21,5 +21,17 @@
</div>
</div>
<% end %>
<% if @organization.users.any? %>
<div class="widget">
<div class="widget-body">
<%= crayons_icon_tag(:post, class: "mr-3 color-base", title: t("views.organizations.side.post.icon")) %>
<%= t "views.organizations.side.post.text", count: @stories.size %>
</div>
<div class="widget-body mt-4">
<%= crayons_icon_tag(:team, class: "mr-3 color-base", title: t("views.organizations.side.member.icon")) %>
<%= t "views.organizations.side.member.text", count: @organization.users.size %>
</div>
</div>
<% end %>
</div>
</div>

View file

@ -26,6 +26,17 @@ en:
devrel: Devrel
stack: our stack
story: our story
side:
post:
icon: Post
text:
one: 1 post published
other: "%{count} posts published"
member:
icon: Member
text:
one: 1 member
other: "%{count} members"
support: Support email
team: meet the team
twitter:

View file

@ -26,6 +26,17 @@ fr:
devrel: Devrel
stack: our stack
story: our story
side:
post:
icon: Post
text:
one: 1 post published
other: "%{count} posts published"
member:
icon: Member
text:
one: 1 member
other: "%{count} members"
support: Support email
team: meet the team
twitter:

View file

@ -0,0 +1,18 @@
describe('Check stats from organisation profile page', () => {
beforeEach(() => {
cy.testSetup();
cy.fixture('users/adminUser.json').as('user');
cy.get('@user').then((user) => {
cy.loginAndVisit(user, '/bachmanity');
cy.get('[data-follow-clicks-initialized]');
});
});
it('should show posts published stats', () => {
cy.findByText('1 post published').should('be.visible');
});
it('should show members count', () => {
cy.findByText('2 members').should('be.visible');
});
});