From 1da90694171899c6181306ea25a6d35f3ec16096 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Thu, 25 Apr 2024 11:01:00 -0600 Subject: [PATCH 1/4] Allow single assignees to be starred --- src/js/lib/pages/github/issue.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/js/lib/pages/github/issue.js b/src/js/lib/pages/github/issue.js index d73f4a3e..f6b16255 100644 --- a/src/js/lib/pages/github/issue.js +++ b/src/js/lib/pages/github/issue.js @@ -74,12 +74,6 @@ const refreshAssignees = () => { // Always start by erasing whatever was drawn before (so it always starts from a clean slate) $('.js-issue-assignees .k2-element').remove(); - // Do nothing if there is only one person assigned. Owners can only be set when there are - // multiple assignees - if ($('.js-issue-assignees > p > span').length <= 1) { - return; - } - // Check if there is an owner for the issue const ghDescription = $('.comment-body').text(); const regexResult = ghDescription.match(/Current Issue Owner:\s@(?\S+)/i); From f0f4798424bd9e7f37f753806435f53a17342827 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Thu, 25 Apr 2024 11:11:43 -0600 Subject: [PATCH 2/4] Show an empty start when you aren't the owner --- src/js/component/list-item/ListItemIssue.js | 5 +++++ src/js/lib/pages/github/issue.js | 2 +- src/js/module/dashboard/Legend.js | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/js/component/list-item/ListItemIssue.js b/src/js/component/list-item/ListItemIssue.js index 969d91b2..2e283bd3 100644 --- a/src/js/component/list-item/ListItemIssue.js +++ b/src/js/component/list-item/ListItemIssue.js @@ -67,6 +67,11 @@ class ListItemIssue extends React.Component { {'★ '} )} + {this.issueHasOwner && !this.isCurrentUserOwner && ( + + {'☆ '} + + )} { } else { $(el).append(` `); } diff --git a/src/js/module/dashboard/Legend.js b/src/js/module/dashboard/Legend.js index fc9551bb..ed552205 100644 --- a/src/js/module/dashboard/Legend.js +++ b/src/js/module/dashboard/Legend.js @@ -46,6 +46,11 @@ function Legend() { {' '} Issue owner +
+ + {' '} + Issue is owned by someone else +
I {' '} From 24bf81cc259f30b2072f3ae0ef6206abb2149199 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Thu, 25 Apr 2024 11:14:47 -0600 Subject: [PATCH 3/4] Bump version --- CHANGELOG.md | 4 ++++ assets/manifest.json | 2 +- package-lock.json | 2 +- package.json | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bbd4548..27274974 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +#1.3.63 +- Allow for code owners to be assigned when there is only one person assigned +- Show on the K2 dashboard if an issue has an owner, and you're not the owner + #1.3.62 - Design improvements for light and dark mode. diff --git a/assets/manifest.json b/assets/manifest.json index 32f7aa5d..3a698eb4 100644 --- a/assets/manifest.json +++ b/assets/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 2, "name": "K2 for GitHub", - "version": "1.3.62", + "version": "1.3.63", "description": "Manage your Kernel Scheduling from directly inside GitHub", "browser_specific_settings": { diff --git a/package-lock.json b/package-lock.json index 4d39802e..c4fa3bfc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "k2-extension", - "version": "1.3.62", + "version": "1.3.63", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/package.json b/package.json index 0c64da43..01d4ce29 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "k2-extension", - "version": "1.3.62", + "version": "1.3.63", "description": "A Chrome Extension for Kernel Schedule", "private": true, "scripts": { From a590b45c306f36e8efa9e3b93a6dd67586d63f96 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Thu, 25 Apr 2024 11:31:17 -0600 Subject: [PATCH 4/4] Add a filter --- CHANGELOG.md | 1 + src/js/component/panel/PanelIssues.js | 13 ++++++++++++- src/js/module/dashboard/ListIssuesAssigned.js | 17 +++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27274974..aba29722 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ #1.3.63 - Allow for code owners to be assigned when there is only one person assigned - Show on the K2 dashboard if an issue has an owner, and you're not the owner +- Add a filter for issues not owned by you #1.3.62 - Design improvements for light and dark mode. diff --git a/src/js/component/panel/PanelIssues.js b/src/js/component/panel/PanelIssues.js index 5b74209d..5b7dec9b 100644 --- a/src/js/component/panel/PanelIssues.js +++ b/src/js/component/panel/PanelIssues.js @@ -27,9 +27,14 @@ const propTypes = { /** If there are no issues to list in the panel, hide the panel entirely */ hideOnEmpty: PropTypes.bool, + /** If the issue is on HOLD, hide it */ hideIfHeld: PropTypes.bool, + /** If the issue is under review, hide it */ hideIfUnderReview: PropTypes.bool, + + /** If the issue is owned by someone else, hide it */ + hideIfOwnedBySomeoneElse: PropTypes.bool, }; const defaultProps = { filters: { @@ -42,15 +47,17 @@ const defaultProps = { hideOnEmpty: false, hideIfHeld: false, hideIfUnderReview: false, + hideIfOwnedBySomeoneElse: false, }; function PanelIssues(props) { let filteredData = props.data; - if (props.hideIfHeld || props.hideIfUnderReview) { + if (props.hideIfHeld || props.hideIfUnderReview || props.hideIfOwnedBySomeoneElse) { filteredData = _.filter(props.data, (item) => { const isHeld = item.title.toLowerCase().indexOf('[hold') > -1 ? ' hold' : ''; const isUnderReview = _.find(item.labels, label => label.name.toLowerCase() === 'reviewing'); + const isOwnedBySomeoneElse = item.issueHasOwner && !item.currentUserIsOwner; if (isHeld && props.hideIfHeld) { return false; @@ -60,6 +67,10 @@ function PanelIssues(props) { return false; } + if (isOwnedBySomeoneElse && props.hideIfOwnedBySomeoneElse) { + return false; + } + return true; }); } diff --git a/src/js/module/dashboard/ListIssuesAssigned.js b/src/js/module/dashboard/ListIssuesAssigned.js index 6f44f6be..6c8392ec 100644 --- a/src/js/module/dashboard/ListIssuesAssigned.js +++ b/src/js/module/dashboard/ListIssuesAssigned.js @@ -24,9 +24,11 @@ class ListIssuesAssigned extends React.Component { this.state = {shouldHideHeldIssues: false}; this.state = {shouldHideUnderReviewIssues: false}; + this.state = {shouldHideOwnedBySomeoneElseIssues: false}; this.fetch = this.fetch.bind(this); this.toggleHeldFilter = this.toggleHeldFilter.bind(this); this.toggleUnderReviewFilter = this.toggleUnderReviewFilter.bind(this); + this.toggleOwnedBySomeoneElseFilter = this.toggleOwnedBySomeoneElseFilter.bind(this); } componentDidMount() { @@ -56,6 +58,10 @@ class ListIssuesAssigned extends React.Component { this.setState(prevState => ({shouldHideUnderReviewIssues: !prevState.shouldHideUnderReviewIssues})); } + toggleOwnedBySomeoneElseFilter() { + this.setState(prevState => ({shouldHideOwnedBySomeoneElseIssues: !prevState.shouldHideOwnedBySomeoneElseIssues})); + } + render() { if (!this.props.issues) { return ( @@ -90,6 +96,12 @@ class ListIssuesAssigned extends React.Component { Under Review
+
+ +
@@ -100,6 +112,7 @@ class ListIssuesAssigned extends React.Component { data={_.pick(this.props.issues, issue => _.findWhere(issue.labels, {name: 'Hourly'}))} hideIfHeld={this.state.shouldHideHeldIssues} hideIfUnderReview={this.state.shouldHideUnderReviewIssues} + hideIfOwnedBySomeoneElse={this.state.shouldHideOwnedBySomeoneElseIssues} />
@@ -109,6 +122,7 @@ class ListIssuesAssigned extends React.Component { data={_.pick(this.props.issues, issue => _.findWhere(issue.labels, {name: 'Daily'}))} hideIfHeld={this.state.shouldHideHeldIssues} hideIfUnderReview={this.state.shouldHideUnderReviewIssues} + hideIfOwnedBySomeoneElse={this.state.shouldHideOwnedBySomeoneElseIssues} />
@@ -118,6 +132,7 @@ class ListIssuesAssigned extends React.Component { data={_.pick(this.props.issues, issue => _.findWhere(issue.labels, {name: 'Weekly'}))} hideIfHeld={this.state.shouldHideHeldIssues} hideIfUnderReview={this.state.shouldHideUnderReviewIssues} + hideIfOwnedBySomeoneElse={this.state.shouldHideOwnedBySomeoneElseIssues} />
@@ -127,6 +142,7 @@ class ListIssuesAssigned extends React.Component { data={_.pick(this.props.issues, issue => _.findWhere(issue.labels, {name: 'Monthly'}))} hideIfHeld={this.state.shouldHideHeldIssues} hideIfUnderReview={this.state.shouldHideUnderReviewIssues} + hideIfOwnedBySomeoneElse={this.state.shouldHideOwnedBySomeoneElseIssues} />
@@ -139,6 +155,7 @@ class ListIssuesAssigned extends React.Component { data={_.pick(this.props.issues, issue => _.intersection(_.map(issue.labels, label => label.name), ['Hourly', 'Daily', 'Weekly', 'Monthly']).length === 0)} hideIfHeld={this.state.shouldHideHeldIssues} hideIfUnderReview={this.state.shouldHideUnderReviewIssues} + hideIfOwnedBySomeoneElse={this.state.shouldHideOwnedBySomeoneElseIssues} />