ucsb-cs56-w20 / ucsb-courses-search

Spring Boot App to show similar information to that found at UCSB Curriculum Search page
https://ucsb-courses-search.herokuapp.com
2 stars 5 forks source link

(Staff) Multiple schedule feature toggle #248

Closed pconrad closed 4 years ago

pconrad commented 4 years ago

In this PR, we add a FeatureToggleService that can be autowired into any Java class in the application.

Feature Toggles are generally used to selectively enable features in an app while they are being incrementally developed. The usual practice is to have the toggle "false" (or "off") in production, and "true" (or "on") in development. That allows you to put feature into your app that are perhaps still only "half way done", and incrementally introduce them into the code base.

To use this service:

Example use in Java Code:

    @Autowired
    FeatureToggleService fts;

    public static void example() {
        if (fts.getMultipleSchedules()) {
            // do something
        }
    }

Example use in Thymeleaf:

   <a th:if="${feature_multipleSchedules}" class="dropdown-item" href="/tbd">Multiple Schedules</a>