Midnighter / structurizr-python

A Python 3 port of Simon Brown's Structurizr diagrams-as-code architecture description tool.
https://structurizr.com/
Apache License 2.0
65 stars 16 forks source link

Add filtered views #82

Closed yt-ms closed 3 years ago

yt-ms commented 3 years ago

Add support for filtered views, FilteredViews are slightly odd in that they don't have their own layout (they just take from their base view). In the Java implementation, they actually don't inherit from View because of this even though there are some common fields - in Python, I've introduced a new AbstractView superclass of View which is also common with FilteredView (I felt this was less disruptive than stripping View down and introducing a new type between View and all its current subtypes..

Also resolved a couple of TODOs in ViewSet.

This PR follows on from https://github.com/Midnighter/structurizr-python/pull/78 so only commits from 6ef8af3 onwards are really part of this PR. I'll rebase once #78 is merged.


THIS SOFTWARE IS CONTRIBUTED SUBJECT TO THE TERMS OF THE Apache License v.2.0. YOU MAY OBTAIN A COPY OF THE LICENSE AT https://www.apache.org/licenses/LICENSE-2.0.

THIS SOFTWARE IS LICENSED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY WARRANTY OF NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THIS SOFTWARE MAY BE REDISTRIBUTED TO OTHERS ONLY BY EFFECTIVELY USING THIS OR ANOTHER EQUIVALENT DISCLAIMER IN ADDITION TO ANY OTHER REQUIRED LICENSE TERMS.

Midnighter commented 3 years ago

I'll review this once we have resolved #78. Sorry for the long wait.

codecov-commenter commented 3 years ago

Codecov Report

Merging #82 (b393557) into devel (4778f21) will increase coverage by 0.24%. The diff coverage is 95.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##            devel      #82      +/-   ##
==========================================
+ Coverage   93.76%   94.00%   +0.24%     
==========================================
  Files          74       76       +2     
  Lines        2327     2404      +77     
  Branches      241      248       +7     
==========================================
+ Hits         2182     2260      +78     
+ Misses        119      116       -3     
- Partials       26       28       +2     
Impacted Files Coverage Δ
src/structurizr/view/filtered_view.py 93.93% <93.93%> (ø)
src/structurizr/view/view_set.py 74.48% <94.11%> (+6.39%) :arrow_up:
src/structurizr/view/abstract_view.py 100.00% <100.00%> (ø)
src/structurizr/view/view.py 89.58% <100.00%> (-0.14%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4778f21...b393557. Read the comment docs.

Midnighter commented 3 years ago

Looks all good to me then. Thank you for the quick work on the changes.