Show org stats on organisation page (#18618)
* Add org details * Added org stat test * Nit fix
This commit is contained in:
parent
b482c4215e
commit
926d9f2125
4 changed files with 52 additions and 0 deletions
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue