From 6dc772b2367a0ad0620aff25c1cd527c22976b3f Mon Sep 17 00:00:00 2001 From: dfguerrerom Date: Thu, 24 Oct 2024 16:08:54 +0200 Subject: [PATCH] fix colors --- component/widget/vue/recipe_reader.vue | 16 +- ui_tests/RecipeInspector.ipynb | 419 ------------------------- ui_tests/test_recipe_inspector.ipynb | 232 ++++++++++++++ ui_tests/test_scenario_AddWidget.ipynb | 228 +++++++++++++- 4 files changed, 455 insertions(+), 440 deletions(-) delete mode 100644 ui_tests/RecipeInspector.ipynb create mode 100644 ui_tests/test_recipe_inspector.ipynb diff --git a/component/widget/vue/recipe_reader.vue b/component/widget/vue/recipe_reader.vue index e246c42..f262e04 100644 --- a/component/widget/vue/recipe_reader.vue +++ b/component/widget/vue/recipe_reader.vue @@ -2,12 +2,12 @@ - mdi-chef-hat Recipe: {{ recipe_name }} + mdi-chef-hat Recipe: {{ recipe_name }} -
+
@@ -119,7 +119,7 @@
- mdi-fingerprint + mdi-fingerprint Recipe signature: {{ data_dict.signature }}
@@ -244,15 +244,9 @@ module.exports = { }, }, methods: { + getPriorityChipColor(weight) { - const colors = [ - 'grey lighten-1', // Weight 0 - Neutral - 'green lighten-2', // Weight 1 - Very Low Priority - 'lime lighten-2', // Weight 2 - Low Priority - 'yellow lighten-2', // Weight 3 - Medium Priority - 'orange lighten-2', // Weight 4 - High Priority - 'red lighten-2', // Weight 5 - Very High Priority - ]; + const colors = ['#gray', '#a8decb', '#66c2a4', '#339768', '#006d2c']; const index = Math.min(Math.max(parseInt(weight), 0), colors.length - 1); return colors[index] || 'black'; }, diff --git a/ui_tests/RecipeInspector.ipynb b/ui_tests/RecipeInspector.ipynb deleted file mode 100644 index a0083b1..0000000 --- a/ui_tests/RecipeInspector.ipynb +++ /dev/null @@ -1,419 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "id": "2f986015-f78d-4254-9935-aa55b9ed05e1", - "metadata": {}, - "outputs": [], - "source": [ - "%load_ext autoreload\n", - "%autoreload 2" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "id": "de4ea64d-bf05-4b3e-adaf-2f8998b16b8f", - "metadata": {}, - "outputs": [], - "source": [ - "import sys\n", - "from pathlib import Path\n", - "sys.path = [str(Path(\"..\").resolve())] + sys.path" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "id": "b10c5ebb-3c09-427a-897a-9a16c0c125f6", - "metadata": {}, - "outputs": [], - "source": [ - "from tests.data.test_recipes import *" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "b0625d0c-e1a3-4395-bb9e-c5291f803388", - "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "application/javascript": [ - "/*******************************************************************************\n", - " * remove any links from fontawesome 5 created by jupyter in favor of\n", - " * fontawesome 6. to be removed when Jupyter updates it\n", - " */\n", - "\n", - "function remove_fa5() {\n", - " let links = document.querySelectorAll(\n", - " \"link[href^='https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@^5']\"\n", - " );\n", - "\n", - " links.forEach((link) => link.remove());\n", - "}\n", - "\n", - "if (document.readyState != \"loading\") remove_fa5();\n", - "else document.addEventListener(\"DOMContentLoaded\", remove_fa5);\n" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "fa37202cbd8f462490426f4f58415219", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "ResizeTrigger()" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "948249dcdd414d5fa5f188aed0671e6c", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "VuetifyTemplate(template=\"\\n " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/javascript": [ + "/*******************************************************************************\n", + " * remove any links from fontawesome 5 created by jupyter in favor of\n", + " * fontawesome 6. to be removed when Jupyter updates it\n", + " */\n", + "\n", + "function remove_fa5() {\n", + " let links = document.querySelectorAll(\n", + " \"link[href^='https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@^5']\"\n", + " );\n", + "\n", + " links.forEach((link) => link.remove());\n", + "}\n", + "\n", + "if (document.readyState != \"loading\") remove_fa5();\n", + "else document.addEventListener(\"DOMContentLoaded\", remove_fa5);\n" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "d1f231373a544f66bfe24e2f0b5ed825", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "ResizeTrigger()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "7e13068cad5644b98328a3a1f7db481b", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "VuetifyTemplate(template=\"\\n