From cb51a7f269ffe0f84d4374f8eb383187f0c5b0a1 Mon Sep 17 00:00:00 2001
From: Volker Schukai <volker.schukai@schukai.com>
Date: Wed, 22 Jun 2022 12:10:35 +0200
Subject: [PATCH] chore: commit save point

---
 application/source/gitlab.go                  |  3 +++
 application/source/message.go                 | 13 +++++++++++++
 application/source/util.go                    |  5 ++++-
 development/examples/example1/req1/1/test1.md | 10 ++++------
 4 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/application/source/gitlab.go b/application/source/gitlab.go
index ea41623..1f6ff04 100644
--- a/application/source/gitlab.go
+++ b/application/source/gitlab.go
@@ -309,6 +309,9 @@ func createIssue(issue Issue) (*gitlab.Issue, error) {
 		return gitlabIssue, err
 	}
 
+	printInfo("Created issue %s (%s)", gitlabIssue.Title, gitlabIssue.ID)
+	printInfo("  %s", gitlabIssue.WebURL)
+
 	return gitlabIssue, nil
 }
 
diff --git a/application/source/message.go b/application/source/message.go
index a57a9bd..60f014a 100644
--- a/application/source/message.go
+++ b/application/source/message.go
@@ -42,3 +42,16 @@ func printWarning(message string, a ...interface{}) {
 
 	color.Warn.Block(message)
 }
+
+func printInfo(message string, a ...interface{}) {
+
+	message = printer.Sprintf(message, a...)
+
+	if lastBlock == "info" {
+		color.Info.Println(" " + message)
+		return
+	}
+	lastBlock = "info"
+
+	color.Info.Block(message)
+}
diff --git a/application/source/util.go b/application/source/util.go
index e4de0d2..3e31ee7 100644
--- a/application/source/util.go
+++ b/application/source/util.go
@@ -78,7 +78,10 @@ func splitYamlParts(content []byte) (error, contentRequirement) {
 	}
 
 	data := requirement{}
-	node.Decode(&data)
+	err = node.Decode(&data)
+	if err != nil {
+		return err, contentRequirement{}
+	}
 
 	tempItem := []Item{}
 	for i, _ := range data.Items {
diff --git a/development/examples/example1/req1/1/test1.md b/development/examples/example1/req1/1/test1.md
index f76a994..a0f6a3b 100644
--- a/development/examples/example1/req1/1/test1.md
+++ b/development/examples/example1/req1/1/test1.md
@@ -45,7 +45,9 @@ Issues:
     - Gitlab:
         Title: Test 1
         Status: offen
-        Description: Lorem Ipsum  Lila Rot Blau1 Lila Rot Blau2
+        Description: |
+            Lorem Ipsum Lila Rot 
+            Blau1 Lila Rot Blau2
         Labels:
             - a
             - b
@@ -101,11 +103,7 @@ Privacy:
       # Where possible, a general description of the technical and organisational 
       # security measures referred to in Article 32(1).
       TOM: null
-Issues:
-    - Gitlab:
-        ID: 1
-    - Gitlab:
-        ID: 41
+
 
 ...
 ### {{ .Title }} - {{ .ID }}
-- 
GitLab