Skip to content

Commit

Permalink
Sort by number of commits ahead instead of stars
Browse files Browse the repository at this point in the history
  • Loading branch information
devnoname120 committed Nov 15, 2024
1 parent aae254f commit 285eb5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions website/src/queries-init.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const LANDING_PAGE_INIT_MSG = "<h1 class='title'>Introducing:</h1>"
+ "Simply type a repository's URL in the Text Field above. Both of those examples are valid entries: <br/>"
+ "<strong>" + EXAMPLE_LINK_1 + "</strong> and <strong>" + EXAMPLE_LINK_2 + "</strong>.<br/><br/>"
+ "The criteria is simple: <strong>if a fork was created, but never received any other activity on its <span class='is-family-monospace'>master</span> branch, it is filtered out.</strong><br/>"
+ "The results are sorted by the amount of stars.<br/><br/>"
+ "The results are sorted by the number of ahead commits.<br/><br/>"
+ "For more information, check out " + BODY_REPO_LINK + ".";


Expand Down Expand Up @@ -79,8 +79,8 @@ function buildGithubRepoURL(repo) {
}

function getForkButtonLink(qualifier, full_name) {
return `<a href="${buildAutoQueryURL(full_name)}"
title="This will launch a (more extensive) scan for the specified repository. The 'Source' is the root project of the whole fork tree, whereas the 'Parent' is the immediate parent. (Therefore, the Source can be the Parent.)"
return `<a href="${buildAutoQueryURL(full_name)}"
title="This will launch a (more extensive) scan for the specified repository. The 'Source' is the root project of the whole fork tree, whereas the 'Parent' is the immediate parent. (Therefore, the Source can be the Parent.)"
class="button is-small is-dark is-outlined">
<b>${qualifier}:&nbsp;&nbsp;</b>
<span class="is-family-monospace">${full_name}</span>
Expand Down Expand Up @@ -231,4 +231,4 @@ function getJqId_$(id) {
}
const JQ_ID_HEADER = getJqId_$(UF_ID_HEADER);
const JQ_ID_MSG = getJqId_$(UF_ID_MSG);
const JQ_ID_TABLE = getJqId_$(UF_ID_TABLE);
const JQ_ID_TABLE = getJqId_$(UF_ID_TABLE);
7 changes: 4 additions & 3 deletions website/src/queries-logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ function getTdValue(rows, index, col) {
}

function sortTable() {
sortTableColumn(UF_ID_TABLE, 1);
/** Number of commits ahead. */
sortTableColumn(UF_ID_TABLE, 4);
}

/** 'sortColumn' index starts at 0. https://stackoverflow.com/a/37814596/9768291 */
Expand Down Expand Up @@ -260,7 +261,7 @@ function update_table_data(responseData, user, repo, parentDefaultBranch) {
datum['pushed_at'] = getOnlyDate(currFork.pushed_at);
TABLE_DATA.push(datum);
if (TABLE_DATA.length > 1) showFilterContainer();

update_table_trying_use_filter();
}
};
Expand Down Expand Up @@ -344,7 +345,7 @@ function updateFilterFunction() {
}
conditionObj[attribute] = { operator, value };
}

IS_USEFUL_FORK = (datum) => {
for (const [attribute, { operator, value }] of Object.entries(conditionObj)) {
const attrValue = datum[attribute];
Expand Down

0 comments on commit 285eb5f

Please sign in to comment.