Explorer

html-ui.diff-route

As of snapshot dt2aPjQUrI. See the latest

description
Read what the diff page /d/<commit>/<part> needs: the commit (definy_describe_event, for its parent), and the part as of the parent and as of the commit (definy_get_part with commit)
type
Fn(language: String, config: @html-ui.config, commit: String, part: String) -> @definy.service-io
expression
fn(language$990, config$0, commit$1, part$2) =>
  @html-ui.rpc(
    config: $0,
    method: "definy_describe_event",
    request: @core.string-join(items: ["{\"eventHash\":", @definy.json-string-literal(value: $1), "}"], separator: ""),
    then: fn(response$3) =>
      let parent$4 = @html-ui.event-field-of(text: $3.text, key: "parent");
      @html-ui.rpc(
        config: $0,
        method: "definy_get_part",
        request: @core.string-join(
          items: [
            "{\"part\":",
            @definy.json-string-literal(value: $2),
            ",\"commit\":",
            @definy.json-string-literal(value: $1),
            "}"
          ],
          separator: ""
        ),
        then: fn(response$5) =>
          match @core.equal(left: $4, right: "") {
            true =>
              @html-ui.diff-page(
                language: $990,
                commit: $1,
                part: $2,
                event: $3,
                before: {status: 404, text: "", json: #null<@definy.json>},
                after: $5
              ),
            false =>
              @html-ui.rpc(
                config: $0,
                method: "definy_get_part",
                request: @core.string-join(
                  items: [
                    "{\"part\":",
                    @definy.json-string-literal(value: $2),
                    ",\"commit\":",
                    @definy.json-string-literal(value: $4),
                    "}"
                  ],
                  separator: ""
                ),
                then: fn(response$6) =>
                  @html-ui.diff-page(language: $990, commit: $1, part: $2, event: $3, before: $6, after: $5)
              )
          }
      )
  )
visibility
public
html-ui.diff-route (project html-ui, branch remove-deploy-button, snapshot dt2aPjQUrIkBOz-2trTI6JX-dnOvCsvqp9O2GMbdWn8)
id: eedtvokZL0eEpDEEnS4Dfr6nQhHGocMRsnfgUjyesEU
content hash: GK8fLRzcxZAmXqW8ENsarZRLjJAEaTz4Ds1qRJv7YU0