Skip to content

Commit

Permalink
WIP: UI
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyash-b committed Feb 25, 2024
1 parent b6c426b commit eafe58a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
21 changes: 16 additions & 5 deletions lib/autoload/globals/ui.ngs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ ns {
type ProcessStatus(Element)
type Progress(Element)

F raw(h:Hash) h + {'$type': '$raw'}
F raw(h:Hash) {'$type': '$raw'} + h

F init(e:Element, children:Arr) {
# assert(children, Repeat(Element))
Expand Down Expand Up @@ -97,21 +97,32 @@ ns {
# TODO: Move whatever possible from CodePipeline.ngs to AbstractProcess.ngs
_cp = require("aws/CodePipeline.ngs")

F Element(s:AbstractProcess::Status::Status) ProcessStatus(s.Type().name, s.text)
# WIP
F Element(s:AbstractProcess::Status::Status) {
Object([ProcessStatus(s.Type().name, s.text)]).set(
ref = raw({
"parent": {
"type": "AWS::CodePipeline::Pipeline"
"id": "PIPELINE-NAME"
}
"id": "EXECUTION-ID"
})
)
}

# TODO: .total_steps might not be known
F Element(p:_cp::Progress) Progress(p.step, p.total_steps)

# WIP
F Element(cp:_cp::Pipeline) {
Object([Element(Str(cp))])::{
A.('$id') = raw({
Object([Element(Str(cp))]).set(
ref = raw({
"type": "AWS::CodePipeline::Pipeline"
"id": cp.name
"blah-str": "s123"
"blah-num": 123
})
}
)
}

# Later
Expand Down
4 changes: 4 additions & 0 deletions lib/shell.ngs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ net::unix_json_rpc_server("ngs-shell.sock", ns {
result.JsonData()
}

F ui_default_action(ref) {
log("UI default action on ${ref}")
}

section "tests" {

F test() {
Expand Down

0 comments on commit eafe58a

Please sign in to comment.