11import androidx.compose.foundation.layout.Column
2+ import androidx.compose.foundation.layout.Row
23import androidx.compose.foundation.layout.Spacer
34import androidx.compose.foundation.layout.fillMaxWidth
45import androidx.compose.foundation.layout.height
@@ -21,10 +22,13 @@ fun App() {
2122 MaterialTheme {
2223 var actionCoords by remember { mutableStateOf(" actions/checkout@v4" ) }
2324 var manifest: Metadata ? by remember { mutableStateOf(null ) }
25+ var typingFromAction: Typing ? by remember { mutableStateOf(null ) }
26+ var typingFromCatalog: Typing ? by remember { mutableStateOf(null ) }
2427
2528 LaunchedEffect (actionCoords) {
26- val actionManifestYaml = fetchManifest(actionCoords)
27- manifest = actionManifestYaml
29+ manifest = fetchManifest(actionCoords)
30+ typingFromAction = fetchTypingFromAction(actionCoords)
31+ typingFromCatalog = fetchTypingFromCatalog(actionCoords)
2832 }
2933
3034 Column (Modifier .fillMaxWidth(), horizontalAlignment = Alignment .CenterHorizontally ) {
@@ -35,26 +39,59 @@ fun App() {
3539 )
3640 Spacer (Modifier .height(10 .dp))
3741
38-
39- Column (Modifier .verticalScroll(rememberScrollState())) {
40- Text (" Inputs" , fontWeight = FontWeight .Bold )
41- if (manifest?.inputs?.isEmpty() == true ) {
42- Text (" <none>" )
43- }
44- manifest?.inputs?.forEach {
45- Text (it.key)
46- }
47-
48- Spacer (Modifier .height(10 .dp))
49-
50- Text (" Outputs" , fontWeight = FontWeight .Bold )
51- if (manifest?.outputs?.isEmpty() == true ) {
52- Text (" <none>" )
53- }
54- manifest?.outputs?.forEach {
55- Text (it.key)
56- }
42+ Row {
43+ manifest(manifest)
44+ typing(typingFromAction, source = " action" )
45+ typing(typingFromCatalog, source = " catalog" )
5746 }
5847 }
5948 }
6049}
50+
51+ @Composable
52+ private fun manifest (manifest : Metadata ? ) {
53+ Column (Modifier .verticalScroll(rememberScrollState())) {
54+ Text (" Manifest:" )
55+ Text (" Inputs" , fontWeight = FontWeight .Bold )
56+ if (manifest?.inputs?.isEmpty() == true ) {
57+ Text (" <none>" )
58+ }
59+ manifest?.inputs?.forEach {
60+ Text (it.key)
61+ }
62+
63+ Spacer (Modifier .height(10 .dp))
64+
65+ Text (" Outputs" , fontWeight = FontWeight .Bold )
66+ if (manifest?.outputs?.isEmpty() == true ) {
67+ Text (" <none>" )
68+ }
69+ manifest?.outputs?.forEach {
70+ Text (it.key)
71+ }
72+ }
73+ }
74+
75+ @Composable
76+ private fun typing (typing : Typing ? , source : String ) {
77+ Column (Modifier .verticalScroll(rememberScrollState())) {
78+ Text (" Typing from $source :" )
79+ Text (" Inputs" , fontWeight = FontWeight .Bold )
80+ if (typing?.inputs?.isEmpty() == true ) {
81+ Text (" <none>" )
82+ }
83+ typing?.inputs?.forEach {
84+ Text (" ${it.key} : ${it.value.type} " )
85+ }
86+
87+ Spacer (Modifier .height(10 .dp))
88+
89+ Text (" Outputs" , fontWeight = FontWeight .Bold )
90+ if (typing?.outputs?.isEmpty() == true ) {
91+ Text (" <none>" )
92+ }
93+ typing?.outputs?.forEach {
94+ Text (" ${it.key} : ${it.value.type} " )
95+ }
96+ }
97+ }
0 commit comments