From 42ca11a840545cb8bff0444e93cebbafbd9cfd6c Mon Sep 17 00:00:00 2001 From: thenav56 Date: Mon, 4 Sep 2023 13:59:43 +0545 Subject: [PATCH] Remove hn from Heading Styles - Fix stype typo --- apps/analysis/enums.py | 12 ++++++------ apps/analysis/serializers.py | 14 +++++++++----- schema.graphql | 36 ++++++++++++++++++++++-------------- 3 files changed, 37 insertions(+), 25 deletions(-) diff --git a/apps/analysis/enums.py b/apps/analysis/enums.py index 3018f10b14..e52ea30d84 100644 --- a/apps/analysis/enums.py +++ b/apps/analysis/enums.py @@ -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( @@ -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), ] diff --git a/apps/analysis/serializers.py b/apps/analysis/serializers.py index 00d4d67a8f..8119934bcd 100644 --- a/apps/analysis/serializers.py +++ b/apps/analysis/serializers.py @@ -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' @@ -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): @@ -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): @@ -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) @@ -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) diff --git a/schema.graphql b/schema.graphql index ec6e475cc6..d5d616d7d6 100644 --- a/schema.graphql +++ b/schema.graphql @@ -320,10 +320,10 @@ input AnalysisReportBorderStyleInputType { color: String width: Int opacity: Int - style: AnalysisReportBorderStyleStypeEnum + style: AnalysisReportBorderStyleStyleEnum } -enum AnalysisReportBorderStyleStypeEnum { +enum AnalysisReportBorderStyleStyleEnum { DOTTED DASHED SOLID @@ -335,7 +335,7 @@ type AnalysisReportBorderStyleType { color: String width: Int opacity: Int - style: AnalysisReportBorderStyleStypeEnum + style: AnalysisReportBorderStyleStyleEnum } input AnalysisReportConfigurationInputType { @@ -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 } @@ -610,12 +618,19 @@ 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 { @@ -623,14 +638,7 @@ type AnalysisReportTextStyleType { family: String size: Int weight: Int - align: AnalysisReportTextStypeAlignEnum -} - -enum AnalysisReportTextStypeAlignEnum { - START - END - CENTER - JUSTIFIED + align: AnalysisReportTextStyleAlignEnum } type AnalysisReportType {