remove tags/ page

Remove the tags page entirely: - Remove Tags route variant and dispatcher - Remove tags handler function - Remove tags view function and tag_row helper - Remove Tags from page type and navigation links - Update dispatch tests

Commit
4c069b0da16c9b98d0b7c916d5075aaa00843ac9
Author
Marius Peter <dev@marius-peter.com>
Author date
Committer
Marius Peter <dev@marius-peter.com>
Committer date
Changed files
lib/handlers.ml
index 150812ff..2dad47c6 100644..100644
@@ -265,10 +265,6 @@
265 265 Views.Repo.files context trail ?readme nodes
266 266 | `Blob blob -> Views.Repo.file context trail blob
267 267
268 Removed: let tags repository context =
269 Removed: let* tags = Resolvers.Reference.tags repository in
270 Removed: Views.Repo.tags context tags
271 Removed:
272 268 let raw_file repository _context id =
273 269 let* object_ = Resolvers.blob_or_tree repository id in
274 270 match object_ with
@@ -370,7 +366,6 @@
370 366 | Routes.Raw hash ->
371 367 Repo.with_repository config name (fun repository context ->
372 368 Repo.raw_file repository context hash)
373 Removed: | Routes.Tags_page -> Repo.with_repository config name Repo.tags
374 369 | Routes.Readme_page -> Repo.with_repository config name Repo.readme)
375 370 in
376 371 [
lib/routes.ml
index 0486145f..1538b6f6 100644..100644
@@ -20,7 +20,6 @@
20 20 | Commit of string * string
21 21 | Files of string
22 22 | File of string * string
23 Removed: | Tags of string
24 23 | Readme of string
25 24 | Raw_file of string * string
26 25
@@ -34,7 +33,6 @@
34 33 | Commit (repo, hash) -> "/" ^ repo ^ "/commit/" ^ hash
35 34 | Files repo -> "/" ^ repo ^ "/files/"
36 35 | File (repo, hash) -> "/" ^ repo ^ "/file/" ^ hash
37 Removed: | Tags repo -> "/" ^ repo ^ "/tags/"
38 36 | Readme repo -> "/" ^ repo ^ "/README"
39 37 | Raw_file (repo, hash) -> "/" ^ repo ^ "/raw/" ^ hash
40 38
@@ -47,7 +45,6 @@
47 45 | Commit_detail of string
48 46 | Files_page
49 47 | File_detail of string
50 Removed: | Tags_page
51 48 | Readme_page
52 49 | Raw of string
53 50
@@ -58,7 +55,6 @@
58 55 "commit";
59 56 "files";
60 57 "file";
61 Removed: "tags";
62 58 "README";
63 59 "raw";
64 60 ]
@@ -86,7 +82,6 @@
86 82 | "commit", [ hash ] -> Some (Commit_detail hash)
87 83 | "files", _ -> Some Files_page
88 84 | "file", [ hash ] -> Some (File_detail hash)
89 Removed: | "tags", _ -> Some Tags_page
90 85 | "README", _ -> Some Readme_page
91 86 | "raw", [ hash ] -> Some (Raw hash)
92 87 | _ -> None
lib/views.ml
index a4567439..f15db543 100644..100644
@@ -19,5 +19,4 @@
19 19 let files = Repo.files
20 20 let file = Repo.file
21 21 let commit = Repo.commit
22 Removed: let tags = Repo.tags
23 22 end
lib/views/components.ml
index 84cf1842..61297dce 100644..100644
@@ -14,7 +14,6 @@
14 14 | Summary
15 15 | Commits
16 16 | Files
17 Removed: | Tags
18 17 | Readme
19 18 (** Which repository page is being shown. Drives the [aria-current] marker
20 19 in the navigation. *)
@@ -57,14 +56,12 @@
57 56 | Summary -> Routes.Repo repo
58 57 | Commits -> Routes.Commits repo
59 58 | Files -> Routes.Files repo
60 Removed: | Tags -> Routes.Tags repo
61 59 | Readme -> Routes.Readme repo
62 60
63 61 let page_name = function
64 62 | Summary -> "Summary"
65 63 | Commits -> "Commits"
66 64 | Files -> "Files"
67 Removed: | Tags -> "Tags"
68 65 | Readme -> "README"
69 66
70 67 let page_link repo ~active page =
@@ -135,7 +132,7 @@
135 132 ~control_class:"nav-hamburger" ~label:"Menu" ~glyph:"\xe2\x8b\xae" ();
136 133 Ui.nav_links ~id:"nav-links"
137 134 (List.map (page_link repo ~active)
138 Removed: [ Summary; Commits; Files; Tags; Readme ]);
135 Added: [ Summary; Commits; Files; Readme ]);
139 136 ]
140 137
141 138 (** The same repository destinations as {!repo_nav}, condensed and pinned to the
lib/views/layout.ml
index d0b1a5cd..8d9cbf3a 100644..100644
@@ -15,7 +15,6 @@
15 15 | Summary
16 16 | Commits
17 17 | Files
18 Removed: | Tags
19 18 | Readme
20 19
21 20 type site = Components.site = {
lib/views/repo.ml
index 1e21343b..67d5e63b 100644..100644
@@ -103,9 +103,6 @@
103 103
104 104 (** {1 Rows} *)
105 105
106 Removed: let tag_row repo (tag : Resolvers.Reference.t) =
107 Removed: Ui.item [ Components.route_link (Tags repo) tag.name ]
108 Removed:
109 106 (** One line of the commit list: when it happened, what changed, and who did it.
110 107
111 108 @param hide_pill
@@ -402,11 +399,3 @@
402 399 @ Ui.Diff.view ~empty_message:"No file changes in this commit."
403 400 (List.map diff_file diff))
404 401
405 Removed: let tags context tags =
406 Removed: render_page context ~active:Tags
407 Removed: (match tags with
408 Removed: | [] ->
409 Removed: [
410 Removed: Ui.paragraph_text (Printf.sprintf "No tags for repo %s" context.repo);
411 Removed: ]
412 Removed: | tags -> [ Ui.items_of ~id:"tag-list" (tag_row context.repo) tags ])
test/test_dispatch.ml
index 36ba7282..155e1eb5 100644..100644
@@ -10,7 +10,6 @@
10 10 | Ogit.Routes.Commit_detail h -> "Commit_detail " ^ h
11 11 | Ogit.Routes.Files_page -> "Files_page"
12 12 | Ogit.Routes.File_detail h -> "File_detail " ^ h
13 Removed: | Ogit.Routes.Tags_page -> "Tags_page"
14 13 | Ogit.Routes.Readme_page -> "Readme_page"
15 14 | Ogit.Routes.Raw h -> "Raw " ^ h
16 15
@@ -35,7 +34,6 @@
35 34 check_dispatch "summary" "myrepo/summary/" (Some ("myrepo", Summary));
36 35 check_dispatch "commits" "myrepo/commits/" (Some ("myrepo", Commits_page));
37 36 check_dispatch "files" "myrepo/files/" (Some ("myrepo", Files_page));
38 Removed: check_dispatch "tags" "myrepo/tags/" (Some ("myrepo", Tags_page));
39 37 check_dispatch "readme" "myrepo/README" (Some ("myrepo", Readme_page))
40 38
41 39 let test_parametric_actions () =