Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to group routes #42

Merged
merged 6 commits into from
May 19, 2019
Merged

Add the ability to group routes #42

merged 6 commits into from
May 19, 2019

Conversation

RareSecond
Copy link

What:

BEFORE
image

AFTER
image

Why:

We would be using mockit for a plethora of services spread across multiple teams. With no grouping whatsoever it would quickly become a huge mess.
With the ability to group routes, you can quickly hide a whole list of routes that share the same basepath (e.g. you decide on a basepath per team).

How:

Added a checkbox to enable grouping.
If it is enabled, all routes will be grouped by their URL, and will be displayed in a parent-child relationship, depicted by indentation.

I also had to remove the scrollreveal for the routes itself, because the revealing was super bugged when working with the <detail> tag.

I also added styled-components for more precise styling, so future front-end additions can be done in JS only.
I also split up the route files a little bit more, to ensure a one component per file approach.

Checklist:

  • Tests
  • Ready to be merged

I have currently not added tests, as I'm not entirely sure what the front-end testing approach is. If you can elaborate on that, I'll happily add them!

@boyney123
Copy link
Owner

This looks wicked @JDansercoer!!

I will take a look and review over the weekend 🙇 👍

@codecov-io
Copy link

codecov-io commented May 19, 2019

Codecov Report

Merging #42 into 1.1.0 will decrease coverage by 3.53%.
The diff coverage is 98.18%.

@@            Coverage Diff             @@
##            1.1.0      #42      +/-   ##
==========================================
- Coverage   97.76%   94.23%   -3.54%     
==========================================
  Files           7       19      +12     
  Lines         134      260     +126     
  Branches       28       47      +19     
==========================================
+ Hits          131      245     +114     
- Misses          3       15      +12

@boyney123 boyney123 changed the base branch from master to 1.1.0 May 19, 2019 19:22
@boyney123
Copy link
Owner

Thanks for this @JDansercoer, a great feature and thanks so much for contributing to the project 🙏 .

I am aiming for a 1.1.0 release, which this will part of, I'm going to write up some docs for the feature too.

FYI I made a few changes:

  • Added tests
  • Fixed Jest tests problems
  • Added more test coverage
  • Refactored some code and moved components around.

Overall, awesome feature thanks! I will add you to the contributing list too :)

@boyney123 boyney123 merged commit 0500789 into boyney123:1.1.0 May 19, 2019
@RareSecond
Copy link
Author

All right, awesome! We'll probably be using mockit a lot, so I'll try to expand other features where I deem needed!

@boyney123
Copy link
Owner

@JDansercoer 👍 good stuff.

I have added some docs too.

image

A few other things I'm working on at the moment so will merge 1.1.0 at some point, if you want to use your feature use branch 1.1.0 for now 👍.

Thanks again

@boyney123 boyney123 mentioned this pull request May 24, 2019
boyney123 added a commit that referenced this pull request May 24, 2019
* Add the ability to group routes (#42)

* First version of grouping routes

* Switched to new calculation of groups and styled them

* Added group routing based on togglable state

* Updated package-lock

* DB - Moved some components around, added some tests and fixed jest running tests

* DB - Added more test coverage

* Removed useless header x-powered-by (#45)

* Improved methods and status codes (#44)

* DB - Fixing tests for new routes that were added as part of #44

* Added CHANGELOG

* Feature - Add support for adding headers onto responses (#46)

* Started to add custom headers

* Tmp

* #4 - Added the ability to add headers in the routes

* Updated CHANGELOG

* DB - Format of settings

* Updated version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants