MM-8796: Full implementation of "Schemes" in Store/Model/App layers. (#8357)

* Add Scheme model and stub store.

* Port ChannelStore to be Scheme aware.

* Make almost all the API/APP layer work with ChannelSchemes.

Only thing still hacky is UpdateChannelMemberRoles().

* Add basic SchemeStore implementation.

* Migrate UpdateChannelMemberRoles properly and fix tests.

* Update store tests and mocks so they work.

* Include creating default roles in Scheme create store function.

* Implement role deletion and start scheme deletion.

* Only use non-deleted roles for authorization.

* Add GetByScheme method to Team store.

* Add GetChannelsByScheme.

* Update store mocks.

* Implement scheme deletion in the store.

* Rename is valid function.

* Add offset and limit to queries to fetch teams and channels by scheme.

* Fix queries.

* Implement scheme awareness in Team store and add a migration.

* Tidy up ChannelStore mapping functions and add exhaustive unit tests.

* Add all missing i18n.

* Proper tests for TeamStore internal functions and fix them.

* Make additional TeamMember fields nullable.

* Make new ChannelMember fields nullable.

* Create new nullable columns without defaults.

* Make new fields in large tables nullalble.

* Fix empty list of TeamMembers.

* Deduplicate SQL queries.

* Fix spelling.

* Fix review comment.

* More review fixes.

* More review fixes.
Этот коммит содержится в:
George Goldberg
2018-04-20 19:49:13 +01:00
коммит произвёл Martin Kraft
родитель 853445dc2e
Коммит cd55c44c8f
48 изменённых файлов: 3605 добавлений и 176 удалений

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

@@ -6690,6 +6690,86 @@
"id": "store.sql_role.get_by_name.app_error",
"translation": "Unable to get role"
},
{
"id": "api.channel.update_channel_member_roles.scheme_role.app_error",
"translation": "The provided role is managed by a Scheme and therefore cannot be applied directly to a Channel Member"
},
{
"id": "api.channel.update_team_member_roles.scheme_role.app_error",
"translation": "The provided role is managed by a Scheme and therefore cannot be applied directly to a Team Member"
},
{
"id": "store.sql_channel.get_by_scheme.app_error",
"translation": "Unable to get the channels for the provided scheme"
},
{
"id": "store.sql_team.get_by_scheme.app_error",
"translation": "Unable to get the channels for the provided scheme"
},
{
"id": "store.sql_role.save.open_transaction.app_error",
"translation": "Failed to open the transaction to save the role"
},
{
"id": "store.sql_role.save_role.commit_transaction.app_error",
"translation": "Failed to commit the transaction to save the role"
},
{
"id": "store.sql_role.save.invalid_role.app_error",
"translation": "The provided role is invalid"
},
{
"id": "store.sql_role.delete.update.app_error",
"translation": "Unable to delete the role"
},
{
"id": "store.sql_scheme.save.open_transaction.app_error",
"translation": "Failed to open the transaction to save the scheme"
},
{
"id": "store.sql_scheme.save_scheme.commit_transaction.app_error",
"translation": "Failed to commit the transaction to save the scheme"
},
{
"id": "store.sql_scheme.save.invalid_scheme.app_error",
"translation": "The provided scheme is invalid"
},
{
"id": "store.sql_scheme.save.update.app_error",
"translation": "Unable to update the scheme"
},
{
"id": "store.sql_scheme.save.retrieve_default_scheme_roles.app_error",
"translation": "Unable to retrieve the default scheme roles"
},
{
"id": "store.sql_scheme.save.insert.app_error",
"translation": "Unable to create the scheme"
},
{
"id": "store.sql_scheme.get.app_error",
"translation": "Unable to get the scheme"
},
{
"id": "store.sql_scheme.team_count.app_error",
"translation": "Unable to count the number of teams using this scheme"
},
{
"id": "store.sql_scheme.delete.scheme_in_use.app_error",
"translation": "Unable to delete the scheme as it in use by 1 or more teams or channels"
},
{
"id": "store.sql_scheme.channel_count.app_error",
"translation": "Unable to count the number of channels using this scheme"
},
{
"id": "store.sql_scheme.delete.role_update.app_error",
"translation": "Unable to delete the roles belonging to this scheme"
},
{
"id": "store.sql_scheme.delete.update.app_error",
"translation": "Unable to delete the scheme"
},
{
"id": "store.sql_role.get_by_names.app_error",
"translation": "Unable to get roles"