Explorer

html-ui.part-route

description
(en) The part page of a project: when editable, it also reads the parts that reference the part (definy_find_references)
type
Fn(
  language: String,
  config: @html-ui.config,
  project: String,
  branch: String,
  part: String,
  commit: String,
  response: @html-ui.response
) -> @definy.service-io
expression
fn(language$990, config$0, project$1, branch$2, part$3, commit$4, response$5) =>
  match @core.and(
      left: $0.editable,
      right: @core.and(left: @core.equal(left: $4, right: ""), right: @core.equal(left: $5.status, right: 200))
    ) {
    true =>
      @html-ui.rpc(
        config: $0,
        method: "definy_find_references",
        request: @core.string-join(
          items: [
            "{\"project\":",
            @definy.json-string-literal(value: $1),
            ",\"branch\":",
            @definy.json-string-literal(value: $2),
            ",\"part\":",
            @definy.json-string-literal(value: $3),
            "}"
          ],
          separator: ""
        ),
        then: fn(response$6) =>
          @html-ui.part-page(
            language: $990,
            editable: true,
            project: $1,
            branch: $2,
            part: $3,
            commit: $4,
            references: $6.text,
            response: $5
          )
      ),
    false =>
      @html-ui.part-page(
        language: $990,
        editable: $0.editable,
        project: $1,
        branch: $2,
        part: $3,
        commit: $4,
        references: "",
        response: $5
      )
  }
visibility
public
html-ui.part-route (project html-ui, branch main, snapshot Daaw3vbJhY15cDW6JsA4JuXvffjj_qFyxoZQMUM8hvQ)
id: ELtWrFn_VclIy972iIWFJHJF2xy0Clwhkzs6-xQFgXI
content hash: 2dNKipJvQsBTPL3nYCoJs7_1WEb2wcxpNbfgl6nJyXI