Skip to content

Commit

Permalink
Revert "Change the task template text field to RichtextField / to fix…
Browse files Browse the repository at this point in the history
… the GEVER E2E tests"

This reverts commit f11adaa.
  • Loading branch information
Abdu-moustafa committed Jan 31, 2025
1 parent edcad6b commit 20c45a9
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 60 deletions.
1 change: 0 additions & 1 deletion changes/TI-1333.feature

This file was deleted.

2 changes: 1 addition & 1 deletion docs/public/dev-manual/api/api_changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ API Changelog

Breaking Changes
^^^^^^^^^^^^^^^^
- The task template text field was changed from a Text field to a RichTextField.


Other Changes
^^^^^^^^^^^^^
Expand Down
3 changes: 1 addition & 2 deletions opengever/api/tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def test_create_simple_process(self, browser):
"start_immediately": False,
"process": {
"title": "New employee",
"text": "<p> A new employee arrives.</p>",
"text": "A new employee arrives.",
"sequence_type": "sequential",
"items": [
{
Expand All @@ -138,7 +138,6 @@ def test_create_simple_process(self, browser):
self.assertEqual(1, len(children['added']))
main_task = children['added'].pop()

self.assertEqual("<p> A new employee arrives.</p>", main_task.text.output)
self.assertEqual(browser.json['@id'], main_task.absolute_url())
self.assertEqual(u'New employee', main_task.title)
self.assertEqual(self.regular_user.getId(), main_task.issuer)
Expand Down
28 changes: 0 additions & 28 deletions opengever/api/tests/test_tasktemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,3 @@ def test_tasktemplate_responsible_has_a_responsible_client(self, browser):
browser.json.get('responsible'))
self.assertEquals({u'title': u'Finanz\xe4mt', u'token': u'fa'},
browser.json.get('responsible_client'))

@browsing
def test_tasktemplate_with_richt_text_description(self, browser):
self.login(self.administrator, browser=browser)

data = {
'@type': u'opengever.tasktemplates.tasktemplate',
'title': 'Testtasktemplate',
'task_type': {'token': 'information'},
'deadline': 7,
'issuer': {'token': INTERACTIVE_ACTOR_RESPONSIBLE_ID},
"responsible": {
'token': "fa:{}".format(self.secretariat_user.id),
'title': u'Finanzamt: K\xe4thi B\xe4rfuss'
},
"text": "task template description"
}

browser.open(self.tasktemplatefolder, method="POST",
headers=self.api_headers, data=json.dumps(data))

self.assertEquals(
{
u'data': u'task template description',
u'content-type': u'text/html',
u'encoding': u'utf8'
}, browser.json.get("text")
)
Empty file.

This file was deleted.

8 changes: 3 additions & 5 deletions opengever/tasktemplates/content/tasktemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from opengever.tasktemplates import _
from opengever.tasktemplates.sources import TaskResponsibleSourceBinder
from opengever.tasktemplates.sources import TaskTemplateIssuerSourceBinder
from plone.app.textfield import RichText
from plone.autoform import directives as form
from plone.dexterity.browser.add import DefaultAddForm
from plone.dexterity.browser.add import DefaultAddView
Expand Down Expand Up @@ -87,12 +86,11 @@ class ITaskTemplate(model.Schema):

# Bad naming: comments is more appropriated
model.primary('text')
text = RichText(
title=_(u'label_text', default='Text'),
text = schema.Text(
title=_(u"label_text", default=u"Text"),
description=_(u"help_text", default=u""),
required=False,
default_mime_type='text/html',
output_mime_type='text/x-html-safe')
)

form.widget(preselected=checkbox.SingleCheckBoxFieldWidget)
preselected = schema.Bool(
Expand Down

0 comments on commit 20c45a9

Please sign in to comment.