mirror of
https://github.com/godotengine/godot-prs-by-file.git
synced 2025-12-31 21:48:29 +03:00
Remove hardcoded repository URL
This commit is contained in:
@@ -195,7 +195,7 @@ export default class FileList extends LitElement {
|
||||
@iconclick="${this._onItemIconClicked.bind(this, item.type, item.path, item.pulls)}"
|
||||
></gr-file-item>
|
||||
|
||||
${(this.selectedFolders.includes(item.path)) ?
|
||||
${(this.selectedFolders.includes(item.path)) ?
|
||||
this.renderFolder(branchFiles, branchFiles[item.path] || []) : null
|
||||
}
|
||||
</div>
|
||||
|
||||
@@ -121,13 +121,17 @@ export default class PullRequestItem extends LitElement {
|
||||
@property({ type: String, reflect: true }) url = '';
|
||||
@property({ type: String, reflect: true }) diff_url = '';
|
||||
@property({ type: String, reflect: true }) patch_url = '';
|
||||
|
||||
@property({ type: Boolean }) draft = false;
|
||||
@property({ type: String, reflect: true }) milestone = '';
|
||||
@property({ type: String, reflect: true }) branch = '';
|
||||
|
||||
@property({ type: String }) created_at = '';
|
||||
@property({ type: String }) updated_at = '';
|
||||
@property({ type: Object }) author = null;
|
||||
|
||||
@property({ type: String }) repository = '';
|
||||
|
||||
render(){
|
||||
const authorClassList = [ "pr-author-value" ];
|
||||
if (this.author.pull_count > 40) {
|
||||
@@ -175,7 +179,7 @@ export default class PullRequestItem extends LitElement {
|
||||
<span>author: </span>
|
||||
<a
|
||||
class="${authorClassList.join(" ")}"
|
||||
href="https://github.com/godotengine/godot/pulls/${this.author.user}"
|
||||
href="https://github.com/${this.repository}/pulls/${this.author.user}"
|
||||
target="_blank"
|
||||
title="Open ${this.author.pull_count} ${(this.author.pull_count > 1) ? 'PRs' : 'PR'} by ${this.author.user}"
|
||||
>
|
||||
@@ -227,4 +231,4 @@ export default class PullRequestItem extends LitElement {
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,7 +106,8 @@ export default class PullRequestList extends LitElement {
|
||||
|
||||
@property({ type: Array }) pulls = [];
|
||||
@property({ type: Object }) authors = {};
|
||||
|
||||
|
||||
@property({ type: String }) selectedRepository = "";
|
||||
@property({ type: String }) selectedBranch = "";
|
||||
@property({ type: String }) selectedPath = "";
|
||||
@property({ type: Array }) selectedPulls = [];
|
||||
@@ -132,7 +133,7 @@ export default class PullRequestList extends LitElement {
|
||||
|
||||
const total_pulls = this.pulls.length;
|
||||
let filtered_pulls = pulls.length
|
||||
|
||||
|
||||
const has_pinned = (this.filteredPull !== "");
|
||||
if (has_pinned) {
|
||||
filtered_pulls -= 1;
|
||||
@@ -166,6 +167,7 @@ export default class PullRequestList extends LitElement {
|
||||
|
||||
.diff_url="${item.diff_url}"
|
||||
.patch_url="${item.patch_url}"
|
||||
.repository="${this.selectedRepository}"
|
||||
/>
|
||||
`;
|
||||
})}
|
||||
@@ -211,10 +213,11 @@ export default class PullRequestList extends LitElement {
|
||||
|
||||
.diff_url="${item.diff_url}"
|
||||
.patch_url="${item.patch_url}"
|
||||
.repository="${this.selectedRepository}"
|
||||
/>
|
||||
`;
|
||||
})}
|
||||
</div>
|
||||
`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ export default class EntryComponent extends LitElement {
|
||||
if (typeof branchFiles[file.parent] === "undefined") {
|
||||
branchFiles[file.parent] = [];
|
||||
}
|
||||
|
||||
|
||||
branchFiles[file.parent].push(file);
|
||||
}
|
||||
});
|
||||
@@ -141,10 +141,10 @@ export default class EntryComponent extends LitElement {
|
||||
if (b.type === "folder" && a.type !== "folder") {
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
const a_name = a.path.toLowerCase();
|
||||
const b_name = b.path.toLowerCase();
|
||||
|
||||
|
||||
if (a_name > b_name) return 1;
|
||||
if (a_name < b_name) return -1;
|
||||
return 0;
|
||||
@@ -242,6 +242,7 @@ export default class EntryComponent extends LitElement {
|
||||
<gr-pull-list
|
||||
.pulls="${this._pulls}"
|
||||
.authors="${this._authors}"
|
||||
.selectedRepository="${this._selectedRepository}"
|
||||
.selectedBranch="${this._selectedBranch}"
|
||||
.selectedPath="${this._selectedPath}"
|
||||
.selectedPulls="${this._selectedPathPulls}"
|
||||
|
||||
Reference in New Issue
Block a user