Skip to content

Commit

Permalink
Remove hn from Heading Styles
Browse files Browse the repository at this point in the history
- Fix stype typo
  • Loading branch information
thenav56 committed Sep 4, 2023
1 parent be3171a commit 8a620ff
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 25 deletions.
12 changes: 6 additions & 6 deletions apps/analysis/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@

AnalysisReportVariableTypeEnum = convert_enum_to_graphene_enum(
ReportEnum.VariableType, name='AnalysisReportVariableTypeEnum')
AnalysisReportTextStypeAlignEnum = convert_enum_to_graphene_enum(
ReportEnum.TextStypeAlign, name='AnalysisReportTextStypeAlignEnum')
AnalysisReportBorderStyleStypeEnum = convert_enum_to_graphene_enum(
ReportEnum.BorderStyleStype, name='AnalysisReportBorderStyleStypeEnum')
AnalysisReportTextStyleAlignEnum = convert_enum_to_graphene_enum(
ReportEnum.TextStyleAlign, name='AnalysisReportTextStyleAlignEnum')
AnalysisReportBorderStyleStyleEnum = convert_enum_to_graphene_enum(
ReportEnum.BorderStyleStyle, name='AnalysisReportBorderStyleStyleEnum')
AnalysisReportImageContentStyleFitEnum = convert_enum_to_graphene_enum(
ReportEnum.ImageContentStyleFit, name='AnalysisReportImageContentStyleFitEnum')
AnalysisReportHeadingConfigurationVariantEnum = convert_enum_to_graphene_enum(
Expand All @@ -71,8 +71,8 @@
get_enum_name_from_django_field(serializer().fields[field]): enum
for serializer, field, enum in [
(AnalysisReportVariableSerializer, 'type', AnalysisReportVariableTypeEnum),
(AnalysisReportTextStyleSerializer, 'align', AnalysisReportTextStypeAlignEnum),
(AnalysisReportBorderStyleSerializer, 'style', AnalysisReportBorderStyleStypeEnum),
(AnalysisReportTextStyleSerializer, 'align', AnalysisReportTextStyleAlignEnum),
(AnalysisReportBorderStyleSerializer, 'style', AnalysisReportBorderStyleStyleEnum),
(AnalysisReportImageContentStyleSerializer, 'fit', AnalysisReportImageContentStyleFitEnum),
(AnalysisReportHeadingConfigurationSerializer, 'variant', AnalysisReportHeadingConfigurationVariantEnum),
]
Expand Down
14 changes: 9 additions & 5 deletions apps/analysis/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -550,13 +550,13 @@ class VariableType(models.TextChoices):
NUMBER = 'number'
DATE = 'date'

class TextStypeAlign(models.TextChoices):
class TextStyleAlign(models.TextChoices):
START = 'start'
END = 'end'
CENTER = 'center'
JUSTIFIED = 'justified'

class BorderStyleStype(models.TextChoices):
class BorderStyleStyle(models.TextChoices):
DOTTED = 'dotted'
DASHED = 'dashed'
SOLID = 'solid'
Expand Down Expand Up @@ -588,7 +588,7 @@ class AnalysisReportTextStyleSerializer(serializers.Serializer):
family = serializers.CharField(required=False)
size = serializers.IntegerField(required=False)
weight = serializers.IntegerField(required=False)
align = serializers.ChoiceField(choices=ReportEnum.TextStypeAlign.choices, required=False)
align = serializers.ChoiceField(choices=ReportEnum.TextStyleAlign.choices, required=False)


class AnalysisReportMarginStyleSerializer(serializers.Serializer):
Expand All @@ -609,7 +609,7 @@ class AnalysisReportBorderStyleSerializer(serializers.Serializer):
color = serializers.CharField(required=False)
width = serializers.IntegerField(required=False)
opacity = serializers.IntegerField(required=False)
style = serializers.ChoiceField(choices=ReportEnum.BorderStyleStype.choices, required=False)
style = serializers.ChoiceField(choices=ReportEnum.BorderStyleStyle.choices, required=False)


class AnalysisReportBackgroundStyleSerializer(serializers.Serializer):
Expand Down Expand Up @@ -645,6 +645,10 @@ class AnalysisReportTextContentStyleSerializer(serializers.Serializer):
content = AnalysisReportTextStyleSerializer(required=False, allow_null=True)


class AnalysisReportHeadingConfigurationStyleSerializer(serializers.Serializer):
content = AnalysisReportTextStyleSerializer(required=False, allow_null=True)


class AnalysisReportHeadingContentStyleSerializer(serializers.Serializer):
h1 = AnalysisReportTextStyleSerializer(required=False, allow_null=True)
h2 = AnalysisReportTextStyleSerializer(required=False, allow_null=True)
Expand All @@ -669,7 +673,7 @@ class AnalysisReportTextConfigurationSerializer(serializers.Serializer):

class AnalysisReportHeadingConfigurationSerializer(serializers.Serializer):
content = serializers.CharField(required=False)
style = AnalysisReportHeadingContentStyleSerializer(required=False, allow_null=True)
style = AnalysisReportHeadingConfigurationStyleSerializer(required=False, allow_null=True)
variant = serializers.ChoiceField(choices=ReportEnum.HeadingConfigurationVariant.choices, required=False)


Expand Down
36 changes: 22 additions & 14 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,10 @@ input AnalysisReportBorderStyleInputType {
color: String
width: Int
opacity: Int
style: AnalysisReportBorderStyleStypeEnum
style: AnalysisReportBorderStyleStyleEnum
}

enum AnalysisReportBorderStyleStypeEnum {
enum AnalysisReportBorderStyleStyleEnum {
DOTTED
DASHED
SOLID
Expand All @@ -335,7 +335,7 @@ type AnalysisReportBorderStyleType {
color: String
width: Int
opacity: Int
style: AnalysisReportBorderStyleStypeEnum
style: AnalysisReportBorderStyleStyleEnum
}

input AnalysisReportConfigurationInputType {
Expand Down Expand Up @@ -452,13 +452,21 @@ type AnalysisReportHeaderStyleType {

input AnalysisReportHeadingConfigurationInputType {
content: String
style: AnalysisReportHeadingContentStyleInputType
style: AnalysisReportHeadingConfigurationStyleInputType
variant: AnalysisReportHeadingConfigurationVariantEnum
}

input AnalysisReportHeadingConfigurationStyleInputType {
content: AnalysisReportTextStyleInputType
}

type AnalysisReportHeadingConfigurationStyleType {
content: AnalysisReportTextStyleType
}

type AnalysisReportHeadingConfigurationType {
content: String
style: AnalysisReportHeadingContentStyleType
style: AnalysisReportHeadingConfigurationStyleType
variant: AnalysisReportHeadingConfigurationVariantEnum
}

Expand Down Expand Up @@ -610,27 +618,27 @@ type AnalysisReportTextContentStyleType {
content: AnalysisReportTextStyleType
}

enum AnalysisReportTextStyleAlignEnum {
START
END
CENTER
JUSTIFIED
}

input AnalysisReportTextStyleInputType {
color: String
family: String
size: Int
weight: Int
align: AnalysisReportTextStypeAlignEnum
align: AnalysisReportTextStyleAlignEnum
}

type AnalysisReportTextStyleType {
color: String
family: String
size: Int
weight: Int
align: AnalysisReportTextStypeAlignEnum
}

enum AnalysisReportTextStypeAlignEnum {
START
END
CENTER
JUSTIFIED
align: AnalysisReportTextStyleAlignEnum
}

type AnalysisReportType {
Expand Down

0 comments on commit 8a620ff

Please sign in to comment.