#MM-12130 changes for custom service terms (#9450)

* #MM-12130 changes for custom service terms

* Fixed styling

* Added getServiceTerms API

* removed unnecessary panic

* removed custom service terms text from flat config

* reverted user sql store as those changes are no longer needed

* added tests

* Updated a config key to be more standard

* Added copyright info

* Loading service terms only if the feature is enabled

* Loading service terms only if the feature is enabled

* removed unused index

* added createservice termns API

* made a param to bool instead of string

* added createservice termns API

* review fixes

* fixed styling

* Minor refactoring

* removed saveConfig and loadConfig magic

* added empty service terms text check to createServiceTerms API

* refactoed some urls to be terms_of_service instead of service_terms

* removed check for support settings

* changed URLs in tests

* removed unused code

* fixed a bug

* added service termd id in conif

* fixed a test

* review fixes

* minor fixes

* Fixed TestCreateServiceTerms
Этот коммит содержится в:
Harshil Sharma
2018-09-26 20:49:22 +00:00
коммит произвёл Jesse Hallam
родитель 4e59a27293
Коммит af275fe924
38 изменённых файлов: 933 добавлений и 44 удалений

Просмотреть файл

@@ -107,6 +107,8 @@ type Routes struct {
ReactionByNameForPostForUser *mux.Router // 'api/v4/users/{user_id:[A-Za-z0-9]+}/posts/{post_id:[A-Za-z0-9]+}/reactions/{emoji_name:[A-Za-z0-9_-+]+}'
Webrtc *mux.Router // 'api/v4/webrtc'
ServiceTerms *mux.Router // 'api/v4/service_terms
}
type API struct {
@@ -203,6 +205,8 @@ func Init(a *app.App, root *mux.Router) *API {
api.BaseRoutes.Image = api.BaseRoutes.ApiRoot.PathPrefix("/image").Subrouter()
api.BaseRoutes.ServiceTerms = api.BaseRoutes.ApiRoot.PathPrefix("/terms_of_service").Subrouter()
api.InitUser()
api.InitTeam()
api.InitChannel()
@@ -231,6 +235,7 @@ func Init(a *app.App, root *mux.Router) *API {
api.InitRole()
api.InitScheme()
api.InitImage()
api.InitServiceTerms()
root.Handle("/api/v4/{anything:.*}", http.HandlerFunc(api.Handle404))