* #132 added UserTermsOfService model

* #132 added UserTermsOfService model

* #132 added logic to save user TOS data in a new table

* #132 Added logic to save and delete user TOS. Updated user TOS action logic

* #132 updated store mocks

* #132 added tests

* #132 removed cache from UserTermsOfService SQL store

* #132 fixed styling and license check

* #132 added message translations in en.json

* #132 fixed save user TOS logic to work second time as well

* #132 removed User.AcceptedTermsOfService colum and migrated accepted TOS data into new table

* #132 fixed formatting

* #132 fixed formatting

* #146 added field 'mandatory' to terms of service

* #146 updated tests

* #146 added getLatestTermsOfService API

* #146 Added tests

* #146 fixed styling

* #146 removed code for managing mandatory/optional TOS

* #146 Added TOS re-acceptance period config

* #146 fixed styling

* #146 removed some code left for debugging

* #146 added TOS re-acceptance period in config

* #146 fixed a json name from service_terms to terms_of_service

* #146 Minor refactoring and added TOS re-acceptance period to diagnistics

* Fixed style

* Updated upgraded script to keep app backward compatible
Этот коммит содержится в:
Harshil Sharma
2018-11-09 02:18:14 +05:30
коммит произвёл Jesse Hallam
родитель c52e808e34
Коммит 0c5f60f89b
31 изменённых файлов: 653 добавлений и 144 удалений

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

@@ -504,7 +504,6 @@ func UpgradeDatabaseToVersion54(sqlStore SqlStore) {
time.Sleep(time.Second)
os.Exit(EXIT_GENERIC_FAILURE)
}
sqlStore.CreateColumnIfNotExists("Users", "AcceptedTermsOfServiceId", "varchar(64)", "varchar(64)", "")
saveSchemaVersion(sqlStore, VERSION_5_4_0)
}
}
@@ -516,9 +515,12 @@ func UpgradeDatabaseToVersion55(sqlStore SqlStore) {
}
func UpgradeDatabaseToVersion56(sqlStore SqlStore) {
// TODO: Uncomment following condition when version 5.5.0 is released
// TODO: Uncomment following condition when version 5.6.0 is released
//if shouldPerformUpgrade(sqlStore, VERSION_5_5_0, VERSION_5_6_0) {
sqlStore.CreateColumnIfNotExists("PluginKeyValueStore", "ExpireAt", "bigint(20)", "bigint", "0")
// saveSchemaVersion(sqlStore, VERSION_5_5_0)
// migrating user's accepted terms of service data into the new table
sqlStore.GetMaster().Exec("INSERT INTO UserTermsOfService SELECT Id, AcceptedTermsOfServiceId as TermsOfServiceId, :CreateAt FROM Users WHERE AcceptedTermsOfServiceId != \"\" AND AcceptedTermsOfServiceId IS NOT NULL", map[string]interface{}{"CreateAt": model.GetMillis()})
//saveSchemaVersion(sqlStore, VERSION_5_6_0)
//}
}