Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions common-theme/layouts/_default/backlog.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,15 @@
{{ $issueBlocks := partial "block/issues-list-as-blocks.html" (dict "backlog" . "backlog_filter" $backlog_filter "path" $currentPath) }}
{{ range $issueBlocks }}
{{ $issue := . }}
{{ range .labels.nodes }}
{{if in .name "Recurring"}}
{{if eq .category "recurring"}}
{{ $recurringTasks = $recurringTasks | append $issue }}
{{else if in .name "Setup"}}
{{else if eq .category "setup"}}
{{ $setupTasks = $setupTasks | append $issue }}
{{else if in .name "Core"}}
{{else if eq .category "mandatory"}}
{{ $mandatoryTasks = $mandatoryTasks | append $issue }}
{{else if in .name "Optional"}}
{{else if eq .category "optional"}}
{{ $optionalTasks = $optionalTasks | append $issue }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ $page.Scratch.Set "backlog-tasks" (dict "setup" $setupTasks "recurring" $recurringTasks "mandatory" $mandatoryTasks "optional" $optionalTasks) }}
Expand Down
2 changes: 1 addition & 1 deletion common-theme/layouts/_default/success.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h2 class="e-heading__4 c-objectives__title is-invisible">
{{ $blocks = $dedupedBlocks }}

{{ range $blocks }}
{{ $name := .name }}
{{ $name := .title }}
{{ $src := .src }}
{{/* Call our scratch function */}}
{{ partial "block/data.html" (dict "Scratch" $.Page.Scratch "src" $src "name" $name "page" .) }}
Expand Down
2 changes: 1 addition & 1 deletion common-theme/layouts/partials/block/backlog-issue.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<details class="c-issue">
<summary class="c-issue__title e-heading__3">
{{ .block.name }}
{{ .block.title }}
<a class="c-issue__link" href="{{ .block.src }}">🔗</a>
<a href="https://curriculum.codeyourfuture.io/api/clone?state={{ dict "issue" .block.number "module" .block.repo "sprint"
.sprint "prevURL" (urls.AbsLangURL .path) | jsonify }}" class="e-button"
Expand Down
2 changes: 1 addition & 1 deletion common-theme/layouts/partials/block/block.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{/* Call our scratch function */}}
{{ partial "block/data.html" (dict "Scratch" .Page.Scratch "src" .block.src "name" .block.name "time" .block.time "caption" .block.caption "picture" .block.picture "hasBlocks" .block.nested "page" .) }}
{{ partial "block/data.html" (dict "Scratch" .Page.Scratch "src" .block.src "name" .block.title "time" .block.time "caption" .block.caption "picture" .block.picture "hasBlocks" .block.nested "page" .) }}
{{/* Retrieve the blockData from Scratch */}}
{{ $blockData := .Page.Scratch.Get "blockData" }}

Expand Down
83 changes: 16 additions & 67 deletions common-theme/layouts/partials/block/issues-list-as-blocks.html
Original file line number Diff line number Diff line change
@@ -1,69 +1,18 @@
{{/* This uses graphQL instead of REST
It returns a map of "blocks" so issues can be passed into the blocks loop instead of needing its own system
If we decide we like this better, we should probably systematise this and store
the graphql queries in their own dir
https://docs.github.com/en/graphql/reference/objects#issue
This exact matches on labels unlike the current system which partial matches inside Hugo
We did that because PD kept making partially matching labels, but maybe we should be stricter
TODO But it means someone has to go round and clean up
{{/*
Loading backlog issues from static JSON

- $courseRegex matches the course name from the url.
- $courseName strips the leading/trailing / characters TODO: This could probably be avoided with a better regex
- $issuesForModule filters by module name and returns the first element from the resulting array.
- $IssuesForSprint filters those issues by sprint label

*/}}
{{ $repo := .backlog }}
{{ $variables := dict
"owner" site.Params.owner
"repo" $repo
}}
{{ $currentPath := .path }}
{{ if .backlog_filter }}
{{ $variables = merge $variables (dict "labels" .backlog_filter) }}
{{ end }}
<!--prettier-ignore-->
{{ $query := `query($owner: String!, $repo: String!, $labels: [String!]) {
repository(owner: $owner, name: $repo) {
issues(
last: 100,
filterBy: {
states: OPEN,
labels: $labels
}
) {
nodes {
title
url
number
labels(
first: 50
orderBy: {
direction: DESC
field: NAME
}
) {
nodes {
name
color
description
}
}
}
}
}
}` }}

{{ $request := dict
"method" "POST"
"body" (dict "query" $query "variables" $variables | jsonify)
}}
{{ $issueBlocks := slice }}
{{ with resources.GetRemote "https://api.github.com/graphql" (merge $request (partial "github-auth.html" .)) }}
{{ with .Content | unmarshal }}
{{ if not .data.repository }}
{{ errorf "GitHub repository %s/%s referenced on %s had no issues" site.Params.owner (index $variables "repo") $currentPath }}
{{ else }}
{{ with .data.repository.issues.nodes }}
{{ range sort . "title" "asc" }}
{{ $issueBlocks = $issueBlocks | append (dict "name" .title "src" .url "number" .number "labels" .labels "repo" $repo) }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ return $issueBlocks }}
{{ $courseRegex := `/(.*?)/` }}
{{ $courseName := (trim (index (findRE $courseRegex .path 1) 0) "/") }}

{{ $courseIssues := index site.Data.backlog.courses $courseName}}
{{ $issuesForModule := index (where $courseIssues.modules "name" .backlog) 0}}
{{ $issuesForSprint := where $issuesForModule.sprints "name" .backlog_filter }}

{{ return (index $issuesForSprint 0).backlog_tasks }}
6 changes: 0 additions & 6 deletions org-cyf/content/itp/data-flows/project/_index.md

This file was deleted.

7 changes: 0 additions & 7 deletions org-cyf/content/itp/data-flows/project/backlog/_index.md

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions org-cyf/content/itp/data-flows/project/prep/index.md

This file was deleted.

17 changes: 0 additions & 17 deletions org-cyf/content/itp/data-flows/project/success/index.md

This file was deleted.

4 changes: 2 additions & 2 deletions org-cyf/content/itp/data-flows/sprints/1/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = 'backlog'
layout = 'backlog'
menu_level = ['sprint']
weight = 2
backlog= ['Module-Data-Flows', 'Project-TV-Show']
backlog_filter='📅 Sprint 1'
backlog= ['Data flows']
backlog_filter='Sprint 1'
+++
4 changes: 2 additions & 2 deletions org-cyf/content/itp/data-flows/sprints/2/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = 'backlog'
layout = 'backlog'
menu_level = ['sprint']
weight = 2
backlog= ['Module-Data-Flows', 'Project-TV-Show']
backlog_filter='📅 Sprint 2'
backlog= ['Data flows']
backlog_filter='Sprint 2'
+++
4 changes: 2 additions & 2 deletions org-cyf/content/itp/data-flows/sprints/3/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = 'backlog'
layout = 'backlog'
menu_level = ['sprint']
weight = 2
backlog= ['Module-Data-Flows', 'Project-TV-Show']
backlog_filter='📅 Sprint 3'
backlog= ['Data flows']
backlog_filter='Sprint 3'
+++
4 changes: 2 additions & 2 deletions org-cyf/content/itp/data-groups/sprints/1/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = 'backlog'
layout = 'backlog'
menu_level = ['sprint']
weight = 2
backlog= 'Module-Data-Groups'
backlog_filter='📅 Sprint 1'
backlog= 'Data groups'
backlog_filter='Sprint 1'
+++
4 changes: 2 additions & 2 deletions org-cyf/content/itp/data-groups/sprints/2/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = 'backlog'
layout = 'backlog'
menu_level = ['sprint']
weight = 2
backlog= 'Module-Data-Groups'
backlog_filter='📅 Sprint 2'
backlog= 'Data groups'
backlog_filter='Sprint 2'
+++
4 changes: 2 additions & 2 deletions org-cyf/content/itp/data-groups/sprints/3/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = 'backlog'
layout = 'backlog'
menu_level = ['sprint']
weight = 2
backlog= 'Module-Data-Groups'
backlog_filter='📅 Sprint 3'
backlog= 'Data groups'
backlog_filter='Sprint 3'
+++
4 changes: 2 additions & 2 deletions org-cyf/content/itp/onboarding/sprints/1/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = 'Backlog'
layout = 'backlog'
menu_level = ['sprint']
weight = 2
backlog= 'Module-Onboarding'
backlog_filter='📅 Sprint 1'
backlog= 'Onboarding'
backlog_filter='Sprint 1'
+++
4 changes: 2 additions & 2 deletions org-cyf/content/itp/onboarding/sprints/2/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = 'backlog'
layout = 'backlog'
menu_level = ['sprint']
weight = 2
backlog= 'Module-Onboarding'
backlog_filter='📅 Sprint 2'
backlog= 'Onboarding'
backlog_filter='Sprint 2'
+++
4 changes: 2 additions & 2 deletions org-cyf/content/itp/onboarding/sprints/3/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = 'backlog'
layout = 'backlog'
menu_level = ['sprint']
weight = 2
backlog= 'Module-Onboarding'
backlog_filter='📅 Sprint 3'
backlog= 'Onboarding'
backlog_filter='Sprint 3'
+++
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = 'backlog'
layout = 'backlog'
menu_level = ['sprint']
weight = 2
backlog= 'Module-Structuring-and-Testing-Data'
backlog_filter='📅 Sprint 1'
backlog= 'Structuring and testing data'
backlog_filter='Sprint 1'
+++
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = 'backlog'
layout = 'backlog'
menu_level = ['sprint']
weight = 2
backlog= 'Module-Structuring-and-Testing-Data'
backlog_filter='📅 Sprint 2'
backlog= 'Structuring and testing data'
backlog_filter='Sprint 2'
+++
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = 'backlog'
layout = 'backlog'
menu_level = ['sprint']
weight = 2
backlog= 'Module-Structuring-and-Testing-Data'
backlog_filter='📅 Sprint 3'
backlog= 'Structuring and testing data'
backlog_filter='Sprint 3'
+++
4 changes: 2 additions & 2 deletions org-cyf/content/sdc/complexity/sprints/1/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = "Backlog"
layout = "backlog"
menu_level = ["sprint"]
weight = 2
backlog = "Module-Complexity"
backlog_filter = "📅 Sprint 1"
backlog = "Complexity"
backlog_filter = "Sprint 1"
+++
4 changes: 2 additions & 2 deletions org-cyf/content/sdc/complexity/sprints/2/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = "Backlog"
layout = "backlog"
menu_level = ["sprint"]
weight = 2
backlog = "Module-Complexity"
backlog_filter = "📅 Sprint 2"
backlog = "Complexity"
backlog_filter = "Sprint 2"
+++
4 changes: 2 additions & 2 deletions org-cyf/content/sdc/decomposition/sprints/1/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = "Backlog"
layout = "backlog"
menu_level = ["sprint"]
weight = 2
backlog = "Module-Decomposition"
backlog_filter = "📅 Sprint 1"
backlog = "Decomposition"
backlog_filter = "Sprint 1"
+++
4 changes: 2 additions & 2 deletions org-cyf/content/sdc/decomposition/sprints/2/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = "Backlog"
layout = "backlog"
menu_level = ["sprint"]
weight = 2
backlog = "Module-Decomposition"
backlog_filter = "📅 Sprint 2"
backlog = "Decomposition"
backlog_filter = "Sprint 2"
+++
4 changes: 2 additions & 2 deletions org-cyf/content/sdc/decomposition/sprints/3/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = "Backlog"
layout = "backlog"
menu_level = ["sprint"]
weight = 2
backlog = "Module-Decomposition"
backlog_filter = "📅 Sprint 3"
backlog = "Decomposition"
backlog_filter = "Sprint 3"
+++
4 changes: 2 additions & 2 deletions org-cyf/content/sdc/legacy/sprints/1/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = "Backlog"
layout = "backlog"
menu_level = ["sprint"]
weight = 2
backlog = "Module-Legacy-Code"
backlog_filter = "📅 Sprint 1"
backlog = "Legacy code"
backlog_filter = "Sprint 1"
+++
3 changes: 2 additions & 1 deletion org-cyf/content/sdc/logic/sprints/1/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ title = "Backlog"
layout = "backlog"
menu_level = ["sprint"]
weight = 2
backlog = "Module-Logic"
backlog = "Logic"
backlog_filter = "Sprint 1"
+++
4 changes: 2 additions & 2 deletions org-cyf/content/sdc/tools/sprints/1/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = "Backlog"
layout = "backlog"
menu_level = ["sprint"]
weight = 2
backlog = "Module-Tools"
backlog_filter = "📅 Sprint 1"
backlog = "Tools"
backlog_filter = "Sprint 1"
+++
4 changes: 2 additions & 2 deletions org-cyf/content/sdc/tools/sprints/2/backlog/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ title = "Backlog"
layout = "backlog"
menu_level = ["sprint"]
weight = 2
backlog = "Module-Tools"
backlog_filter = "📅 Sprint 2"
backlog = "Tools"
backlog_filter = "Sprint 2"
+++
Loading
Loading