Skip to content

Commit 5608902

Browse files
committed
update repo page with correct author and maintainer values + ids for #68
1 parent e1bdbd2 commit 5608902

File tree

3 files changed

+23
-19
lines changed

3 files changed

+23
-19
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: orgmetrics
22
Title: Metrics for Your GitHub Organization
3-
Version: 0.1.2.105
3+
Version: 0.1.2.106
44
Authors@R:
55
person("Mark", "Padgham", , "[email protected]", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-2172-5265"))

codemeta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"codeRepository": "https://github.com/ropensci-review-tools/orgmetrics",
99
"issueTracker": "https://github.com/ropensci-review-tools/orgmetrics/issues",
1010
"license": "https://spdx.org/licenses/GPL-3.0",
11-
"version": "0.1.2.105",
11+
"version": "0.1.2.106",
1212
"programmingLanguage": {
1313
"@type": "ComputerLanguage",
1414
"name": "R",

inst/extdata/quarto/repo.qmd

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -424,13 +424,21 @@ repoMetrics = {
424424
...row,
425425
}))
426426
}
427-
ctbs = {
427+
ctbs_all = {
428428
return transpose(ctbs_in[repo]).map(row => ({
429429
...row,
430430
}))
431431
}
432432
433+
auts = ctbs_all.filter(function(ctb) {
434+
return ctb.is_author
435+
})
436+
ctbs = ctbs_all.filter(function(ctb) {
437+
return !ctb.is_author
438+
})
439+
433440
ctbs_gh = ctbs.map((ctb) => ctb['login']).filter(item => item != null);
441+
auts_gh = auts.map((aut) => aut['login']).filter(item => item != null);
434442
```
435443

436444

@@ -483,30 +491,26 @@ htl.html`${releases[0].total} releases (latest: ${release_latest}), ${releases[0
483491
gitlog_txt_total = htl.html`${gitlog_total_commits} commits since ${gitlog_first_commit}`;
484492
gitlog_txt_recent = htl.html`${gitlog_recent_commits} commits in past year`;
485493
486-
maintainer_count = repoMetrics.filter(function(m) {
487-
return m.name == "maintainer_count"
488-
})[0].value;
489-
maintainer_count_txt = pluraliseObjects(maintainer_count, "primary maintainer");
494+
author_count = auts_gh.length;
495+
author_count_txt = pluraliseObjects(author_count, "primary author");
490496
491-
maintainer_gh = [].concat(ctbs_gh.slice(0, maintainer_count) || []);
492-
maintainer_gh_list = maintainer_gh.length == 0 ? undefined:
493-
(maintainer_gh.length == 1 ? htl.html`
494-
<div onclick=${() => localStorage.setItem('orgmetricsMaintainer', maintainer_gh)}>
495-
<li><a href='/contributor.html'>${maintainer_gh}</a></li>
497+
author_gh_list = auts_gh.length == 0 ? undefined:
498+
(auts_gh.length == 1 ? htl.html`
499+
<div onclick=${() => localStorage.setItem('orgmetricsMaintainer', auts_gh)}>
500+
<li><a href='/contributor.html'>${auts_gh}</a></li>
496501
</div>
497-
` : maintainer_gh.map(m => htl.html`
502+
` : auts_gh.map(m => htl.html`
498503
<div onclick=${() => localStorage.setItem('orgmetricsMaintainer', m)}>
499504
<li><a href='/contributor.html'>${m}</a></li>
500505
</div>
501506
`));
502-
maintainer_gh_list_txt = maintainer_gh.length > 0 ? htl.html`<ul>${maintainer_gh_list}</ul>` : undefined;
507+
author_gh_list_txt = auts_gh.length > 0 ? htl.html`<ul>${author_gh_list}</ul>` : undefined;
503508
504-
ctb_gh = [].concat(ctbs_gh.slice(maintainer_count) || []);
505-
ctb_count = ctb_gh.length;
509+
ctb_count = ctbs_gh.length;
506510
ctb_count_txt = pluraliseObjects(ctb_count, "additional contributor");
507-
ctb_count_list = ctb_gh.map((item, i) => htl.html`
511+
ctb_count_list = ctbs_gh.map((item, i) => htl.html`
508512
<span onclick=${() => localStorage.setItem('orgmetricsMaintainer', item)}>
509-
<a href='/contributor.html'>${item}</a>${i < ctb_gh.length - 1 ? ", " : ""}</span>`);
513+
<a href='/contributor.html'>${item}</a>${i < ctbs_gh.length - 1 ? ", " : ""}</span>`);
510514
ctb_count_html = ctb_count == 0 ? htl.html`<div>No additional contributors</div>` :
511515
htl.html`<div>${ctb_count_txt}: ${ctb_count_list}</div>`;
512516
@@ -605,7 +609,7 @@ htl.html`<ul>
605609
<li>${releases_txt_total}</li>
606610
<li>${gitlog_txt_total}</li>
607611
<li>${gitlog_txt_recent}</li>
608-
<li>${maintainer_count_txt}${maintainer_gh_list_txt}</li>
612+
<li>${author_count_txt}${author_gh_list_txt}</li>
609613
<li>${ctb_count_html}</li>
610614
<li>${test_coverage_txt}</li>
611615
</ul>`

0 commit comments

Comments
 (0)