Skip to content

Commit

Permalink
Merge pull request #10 from openmls/keks/pragmatice-code-refs
Browse files Browse the repository at this point in the history
Add URL to CodeRef and Render as Link in Dashboard
  • Loading branch information
franziskuskiefer authored Jul 4, 2024
2 parents aaca7c8 + be0edc4 commit 22b548d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
6 changes: 6 additions & 0 deletions checksets/03-regular_commit_proposal_list.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,17 @@ let checks =
( types.CodeRefs/new
[ types.CodeRef/new
"openmls::group::public_group::validate_group_context_extensions_proposal"
( types.Url/new
"https://github.com/openmls/openmls/blob/58df3c7639e5ca3c2e52a35a97c0dbeffd7d77bf/openmls/src/group/public_group/validation.rs#L537-L598"
)
]
)
( types.CodeRefs/new
[ types.CodeRef/new
"openmls::group::mls_group::test_mls_group::group_context_extension_proposal"
( types.Url/new
"https://github.com/openmls/openmls/blob/58df3c7639e5ca3c2e52a35a97c0dbeffd7d77bf/openmls/src/group/mls_group/test_mls_group.rs#L1146-L1354"
)
]
)
types.Notes/empty
Expand Down
6 changes: 3 additions & 3 deletions types.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ let Url/new

let CodeRef
: Type
= { modPath : Text }
= { modPath : Text, url : Url }

let CodeRef/new
: Text -> CodeRef
= \(modPath : Text) -> { modPath }
: Text -> Url -> CodeRef
= \(modPath : Text) -> \(url : Url) -> { modPath, url }

let CodeRefs
: Type
Expand Down
12 changes: 9 additions & 3 deletions utils/html.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ let CodeRefs/asUl
( Prelude.List.map
Types.CodeRef
XML.Type
(\(codeRef : Types.CodeRef) -> XML.text codeRef.modPath)
( \(codeRef : Types.CodeRef) ->
XML.element
{ name = "a"
, attributes = [ XML.attribute "href" codeRef.url.url ]
, content = [ XML.text codeRef.modPath ]
}
)
ref.refs
)

Expand Down Expand Up @@ -125,7 +131,7 @@ let Check/tableRow

let implsUl =
if Prelude.List.null Types.CodeRef check.code.refs
then [ XML.text "no refs to code." , br]
then [ XML.text "no refs to code.", br ]
else [ XML.text "code refs:", CodeRefs/asUl "impls" check.code ]

let testsUl =
Expand All @@ -137,7 +143,7 @@ let Check/tableRow
XML.element
{ name = "td"
, attributes = XML.emptyAttributes
, content = notesUl # implsUl # testsUl
, content = notesUl # implsUl # testsUl
}

in XML.element
Expand Down

0 comments on commit 22b548d

Please sign in to comment.