PLT-3143 Added serverside code for custom Emoji (#3311)

* Added model objects for emoji

* Added database tables for emoji

* Added settings for custom emoji

* Added serverside APIs and unit tests for custom emoji

* Added additional validation to catch duplicate emoji names earlier on

* Added additional validation to prevent users from adding emoji as another user
Этот коммит содержится в:
Harrison Healey
2016-06-14 09:38:19 -04:00
коммит произвёл Christopher Speller
родитель 661f221727
Коммит a0cc913b85
18 изменённых файлов: 1538 добавлений и 5 удалений

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

@@ -51,10 +51,6 @@
"id": "system.message.name",
"translation": "System"
},
{
"id": "api.general.init.debug",
"translation": "Initializing general api routes"
},
{
"id": "api.admin.file_read_error",
"translation": "Error reading log file"
@@ -579,6 +575,54 @@
"id": "api.context.unknown.app_error",
"translation": "An unknown error has occurred. Please contact support."
},
{
"id": "api.emoji.create.duplicate.app_error",
"translation": "Unable to create emoji. Another emoji with the same name already exists."
},
{
"id": "api.emoji.create.parse.app_error",
"translation": "Unable to create emoji. Image exceeds maximum file size."
},
{
"id": "api.emoji.create.permissions.app_error",
"translation": "Inappropriate permissions to create emoji."
},
{
"id": "api.emoji.create.too_large.app_error",
"translation": "Unable to create emoji. Could not understand request."
},
{
"id": "api.emoji.delete.permissions.app_error",
"translation": "Inappropriate permissions to delete emoji."
},
{
"id": "api.emoji.disabled.app_error",
"translation": "Custom emoji have been disabled by the system admin."
},
{
"id": "api.emoji.get_image.decode.app_error",
"translation": "Unable to decode image file for emoji."
},
{
"id": "api.emoji.get_image.read.app_error",
"translation": "Unable to read image file for emoji."
},
{
"id": "api.emoji.storage.app_error",
"translation": "File storage not configured properly. Please configure for either S3 or local server file storage."
},
{
"id": "api.emoji.upload.image.app_error",
"translation": "Unable to create emoji. File must be a PNG, JPEG, or GIF."
},
{
"id": "api.emoji.upload.large_image.app_error",
"translation": "Unable to create emoji. Image exceeds maximum dimensions."
},
{
"id": "api.emoji.init.debug",
"translation": "Initializing emoji api routes"
},
{
"id": "api.export.json.app_error",
"translation": "Unable to convert to json"
@@ -743,6 +787,10 @@
"id": "api.file.write_file_locally.writing.app_error",
"translation": "Encountered an error writing to local server storage"
},
{
"id": "api.general.init.debug",
"translation": "Initializing general api routes"
},
{
"id": "api.import.import_post.saving.debug",
"translation": "Error saving post. user=%v, message=%v"
@@ -2323,6 +2371,18 @@
"id": "model.client.connecting.app_error",
"translation": "We encountered an error while connecting to the server"
},
{
"id": "model.client.create_emoji.emoji.app_error",
"translation": "Unable to attach emoji data to request"
},
{
"id": "model.client.create_emoji.image.app_error",
"translation": "Unable to attach image to request"
},
{
"id": "model.client.create_emoji.writer.app_error",
"translation": "Unable to write request"
},
{
"id": "model.client.login.app_error",
"translation": "Authentication tokens didn't match"
@@ -2499,6 +2559,26 @@
"id": "model.config.is_valid.sql_max_conn.app_error",
"translation": "Invalid maximum open connection for SQL settings. Must be a positive number."
},
{
"id": "model.emoji.create_at.app_error",
"translation": "Create at must be a valid time"
},
{
"id": "model.emoji.creator_id.app_error",
"translation": "Invalid creator id"
},
{
"id": "model.emoji.id.app_error",
"translation": "Invalid emoji id"
},
{
"id": "model.emoji.name.app_error",
"translation": "Name must be 1 to 64 lowercase alphanumeric characters"
},
{
"id": "model.emoji.update_at.app_error",
"translation": "Update at must be a valid time"
},
{
"id": "model.file_info.get.gif.app_error",
"translation": "Could not decode gif."
@@ -3195,6 +3275,30 @@
"id": "store.sql_compliance.save.saving.app_error",
"translation": "We encountered an error saving the compliance report"
},
{
"id": "store.sql_emoji.delete.app_error",
"translation": "We couldn't delete the emoji"
},
{
"id": "store.sql_emoji.delete.no_results",
"translation": "We couldnt find the emoji to delete"
},
{
"id": "store.sql_emoji.get.app_error",
"translation": "We couldn't get the emoji"
},
{
"id": "store.sql_emoji.get_by_name.app_error",
"translation": "We couldn't get the emoji"
},
{
"id": "store.sql_emoji.get_all.app_error",
"translation": "We couldn't get the emoji"
},
{
"id": "store.sql_emoji.save.app_error",
"translation": "We couldn't save the emoji"
},
{
"id": "store.sql_license.get.app_error",
"translation": "We encountered an error getting the license"