From f68e859c20f3f60f1c66de5fd93c636715515b06 Mon Sep 17 00:00:00 2001 From: Corentin Thomasset Date: Thu, 6 Apr 2023 00:16:32 +0200 Subject: [PATCH] refactor(docker-run-converter): improve error handling --- ...docker-run-to-docker-compose-converter.vue | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/tools/docker-run-to-docker-compose-converter/docker-run-to-docker-compose-converter.vue b/src/tools/docker-run-to-docker-compose-converter/docker-run-to-docker-compose-converter.vue index aeacecd2..a106878d 100644 --- a/src/tools/docker-run-to-docker-compose-converter/docker-run-to-docker-compose-converter.vue +++ b/src/tools/docker-run-to-docker-compose-converter/docker-run-to-docker-compose-converter.vue @@ -22,7 +22,9 @@

- {{ notComposable }} +
    +
  • {{ message }}
  • +
@@ -32,14 +34,18 @@ title="This options are not yet implemented and therefore haven't been translated to docker-compose" type="warning" > - {{ notImplemented }} +

- {{ errors }} +
    +
  • {{ message }}
  • +
@@ -63,22 +69,15 @@ const conversionResult = computed(() => ); const dockerCompose = computed(() => conversionResult.value.yaml); const notImplemented = computed(() => - conversionResult.value.messages - .filter((msg) => msg.type === MessageType.notImplemented) - .map((msg) => msg.value) - .join('
'), + conversionResult.value.messages.filter((msg) => msg.type === MessageType.notImplemented).map((msg) => msg.value), ); const notComposable = computed(() => - conversionResult.value.messages - .filter((msg) => msg.type === MessageType.notTranslatable) - .map((msg) => msg.value) - .join('
'), + conversionResult.value.messages.filter((msg) => msg.type === MessageType.notTranslatable).map((msg) => msg.value), ); const errors = computed(() => conversionResult.value.messages .filter((msg) => msg.type === MessageType.errorDuringConversion) - .map((msg) => msg.value) - .join('
'), + .map((msg) => msg.value), ); const dockerComposeBase64 = computed(() => 'data:application/yaml;base64,' + textToBase64(dockerCompose.value)); const { download } = useDownloadFileFromBase64({ source: dockerComposeBase64, filename: 'docker-compose.yml' });