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