Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2148] Show tags on the ramp chart #2163

Merged
merged 30 commits into from
Apr 27, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
356846a
show all tags of repo
jonasongg Mar 18, 2024
82a3c20
add checkbox to toggle showing of repo tags
jonasongg Mar 18, 2024
ed0f2a5
add newline
jonasongg Mar 18, 2024
a4f3d41
fix lint
jonasongg Mar 18, 2024
05e2ba6
change view repo tags checkbox to show tags
jonasongg Mar 22, 2024
4989606
update documentation
jonasongg Mar 25, 2024
c22f1cf
add tests for show tags on ramp chart
jonasongg Mar 25, 2024
154d624
add show tags test
jonasongg Mar 25, 2024
feeb20a
add link to tags in show tags
jonasongg Mar 30, 2024
dea2fe5
add test for redirecting to opening tag
jonasongg Mar 30, 2024
fea42a1
fix lint
jonasongg Mar 30, 2024
ee8c74c
fix show tags when sort by authors
jonasongg Apr 6, 2024
c4a4b02
add view repo tags to the hash
jonasongg Apr 6, 2024
3b17857
fix logic for getting tags
jonasongg Apr 6, 2024
9347db8
fix lint
jonasongg Apr 10, 2024
0e177cb
Merge remote-tracking branch 'upstream/master' into add-show-tags-on-…
jonasongg Apr 10, 2024
875c335
extract showTags v-ifs into computed booleans
jonasongg Apr 15, 2024
dcc5a73
Merge remote-tracking branch 'upstream/master' into add-show-tags-on-…
jonasongg Apr 15, 2024
6eb18f4
merge
jonasongg Apr 15, 2024
1537302
add show tags to renderFilterHash test
jonasongg Apr 15, 2024
1a6213d
Merge branch 'master' into add-show-tags-on-ramp-chart
jonasongg Apr 15, 2024
d6733a4
fix getTagLink for viewing tags for author
jonasongg Apr 18, 2024
5e786a2
Merge remote-tracking branch 'refs/remotes/origin/add-show-tags-on-ra…
jonasongg Apr 18, 2024
0f208d3
Merge remote-tracking branch 'upstream/master' into add-show-tags-on-…
jonasongg Apr 18, 2024
e1cd222
Merge branch 'master' into add-show-tags-on-ramp-chart
jonasongg Apr 19, 2024
cf06707
fix showTags cypress test
jonasongg Apr 19, 2024
98f3be7
Merge branch 'master' into add-show-tags-on-ramp-chart
jonasongg Apr 24, 2024
3832b3c
fix failing cypress
jonasongg Apr 25, 2024
a481255
fix cypress
jonasongg Apr 25, 2024
37b4b88
Merge branch 'master' into add-show-tags-on-ramp-chart
sopa301 Apr 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/ug/usingReports.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ The `Tool Bar` at the top of the Chart panel provides a set of configuration opt
* a breakdown of the number of lines of codes added to each file type (if the checkbox is checked). More info on note [3] below.
* `Merge group`: merges all the ramp charts of each group into a single ramp chart; aggregates the contribution of each group.
* viewing of authored code of the group as a whole is available when `group by repos`.
* `Show tags`: shows the tags of all the repos under a group

Notes:<br>
[1] **`Sort groups by`**: each main group has its own index and percentile according to its ranking position after sorting (e.g., if the groups are sorted by contribution in descending order, a 25% percentile indicates that the group is in the top 25% of the whole cohort in terms of contribution)<br>.
Expand Down
44 changes: 44 additions & 0 deletions frontend/cypress/tests/chartView/chartView_showTags.cy.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a Cypress test for displaying tags when grouped by author too?

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
describe('show tags', () => {
it('unchecked should not display any tags for a group', () => {
cy.get('#summary label.show-tags > input:visible')
.should('be.visible')
.uncheck()
.should('not.be.checked');

cy.get('.summary-charts__title--tags')
.should('not.exist');
});

it('checked should display all tags for a group', () => {
cy.get('#summary label.show-tags > input:visible')
.should('be.visible')
.check()
.should('be.checked');

cy.get('#summary label.merge-group > input:visible')
.should('be.visible')
.check()
.should('be.checked');

cy.get('.icon-button.fa-list-ul')
.should('exist')
.first()
.click();

const correctTags = [];

cy.get('.zoom__title--tags')
.find('.tag')
.each(($tag) => correctTags.push($tag.text().trim())).then(() => {
cy.get('.summary-charts__title--tags')
.find('.tag')
.each(($tag) => {
expect(correctTags).to.include($tag.text().trim());
});

cy.get('.summary-charts__title--tags')
.find('.tag')
.should('have.length', correctTags.length);
});
});
});
21 changes: 21 additions & 0 deletions frontend/src/components/c-summary-charts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,14 @@
v-if="sortGroupSelection.includes('totalCommits')"
) {{ getPercentile(i) }} %&nbsp
span.tooltip-text.right-aligned {{ getPercentileExplanation(i) }}
.summary-charts__title--tags(v-if="viewRepoTags && getTags(repo).length > 0")
.tag(
v-for="tag in getTags(repo)",
vbind:key="tag",
tabindex="-1"
)
font-awesome-icon(icon="tags")
span &nbsp;{{ tag }}
.summary-charts__fileType--breakdown(v-if="filterBreakdown")
template(v-if="filterGroupSelection !== 'groupByNone'")
.summary-charts__fileType--breakdown__legend(
Expand Down Expand Up @@ -371,6 +379,10 @@ export default defineComponent({
type: Number,
default: undefined,
},
viewRepoTags: {
type: Boolean,
default: false,
},
},
data() {
return {
Expand Down Expand Up @@ -875,6 +887,15 @@ export default defineComponent({

return totalContribution / totalCommits;
},

getTags(repo: Array<User>): Array<string> {
return [...new Set(repo.flatMap((r) => r.commits).flatMap((c) => c.commitResults).flatMap((r) => r.tags))]
.filter(Boolean) as Array<string>;
},
},
});
</script>

<style lang="scss" scoped>
@import '../styles/tags.scss';
</style>
5 changes: 5 additions & 0 deletions frontend/src/styles/summary-chart.scss
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
&__title {
align-items: center;
display: flex;
flex-wrap: wrap;
font-weight: bold;
text-align: left;

Expand Down Expand Up @@ -128,6 +129,10 @@
@include mini-font;
display: inline;
}

&--tags {
margin: .25rem 0;
}
}

&__fileType--breakdown {
Expand Down
16 changes: 16 additions & 0 deletions frontend/src/styles/tags.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@import 'colors';

/* Tags in commits */
.tag {
@include mini-font;
background: mui-color('grey', '600');
border-radius: 5px;
color: mui-color('white');
display: inline-block;
margin: .2rem .2rem .2rem 0;
padding: 0 3px 0 3px;

.fa-tags {
width: .65rem;
}
}
10 changes: 9 additions & 1 deletion frontend/src/views/c-summary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@
v-bind:disabled="filterGroupSelection === 'groupByNone'"
)
span merge all groups
label.show-tags
input.mui-checkbox(
type="checkbox",
v-model="viewRepoTags"
)
span show tags
.error-message-box(v-if="Object.entries(errorMessages).length && !isWidgetMode")
.error-message-box__close-button(v-on:click="dismissTab($event)") &times;
.error-message-box__message The following issues occurred when analyzing the following repositories:
Expand Down Expand Up @@ -133,7 +139,8 @@
v-bind:max-date="maxDate",
v-bind:sort-group-selection="sortGroupSelection",
v-bind:chart-group-index="chartGroupIndex",
v-bind:chart-index="chartIndex"
v-bind:chart-index="chartIndex",
v-bind:view-repo-tags="viewRepoTags"
)
</template>

Expand Down Expand Up @@ -211,6 +218,7 @@ export default defineComponent({
chartIndex: undefined as number | undefined,
errorIsShowingMore: false,
numberOfErrorMessagesToShow: 4,
viewRepoTags: false,
};
},
computed: {
Expand Down
16 changes: 1 addition & 15 deletions frontend/src/views/c-zoom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ export default defineComponent({

<style lang="scss" scoped>
@import '../styles/_colors.scss';
@import '../styles/tags.scss';

#tab-zoom {
.zoom {
Expand Down Expand Up @@ -558,21 +559,6 @@ export default defineComponent({
h3 {
@include large-font;
}

/* Tags in commits */
.tag {
@include mini-font;
background: mui-color('grey', '600');
border-radius: 5px;
color: mui-color('white');
display: inline-block;
margin: .2rem .2rem .2rem 0;
padding: 0 3px 0 3px;

.fa-tags {
width: .65rem;
}
}
}
}

Expand Down
Loading