Skip to content
Snippets Groups Projects
Commit 4637f71c authored by jan.bednarik's avatar jan.bednarik
Browse files

Add is draft flag to Report type.

parent 745e75d1
Branches
No related tags found
No related merge requests found
Showing with 32 additions and 0 deletions
...@@ -27,6 +27,7 @@ class Report(graphene.ObjectType): ...@@ -27,6 +27,7 @@ class Report(graphene.ObjectType):
provided_benefit = graphene.String() provided_benefit = graphene.String()
our_participants = graphene.String() our_participants = graphene.String()
other_participants = graphene.String() other_participants = graphene.String()
is_draft = graphene.Boolean()
extra = JSONString() extra = JSONString()
class Meta: class Meta:
...@@ -45,6 +46,7 @@ class Report(graphene.ObjectType): ...@@ -45,6 +46,7 @@ class Report(graphene.ObjectType):
provided_benefit=get_higlighted(report, 'provided_benefit'), provided_benefit=get_higlighted(report, 'provided_benefit'),
our_participants=get_higlighted(report, 'our_participants'), our_participants=get_higlighted(report, 'our_participants'),
other_participants=get_higlighted(report, 'other_participants'), other_participants=get_higlighted(report, 'other_participants'),
is_draft=report.is_draft,
extra=report.extra, extra=report.extra,
) )
...@@ -61,6 +63,7 @@ class Report(graphene.ObjectType): ...@@ -61,6 +63,7 @@ class Report(graphene.ObjectType):
provided_benefit=report.provided_benefit, provided_benefit=report.provided_benefit,
our_participants=report.our_participants, our_participants=report.our_participants,
other_participants=report.other_participants, other_participants=report.other_participants,
is_draft=report.is_draft,
extra=report.extra, extra=report.extra,
) )
......
...@@ -39,6 +39,7 @@ snapshots['test_full_report 1'] = { ...@@ -39,6 +39,7 @@ snapshots['test_full_report 1'] = {
'date': '2018-01-01 00:00:00+00:00', 'date': '2018-01-01 00:00:00+00:00',
'extra': None, 'extra': None,
'id': '__STRIPPED__', 'id': '__STRIPPED__',
'isDraft': False,
'otherParticipants': 'Elon Musk', 'otherParticipants': 'Elon Musk',
'ourParticipants': 'me', 'ourParticipants': 'me',
'providedBenefit': 'nothing', 'providedBenefit': 'nothing',
...@@ -65,6 +66,7 @@ snapshots['test_is_draft 1'] = { ...@@ -65,6 +66,7 @@ snapshots['test_is_draft 1'] = {
'date': '2018-01-03 00:00:00+00:00', 'date': '2018-01-03 00:00:00+00:00',
'extra': None, 'extra': None,
'id': '__STRIPPED__', 'id': '__STRIPPED__',
'isDraft': True,
'otherParticipants': 'Neil deGrasse Tyson', 'otherParticipants': 'Neil deGrasse Tyson',
'ourParticipants': 'myself', 'ourParticipants': 'myself',
'providedBenefit': 'coffee', 'providedBenefit': 'coffee',
......
...@@ -90,6 +90,7 @@ snapshots['test_update_draft_with_draft 1'] = { ...@@ -90,6 +90,7 @@ snapshots['test_update_draft_with_draft 1'] = {
'date': '2018-03-03 00:00:00+00:00', 'date': '2018-03-03 00:00:00+00:00',
'extra': None, 'extra': None,
'id': 'UmVwb3J0OjE=', 'id': 'UmVwb3J0OjE=',
'isDraft': True,
'otherParticipants': 'Elon Musk', 'otherParticipants': 'Elon Musk',
'ourParticipants': 'me', 'ourParticipants': 'me',
'providedBenefit': 'nothing', 'providedBenefit': 'nothing',
...@@ -116,6 +117,7 @@ snapshots['test_update_draft_with_published 1'] = { ...@@ -116,6 +117,7 @@ snapshots['test_update_draft_with_published 1'] = {
'date': '2018-03-03 00:00:00+00:00', 'date': '2018-03-03 00:00:00+00:00',
'extra': None, 'extra': None,
'id': 'UmVwb3J0OjE=', 'id': 'UmVwb3J0OjE=',
'isDraft': False,
'otherParticipants': 'Elon Musk', 'otherParticipants': 'Elon Musk',
'ourParticipants': 'me', 'ourParticipants': 'me',
'providedBenefit': 'nothing', 'providedBenefit': 'nothing',
...@@ -142,6 +144,7 @@ snapshots['test_update_published_with_published 1'] = { ...@@ -142,6 +144,7 @@ snapshots['test_update_published_with_published 1'] = {
'date': '2018-03-03 00:00:00+00:00', 'date': '2018-03-03 00:00:00+00:00',
'extra': None, 'extra': None,
'id': 'UmVwb3J0OjE=', 'id': 'UmVwb3J0OjE=',
'isDraft': False,
'otherParticipants': 'Elon Musk', 'otherParticipants': 'Elon Musk',
'ourParticipants': 'me', 'ourParticipants': 'me',
'providedBenefit': 'nothing', 'providedBenefit': 'nothing',
...@@ -168,6 +171,7 @@ snapshots['test_input_sanitization 1'] = { ...@@ -168,6 +171,7 @@ snapshots['test_input_sanitization 1'] = {
'date': '2018-03-03 00:00:00+00:00', 'date': '2018-03-03 00:00:00+00:00',
'extra': None, 'extra': None,
'id': 'UmVwb3J0OjE=', 'id': 'UmVwb3J0OjE=',
'isDraft': False,
'otherParticipants': 'you!', 'otherParticipants': 'you!',
'ourParticipants': 'me, myself', 'ourParticipants': 'me, myself',
'providedBenefit': 'tea', 'providedBenefit': 'tea',
......
...@@ -24,6 +24,7 @@ mutation createReport ($input: CreateReportInput!) { ...@@ -24,6 +24,7 @@ mutation createReport ($input: CreateReportInput!) {
providedBenefit providedBenefit
ourParticipants ourParticipants
otherParticipants otherParticipants
isDraft
extra extra
author { author {
id id
......
...@@ -25,6 +25,7 @@ mutation updateReport ($input: UpdateReportInput!) { ...@@ -25,6 +25,7 @@ mutation updateReport ($input: UpdateReportInput!) {
providedBenefit providedBenefit
ourParticipants ourParticipants
otherParticipants otherParticipants
isDraft
extra extra
author { author {
id id
......
...@@ -200,6 +200,7 @@ snapshots['test_with_reports 1'] = { ...@@ -200,6 +200,7 @@ snapshots['test_with_reports 1'] = {
'date': '2018-01-05 00:00:00+00:00', 'date': '2018-01-05 00:00:00+00:00',
'extra': '{"rings": 1}', 'extra': '{"rings": 1}',
'id': 'UmVwb3J0OjI=', 'id': 'UmVwb3J0OjI=',
'isDraft': False,
'otherParticipants': 'Saruman, Sauron', 'otherParticipants': 'Saruman, Sauron',
'ourParticipants': 'Frodo, Gimli, Legolas', 'ourParticipants': 'Frodo, Gimli, Legolas',
'providedBenefit': '', 'providedBenefit': '',
...@@ -230,6 +231,7 @@ snapshots['test_with_reports 1'] = { ...@@ -230,6 +231,7 @@ snapshots['test_with_reports 1'] = {
'date': '2018-01-07 00:00:00+00:00', 'date': '2018-01-07 00:00:00+00:00',
'extra': None, 'extra': None,
'id': 'UmVwb3J0OjM=', 'id': 'UmVwb3J0OjM=',
'isDraft': False,
'otherParticipants': 'Sauron', 'otherParticipants': 'Sauron',
'ourParticipants': 'Aragorn', 'ourParticipants': 'Aragorn',
'providedBenefit': 'The Ring', 'providedBenefit': 'The Ring',
...@@ -245,6 +247,7 @@ snapshots['test_with_reports 1'] = { ...@@ -245,6 +247,7 @@ snapshots['test_with_reports 1'] = {
'date': '2018-01-01 00:00:00+00:00', 'date': '2018-01-01 00:00:00+00:00',
'extra': None, 'extra': None,
'id': 'UmVwb3J0OjE=', 'id': 'UmVwb3J0OjE=',
'isDraft': False,
'otherParticipants': 'Saruman', 'otherParticipants': 'Saruman',
'ourParticipants': 'Frodo, Gandalf', 'ourParticipants': 'Frodo, Gandalf',
'providedBenefit': '', 'providedBenefit': '',
......
...@@ -50,6 +50,7 @@ snapshots['test_report 1'] = { ...@@ -50,6 +50,7 @@ snapshots['test_report 1'] = {
'date': '2018-01-01 00:00:00+00:00', 'date': '2018-01-01 00:00:00+00:00',
'extra': None, 'extra': None,
'id': 'UmVwb3J0OjE=', 'id': 'UmVwb3J0OjE=',
'isDraft': False,
'otherParticipants': 'Saruman', 'otherParticipants': 'Saruman',
'ourParticipants': 'Frodo, Gandalf', 'ourParticipants': 'Frodo, Gandalf',
'providedBenefit': '', 'providedBenefit': '',
...@@ -102,6 +103,7 @@ snapshots['test_report__is_draft 1'] = { ...@@ -102,6 +103,7 @@ snapshots['test_report__is_draft 1'] = {
'data': { 'data': {
'node': { 'node': {
'id': 'UmVwb3J0OjQ=', 'id': 'UmVwb3J0OjQ=',
'isDraft': True,
'title': 'The Silmarillion' 'title': 'The Silmarillion'
} }
} }
......
...@@ -21,6 +21,7 @@ snapshots['test_authenticated 1'] = { ...@@ -21,6 +21,7 @@ snapshots['test_authenticated 1'] = {
'body': 'Not finished yet.', 'body': 'Not finished yet.',
'date': '2018-01-09 00:00:00+00:00', 'date': '2018-01-09 00:00:00+00:00',
'id': 'UmVwb3J0OjQ=', 'id': 'UmVwb3J0OjQ=',
'isDraft': True,
'otherParticipants': '', 'otherParticipants': '',
'ourParticipants': '', 'ourParticipants': '',
'providedBenefit': '', 'providedBenefit': '',
......
...@@ -26,6 +26,7 @@ snapshots['test_all 1'] = { ...@@ -26,6 +26,7 @@ snapshots['test_all 1'] = {
'date': '2018-01-05 00:00:00+00:00', 'date': '2018-01-05 00:00:00+00:00',
'extra': '{"rings": 1}', 'extra': '{"rings": 1}',
'id': 'UmVwb3J0OjI=', 'id': 'UmVwb3J0OjI=',
'isDraft': False,
'otherParticipants': 'Saruman, Sauron', 'otherParticipants': 'Saruman, Sauron',
'ourParticipants': 'Frodo, Gimli, Legolas', 'ourParticipants': 'Frodo, Gimli, Legolas',
'providedBenefit': '', 'providedBenefit': '',
...@@ -49,6 +50,7 @@ snapshots['test_all 1'] = { ...@@ -49,6 +50,7 @@ snapshots['test_all 1'] = {
'date': '2018-01-07 00:00:00+00:00', 'date': '2018-01-07 00:00:00+00:00',
'extra': None, 'extra': None,
'id': 'UmVwb3J0OjM=', 'id': 'UmVwb3J0OjM=',
'isDraft': False,
'otherParticipants': 'Sauron', 'otherParticipants': 'Sauron',
'ourParticipants': 'Aragorn', 'ourParticipants': 'Aragorn',
'providedBenefit': 'The Ring', 'providedBenefit': 'The Ring',
...@@ -72,6 +74,7 @@ snapshots['test_all 1'] = { ...@@ -72,6 +74,7 @@ snapshots['test_all 1'] = {
'date': '2018-01-01 00:00:00+00:00', 'date': '2018-01-01 00:00:00+00:00',
'extra': None, 'extra': None,
'id': 'UmVwb3J0OjE=', 'id': 'UmVwb3J0OjE=',
'isDraft': False,
'otherParticipants': 'Saruman', 'otherParticipants': 'Saruman',
'ourParticipants': 'Frodo, Gandalf', 'ourParticipants': 'Frodo, Gandalf',
'providedBenefit': '', 'providedBenefit': '',
...@@ -111,6 +114,7 @@ snapshots['test_query 1'] = { ...@@ -111,6 +114,7 @@ snapshots['test_query 1'] = {
'date': '2018-01-05 00:00:00+00:00', 'date': '2018-01-05 00:00:00+00:00',
'extra': '{"rings": 1}', 'extra': '{"rings": 1}',
'id': 'UmVwb3J0OjI=', 'id': 'UmVwb3J0OjI=',
'isDraft': False,
'otherParticipants': 'Saruman, Sauron', 'otherParticipants': 'Saruman, Sauron',
'ourParticipants': 'Frodo, Gimli, Legolas', 'ourParticipants': 'Frodo, Gimli, Legolas',
'providedBenefit': '', 'providedBenefit': '',
...@@ -144,6 +148,7 @@ snapshots['test_highlight 1'] = { ...@@ -144,6 +148,7 @@ snapshots['test_highlight 1'] = {
'date': '2018-01-07 00:00:00+00:00', 'date': '2018-01-07 00:00:00+00:00',
'extra': None, 'extra': None,
'id': 'UmVwb3J0OjM=', 'id': 'UmVwb3J0OjM=',
'isDraft': False,
'otherParticipants': 'Sauron', 'otherParticipants': 'Sauron',
'ourParticipants': 'Aragorn', 'ourParticipants': 'Aragorn',
'providedBenefit': 'The <mark>Ring</mark>', 'providedBenefit': 'The <mark>Ring</mark>',
...@@ -167,6 +172,7 @@ snapshots['test_highlight 1'] = { ...@@ -167,6 +172,7 @@ snapshots['test_highlight 1'] = {
'date': '2018-01-01 00:00:00+00:00', 'date': '2018-01-01 00:00:00+00:00',
'extra': None, 'extra': None,
'id': 'UmVwb3J0OjE=', 'id': 'UmVwb3J0OjE=',
'isDraft': False,
'otherParticipants': 'Saruman', 'otherParticipants': 'Saruman',
'ourParticipants': 'Frodo, Gandalf', 'ourParticipants': 'Frodo, Gandalf',
'providedBenefit': '', 'providedBenefit': '',
......
...@@ -187,6 +187,7 @@ def test_with_reports(client, snapshot): ...@@ -187,6 +187,7 @@ def test_with_reports(client, snapshot):
providedBenefit providedBenefit
ourParticipants ourParticipants
otherParticipants otherParticipants
isDraft
extra extra
} }
} }
......
...@@ -76,6 +76,7 @@ def test_report(client, snapshot): ...@@ -76,6 +76,7 @@ def test_report(client, snapshot):
providedBenefit providedBenefit
ourParticipants ourParticipants
otherParticipants otherParticipants
isDraft
extra extra
author {{ author {{
id id
...@@ -101,6 +102,7 @@ def test_report__is_draft(client, snapshot): ...@@ -101,6 +102,7 @@ def test_report__is_draft(client, snapshot):
... on Report {{ ... on Report {{
id id
title title
isDraft
}} }}
}} }}
}} }}
...@@ -117,6 +119,7 @@ def test_report__is_draft__unauthorized_viewer(client, snapshot): ...@@ -117,6 +119,7 @@ def test_report__is_draft__unauthorized_viewer(client, snapshot):
... on Report {{ ... on Report {{
id id
title title
isDraft
}} }}
}} }}
}} }}
...@@ -133,6 +136,7 @@ def test_report__is_draft__viewer_is_not_author(client, snapshot): ...@@ -133,6 +136,7 @@ def test_report__is_draft__viewer_is_not_author(client, snapshot):
... on Report {{ ... on Report {{
id id
title title
isDraft
}} }}
}} }}
}} }}
......
...@@ -34,6 +34,7 @@ def test_authenticated(client, snapshot): ...@@ -34,6 +34,7 @@ def test_authenticated(client, snapshot):
providedBenefit providedBenefit
ourParticipants ourParticipants
otherParticipants otherParticipants
isDraft
} }
} }
""" """
......
...@@ -25,6 +25,7 @@ def test_all(client, snapshot): ...@@ -25,6 +25,7 @@ def test_all(client, snapshot):
providedBenefit providedBenefit
ourParticipants ourParticipants
otherParticipants otherParticipants
isDraft
extra extra
author { author {
id id
...@@ -67,6 +68,7 @@ def test_query(client, snapshot): ...@@ -67,6 +68,7 @@ def test_query(client, snapshot):
providedBenefit providedBenefit
ourParticipants ourParticipants
otherParticipants otherParticipants
isDraft
extra extra
author { author {
id id
...@@ -103,6 +105,7 @@ def test_highlight(client, snapshot): ...@@ -103,6 +105,7 @@ def test_highlight(client, snapshot):
providedBenefit providedBenefit
ourParticipants ourParticipants
otherParticipants otherParticipants
isDraft
extra extra
author { author {
id id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment