diff --git a/app/migrations/0029_auto_20190907_1348.py b/app/migrations/0029_auto_20190907_1348.py new file mode 100644 index 00000000..09b6e0a1 --- /dev/null +++ b/app/migrations/0029_auto_20190907_1348.py @@ -0,0 +1,19 @@ +# Generated by Django 2.1.11 on 2019-09-07 13:48 + +import app.models.image_upload +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('app', '0028_task_partial'), + ] + + operations = [ + migrations.AlterField( + model_name='imageupload', + name='image', + field=models.ImageField(help_text='File uploaded by a user', max_length=512, upload_to=app.models.image_upload.image_directory_path), + ), + ] diff --git a/app/models/image_upload.py b/app/models/image_upload.py index d7b07fd7..d5f0f924 100644 --- a/app/models/image_upload.py +++ b/app/models/image_upload.py @@ -7,7 +7,7 @@ def image_directory_path(image_upload, filename): class ImageUpload(models.Model): task = models.ForeignKey(Task, on_delete=models.CASCADE, help_text="Task this image belongs to") - image = models.ImageField(upload_to=image_directory_path, help_text="File uploaded by a user") + image = models.ImageField(upload_to=image_directory_path, help_text="File uploaded by a user", max_length=512) def __str__(self): return self.image.name diff --git a/app/static/app/js/components/TaskPluginActionButtons.jsx b/app/static/app/js/components/TaskPluginActionButtons.jsx index 27c03b95..827a9a06 100644 --- a/app/static/app/js/components/TaskPluginActionButtons.jsx +++ b/app/static/app/js/components/TaskPluginActionButtons.jsx @@ -29,6 +29,8 @@ class TaskPluginActionButtons extends React.Component { }, (button) => { if (!button) return; + console.log(button); + this.setState(update(this.state, { buttons: {$push: [button]} })); diff --git a/plugins/cloudimport/public/TaskView.jsx b/plugins/cloudimport/public/TaskView.jsx index 0e547d75..fbc6bbd5 100644 --- a/plugins/cloudimport/public/TaskView.jsx +++ b/plugins/cloudimport/public/TaskView.jsx @@ -7,7 +7,7 @@ export default class TaskView extends Component { static propTypes = { task: PropTypes.object.isRequired, apiURL: PropTypes.string.isRequired, - } + } state = { folderUrl: null, diff --git a/plugins/cloudimport/templates/load_buttons.js b/plugins/cloudimport/templates/load_buttons.js index 983e16f3..0d419bd1 100644 --- a/plugins/cloudimport/templates/load_buttons.js +++ b/plugins/cloudimport/templates/load_buttons.js @@ -1,20 +1,20 @@ PluginsAPI.Dashboard.addNewTaskButton( ["cloudimport/build/ImportView.js"], function(args, ImportView) { - return React.createElement(ImportView, { - onNewTaskAdded: args.onNewTaskAdded, - projectId: args.projectId, - apiURL: "{{ api_url }}", - }); + return React.createElement(ImportView, { + onNewTaskAdded: args.onNewTaskAdded, + projectId: args.projectId, + apiURL: "{{ api_url }}", + }); } ); PluginsAPI.Dashboard.addTaskActionButton( ["cloudimport/build/TaskView.js"], function(args, ImportView) { - return React.createElement(ImportView, { - task: args.task, - apiURL: "{{ api_url }}", - }); + return React.createElement(ImportView, { + task: args.task, + apiURL: "{{ api_url }}", + }); } );