From ac8346292e112e123a2abec36c49fe8e87012978 Mon Sep 17 00:00:00 2001 From: mi-parkes <127024352+mi-parkes@users.noreply.github.com> Date: Wed, 13 Nov 2024 18:48:40 +0100 Subject: [PATCH] Fixing crash for links to non existing needs in table view (#30) --- README.rst | 4 ++-- doc/source/conf.py | 4 ++-- pyproject.toml | 4 ++-- sphinx_needs_data_explorer/__init__.py | 4 ++-- .../_static/sphinx_needs_data_explorer.html | 18 +++++++++++------- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/README.rst b/README.rst index fa5ca3a..1f8c16e 100644 --- a/README.rst +++ b/README.rst @@ -127,8 +127,8 @@ or you can include it only if the extension is available in your virtual environ ... try: - import sphinx-needs-data-explorer - extensions.add('sphinx-needs-data-explorer') + import sphinx_needs_data_explorer + extensions.add('sphinx_needs_data_explorer') except ImportError: pass ... diff --git a/doc/source/conf.py b/doc/source/conf.py index adca632..ea9f5e6 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -8,8 +8,8 @@ project = "Sphinx Needs Data Explorer" copyright = "2024, MP" author = "MP" -release = "0.9.0" -version = "0.9.0" +release = "0.9.1" +version = "0.9.1" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/pyproject.toml b/pyproject.toml index eda4327..c3f7662 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ license = {file = "LICENSE"} [tool.poetry] name = "sphinx_needs_data_explorer" -version = "0.9.0" +version = "0.9.1" description = "Sphinx-needs-data-explorer is a Sphinx extension to visualize Sphinx-Needs data" authors = ["Michael Parkes "] readme = "README.rst" @@ -19,7 +19,7 @@ exclude = [ ] [tool.poetry.dependencies] -python = "^3.12" +python = "^3.10" Sphinx = ">=6.1.3" [tool.poetry.group.dev.dependencies] diff --git a/sphinx_needs_data_explorer/__init__.py b/sphinx_needs_data_explorer/__init__.py index 86a74c3..e14bd70 100644 --- a/sphinx_needs_data_explorer/__init__.py +++ b/sphinx_needs_data_explorer/__init__.py @@ -7,8 +7,8 @@ from sphinx.util import logging from sphinx.errors import ExtensionError -__version__ = "0.9.0" -version_info = (0, 9, 0) +__version__ = "0.9.1" +version_info = (0, 9, 1) logger = logging.getLogger(__name__) diff --git a/sphinx_needs_data_explorer/_static/sphinx_needs_data_explorer.html b/sphinx_needs_data_explorer/_static/sphinx_needs_data_explorer.html index 75d4041..4bfb2f3 100644 --- a/sphinx_needs_data_explorer/_static/sphinx_needs_data_explorer.html +++ b/sphinx_needs_data_explorer/_static/sphinx_needs_data_explorer.html @@ -869,14 +869,18 @@

Sphinx-Needs attributes found in this project that can be used for data filt function transformAndJoin(data,gnodes) { const transformedData = []; for (const key of data) { - const docname = gnodes[key]['data']?.["docname"]; - if (docname) { - const transformedValue = ` - ${key}`; - transformedData.push(transformedValue); + if(key in gnodes) { + const docname = gnodes[key]['data']?.["docname"]; + if (docname) { + const transformedValue = ` + ${key}`; + transformedData.push(transformedValue); + } else { + //transformedData.push(""); + } } else { - //transformedData.push(""); + console.log(`key=${key} not found!`); } } return transformedData;