Skip to content

Commit

Permalink
#333: Merged develop and fixed conflicts in Report
Browse files Browse the repository at this point in the history
  • Loading branch information
KattisLej committed May 20, 2022
2 parents c078ed3 + f977bab commit 032b02c
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 165 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/create_packages.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Create packages
on:
push:
pull_request:
branches:
- main
types:
- closed


jobs:
main:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -23,9 +26,10 @@ jobs:
COMPOSE_DOCKER_CLI_BUILD: 1
GH_ACTOR: ${{ github.actor }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_HEAD_REF: ${{ github.head_ref }}
run: |
echo "${GH_TOKEN}" | docker login ghcr.io -u "${GH_ACTOR}" --password-stdin
branch=${GITHUB_REF##*/}
branch="${GH_HEAD_REF}"
for image in urdr urdr-web; do
docker pull "ghcr.io/nbisweden/$image:latest" || true
Expand Down
19 changes: 18 additions & 1 deletion backend/api/recentIssuesHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package api
import (
"encoding/json"
"fmt"
"github.com/gofiber/fiber/v2"
"sort"

"github.com/gofiber/fiber/v2"
)

// recentIssuesHandler godoc
Expand Down Expand Up @@ -61,6 +62,22 @@ func recentIssuesHandler(c *fiber.Ctx) error {
}
}

// Make sure that when there is not any time entry, we send the vacation entry by default
if len(entries) == 0 {
vacationEntry := Entry{
Issue: Issue{
Id: 3499,
Subject: "NBIS General",
},
Activity: Activity{
Id: 19,
Name: "Absence (Vacation/VAB/Other)",
},
}
entries = append(entries, vacationEntry)
return c.JSON(entries)
}

// Populate the issue subjects.
if ok, err := fetchIssueSubjects(c, entries); !ok {
return err
Expand Down
61 changes: 28 additions & 33 deletions frontend/src/components/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Cell } from "./Cell";
import fillStar from "../icons/star-fill.svg";
import star from "../icons/star.svg";
import grip from "../icons/grip-vertical.svg";
import eye from "../icons/eye-slash.svg";
import x from "../icons/x.svg";
import { dateFormat } from "../utils";
import { SNOWPACK_PUBLIC_REDMINE_URL } from "../utils";

Expand Down Expand Up @@ -39,10 +39,35 @@ export const Row = ({
{isFav ? (
<img src={grip} className="grip" alt="grip to change row sorting" />
) : (
<div></div>
<button
type="button"
className="star-button"
onClick={() => onHide(topic)}
>
<img
src={x}
className="hide-icon"
role="button"
alt={"Hide this row"}
title={"Hide this row"}
/>
</button>
)}
<button
type="button"
className="star-button"
onClick={() => onToggleFav(topic)}
>
<img
src={isFav ? fillStar : star}
className="star-icon"
role="button"
alt={isFav ? "Remove from favorites" : "Make favorite"}
title={isFav ? "Remove from favorites" : "Make favorite"}
/>
</button>
</div>
<div className="col-4 ">
<div className="col-5 ">
<div className="issue-label">
<p className="issue-label-text">
<a
Expand All @@ -58,36 +83,6 @@ export const Row = ({
</p>
</div>
</div>
<div className="col-1 star-container">
<button
type="button"
className="star-button"
onClick={() => onToggleFav(topic)}
>
<img
src={isFav ? fillStar : star}
className="star"
role="button"
alt={isFav ? "Remove from favorites" : "Make favorite"}
/>
</button>
{!isFav ? (
<button
type="button"
className="star-button"
onClick={() => onHide(topic)}
>
<img
src={eye}
className="star"
role="button"
alt={"Hide this row"}
/>
</button>
) : (
<></>
)}
</div>
{days.map((day, i) => {
return (
<Cell
Expand Down
27 changes: 16 additions & 11 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -127,18 +127,17 @@ Other button classes are defined further down together with other classes for th
justify-content: space-between;
align-items: center;
background-color: hsl(76deg 55% 53%);
margin-bottom: 0.4rem;
position: fixed;
margin-bottom: 0.2rem;
position: sticky;
z-index: 100;
left: 0;
top: 0;
width: 100%;
height: 80px;
}

.main {
position: relative;
margin: 50px 0;
.spreadsheet {
min-height: 100vh;
}

.footer {
Expand Down Expand Up @@ -368,13 +367,13 @@ Other button classes are defined further down together with other classes for th
width: 1.8rem;
}

.star-container {
display: flex;
align-items: center;
.star-icon {
width: 1.7rem;
}

.star {
width: 1.7rem;
.hide-icon {
width: 2rem;
margin-top: 0.5rem;
}

.star-button {
Expand All @@ -384,7 +383,13 @@ Other button classes are defined further down together with other classes for th
}

.grip-container {
justify-content: end;
justify-content: space-evenly;
padding: 0;
}

/* targeting all child elements of grip-container */
.grip-container > * {
margin: 0 0 0 0.75rem;
padding: 0;
}

Expand Down
Loading

0 comments on commit 032b02c

Please sign in to comment.