From a5e695ab2f183b6d10f2c1bf1db20ef7403e4cc1 Mon Sep 17 00:00:00 2001
From: NereusWB922 <107099783+NereusWB922@users.noreply.github.com>
Date: Wed, 10 Apr 2024 13:34:29 +0800
Subject: [PATCH 2/6] Consider open milestone without deadline as currently
active (#359)
For open milestones, only those with deadlines were considered as currently
active. This led to setting a closed milestone with the latest deadline as
currently active when there is an open milestone without deadline.
Let's update the selection logic to also include open milestones
without deadlines.
---
src/app/core/services/milestone.service.ts | 39 +++++++++++++++-------
1 file changed, 27 insertions(+), 12 deletions(-)
diff --git a/src/app/core/services/milestone.service.ts b/src/app/core/services/milestone.service.ts
index 13e7ac8a..64d938ee 100644
--- a/src/app/core/services/milestone.service.ts
+++ b/src/app/core/services/milestone.service.ts
@@ -47,22 +47,37 @@ export class MilestoneService {
}
/**
- * Gets the open milestone with the earliest deadline.
- * Returns null if there is no open milestone with deadline.
+ * Returns the open milestone with earliest deadline.
+ * If no deadline exists, returns milestone with alphabetically smallest title.
+ * Returns null if there are no open milestones.
*/
getEarliestOpenMilestone(): Milestone {
- let earliestOpenMilestone: Milestone = null;
- for (const milestone of this.milestones) {
- if (!milestone.deadline || milestone.state !== 'open') {
- continue;
+ const openMilestones: Milestone[] = this.milestones.filter((milestone: Milestone) => milestone.state === 'open');
+
+ if (openMilestones.length === 0) {
+ return null;
+ }
+
+ const target = openMilestones.reduce((prev, curr) => {
+ if (prev === null) {
+ return curr;
}
- if (earliestOpenMilestone === null) {
- earliestOpenMilestone = milestone;
- } else if (milestone.deadline < earliestOpenMilestone.deadline) {
- earliestOpenMilestone = milestone;
+
+ if (prev.deadline !== curr.deadline) {
+ if (!prev.deadline) {
+ return curr;
+ }
+ if (!curr.deadline) {
+ return prev;
+ }
+ return prev.deadline < curr.deadline ? prev : curr;
}
- }
- return earliestOpenMilestone;
+
+ // Both without due date or with the same due date
+ return prev.title.localeCompare(curr.title) < 0 ? prev : curr;
+ }, null);
+
+ return target;
}
/**
From 5ff13fec764fee4239503d43734594127ee2ba85 Mon Sep 17 00:00:00 2001
From: Arif Khalid <88131400+Arif-Khalid@users.noreply.github.com>
Date: Wed, 10 Apr 2024 22:19:35 +0800
Subject: [PATCH 3/6] Fix top and bottom shadow of columns (#357)
A few bugs exist related to column shadows.
Top shadow is shown when there are no elements
behind header and hidden when there are.
Bottom shadow sticks to the column as a user scrolls.
These are not the intended behaviour of the shadows
to indicate presence of elements behind above or
below columns respectively.
Let's update the CSS to correspond to
appropriate shadow behaviours.
---
.../card-view/card-view.component.css | 45 +++++++++----------
.../card-view/card-view.component.html | 2 +-
.../issue-pr-card/issue-pr-card.component.css | 1 +
3 files changed, 22 insertions(+), 26 deletions(-)
diff --git a/src/app/issues-viewer/card-view/card-view.component.css b/src/app/issues-viewer/card-view/card-view.component.css
index b1c656be..10fdf38e 100644
--- a/src/app/issues-viewer/card-view/card-view.component.css
+++ b/src/app/issues-viewer/card-view/card-view.component.css
@@ -52,7 +52,26 @@ div.column-header .mat-card-header {
position: relative;
}
-/* Ref: https://css-scroll-shadows.vercel.app */
+/* Ref: https://lea.verou.me/blog/2012/04/background-attachment-local/ */
+.scroll-shadow {
+ background:
+ /* Shadow covers */ linear-gradient(white 30%, rgba(255, 255, 255, 0)),
+ linear-gradient(rgba(255, 255, 255, 0), white 70%) 0 100%,
+ /* Shadows */ radial-gradient(50% 0, farthest-side, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0)),
+ radial-gradient(50% 100%, farthest-side, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0)) 0 100%;
+ background:
+ /* Shadow covers */ linear-gradient(white 30%, rgba(255, 255, 255, 0)),
+ linear-gradient(rgba(255, 255, 255, 0), white 70%) 0 100%,
+ /* Shadows */ radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0)),
+ radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0)) 0 100%;
+ background-repeat: no-repeat;
+ background-color: white;
+ background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
+
+ /* Opera doesn't support this in the shorthand */
+ background-attachment: local, local, scroll, scroll;
+}
+
.scrollable-container::before {
pointer-events: none;
content: '';
@@ -87,30 +106,6 @@ div.column-header .mat-card-header {
display: none;
}
-.scrollable-container-wrapper::before {
- pointer-events: none;
- content: '';
- position: absolute;
- z-index: 1;
- top: 0;
- left: 0;
- right: 0;
- height: 5px;
- background-image: radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, 0.5), transparent);
-}
-
-.scrollable-container-wrapper::after {
- pointer-events: none;
- content: '';
- position: absolute;
- z-index: 1;
- bottom: 0;
- left: 0;
- right: 0;
- height: 5px;
- background-image: radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, 0.5), transparent);
-}
-
.loading-spinner {
display: flex;
justify-content: center;
diff --git a/src/app/issues-viewer/card-view/card-view.component.html b/src/app/issues-viewer/card-view/card-view.component.html
index 37b3e98e..3e876acf 100644
--- a/src/app/issues-viewer/card-view/card-view.component.html
+++ b/src/app/issues-viewer/card-view/card-view.component.html
@@ -3,7 +3,7 @@
[ngTemplateOutlet]="getHeaderTemplate() || defaultHeader"
[ngTemplateOutletContext]="{ $implicit: this.group }"
>
-