Skip to content

Commit

Permalink
Merge pull request #3519 from uktrade/develop
Browse files Browse the repository at this point in the history
Release PR
  • Loading branch information
FoxJamie16 authored Oct 14, 2024
2 parents 4915220 + 8a77f7a commit 989a0c9
Show file tree
Hide file tree
Showing 116 changed files with 1,786 additions and 2,050 deletions.
174 changes: 5 additions & 169 deletions activitystream/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,18 @@
from wagtail.rich_text import RichText, get_text_for_indexing

from core.models import (
CsatUserFeedback as WhereToExportCsatUserFeedback,
HCSAT,
GreatMedia,
MicrositePage,
)
from domestic.models import ArticlePage
from export_academy.models import (
Booking,
CsatUserFeedback,
Event,
Registration,
VideoOnDemandPageTracking,
)
from exportplan.models import CsatUserFeedback as ExportPlanCsatUserFeedback
from find_a_buyer.models import CsatUserFeedback as FindABuyerCsatUserFeedback
from international_online_offer.models import CsatFeedback, TriageData, UserData
from learn.models import CsatUserFeedback as LearnToExportCsatUserFeedback

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -595,16 +591,16 @@ def to_representation(self, instance):
}


class ActivityStreamExportAcademyCsatUserFeedbackDataSerializer(serializers.ModelSerializer):
class ActivityStreamDomesticHCSATUserFeedbackDataSerializer(serializers.ModelSerializer):
"""
UKEA's CSAT Feedback Data serializer for activity stream.
Domestic HCSAT Feedback Data serializer for activity stream.
"""

feedback_submission_date = serializers.DateTimeField(source='created') # noqa: N815
url = serializers.CharField(source='URL') # noqa: N815

class Meta:
model = CsatUserFeedback
model = HCSAT
fields = [
'id',
'feedback_submission_date',
Expand All @@ -621,167 +617,7 @@ def to_representation(self, instance):
"""
Prefix field names to match activity stream format
"""
prefix = 'dit:exportAcademy:csatFeedbackData'
type = 'Update'

return {
'id': f'{prefix}:{instance.id}:{type}',
'type': f'{type}',
'object': {
'id': f'{prefix}:{instance.id}',
'type': prefix,
**{f'{k}': v for k, v in super().to_representation(instance).items()},
},
}


class ActivityStreamWhereToExportCsatUserFeedbackDataSerializer(serializers.ModelSerializer):
"""
Where to Export's CSAT Feedback Data serializer for activity stream.
"""

feedback_submission_date = serializers.DateTimeField(source='created') # noqa: N815
url = serializers.CharField(source='URL') # noqa: N815

class Meta:
model = WhereToExportCsatUserFeedback
fields = [
'id',
'feedback_submission_date',
'url',
'user_journey',
'satisfaction_rating',
'experienced_issues',
'other_detail',
'service_improvements_feedback',
'likelihood_of_return',
]

def to_representation(self, instance):
"""
Prefix field names to match activity stream format
"""
prefix = 'dit:whereToExport:csatFeedbackData'
type = 'Update'

return {
'id': f'{prefix}:{instance.id}:{type}',
'type': f'{type}',
'object': {
'id': f'{prefix}:{instance.id}',
'type': prefix,
**{f'{k}': v for k, v in super().to_representation(instance).items()},
},
}


class ActivityStreamFindABuyerCsatUserFeedbackDataSerializer(serializers.ModelSerializer):
"""
Find A Buyer CSAT Feedback Data serializer for activity stream.
"""

feedback_submission_date = serializers.DateTimeField(source='created') # noqa: N815
url = serializers.CharField(source='URL') # noqa: N815

class Meta:
model = FindABuyerCsatUserFeedback
fields = [
'id',
'feedback_submission_date',
'url',
'user_journey',
'satisfaction_rating',
'experienced_issues',
'other_detail',
'service_improvements_feedback',
'likelihood_of_return',
]

def to_representation(self, instance):
"""
Prefix field names to match activity stream format
"""
prefix = 'dit:findABuyer:csatFeedbackData'
type = 'Update'

return {
'id': f'{prefix}:{instance.id}:{type}',
'type': f'{type}',
'object': {
'id': f'{prefix}:{instance.id}',
'type': prefix,
**{f'{k}': v for k, v in super().to_representation(instance).items()},
},
}


class ActivityStreamLearnToExportCsatUserFeedbackDataSerializer(serializers.ModelSerializer):
"""
Learn To Export CSAT Feedback Data serializer for activity stream.
"""

feedback_submission_date = serializers.DateTimeField(source='created') # noqa: N815
url = serializers.CharField(source='URL') # noqa: N815

class Meta:
model = LearnToExportCsatUserFeedback
fields = [
'id',
'feedback_submission_date',
'url',
'user_journey',
'satisfaction_rating',
'experienced_issues',
'other_detail',
'service_improvements_feedback',
'likelihood_of_return',
]

def to_representation(self, instance):
"""
Prefix field names to match activity stream format
"""
prefix = 'dit:learnToExport:csatFeedbackData'
type = 'Update'

return {
'id': f'{prefix}:{instance.id}:{type}',
'type': f'{type}',
'object': {
'id': f'{prefix}:{instance.id}',
'type': prefix,
**{f'{k}': v for k, v in super().to_representation(instance).items()},
},
}


class ActivityStreamExportPlanCsatUserFeedbackDataSerializer(serializers.ModelSerializer):
"""
Make an Export Plan CSAT Feedback Data serializer for activity stream.
"""

feedback_submission_date = serializers.DateTimeField(source='created') # noqa: N815
url = serializers.CharField(source='URL') # noqa: N815

class Meta:
model = ExportPlanCsatUserFeedback
fields = [
'id',
'feedback_submission_date',
'url',
'user_journey',
'satisfaction_rating',
'experienced_issues',
'other_detail',
'service_improvements_feedback',
'likelihood_of_return',
]

def to_representation(self, instance):
"""
Prefix field names to match activity stream format
"""
prefix = 'dit:exportPlan:csatFeedbackData'
prefix = 'dit:domestic:HCSATFeedbackData'
type = 'Update'

return {
Expand Down
26 changes: 3 additions & 23 deletions activitystream/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,28 +62,8 @@
name='ukea-videoondemandpagetracking',
),
path(
'ukea-csats/',
skip_ga360(activitystream.views.ActivityStreamExportAcademyCsatFeedbackDataView.as_view()),
name='ukea-csats',
),
path(
'wheretoexport-csats/',
skip_ga360(activitystream.views.ActivityStreamWhereToExportCsatFeedbackDataView.as_view()),
name='wheretoexport-csats',
),
path(
'findabuyer-csats/',
skip_ga360(activitystream.views.ActivityStreamFindABuyerCsatFeedbackDataView.as_view()),
name='findabuyer-csats',
),
path(
'learntoexport-csats/',
skip_ga360(activitystream.views.ActivityStreamLearnToExportCsatFeedbackDataView.as_view()),
name='learntoexport-csats',
),
path(
'exportplan-csats/',
skip_ga360(activitystream.views.ActivityStreamExportPlanCsatFeedbackDataView.as_view()),
name='exportplan-csats',
'domestic-hcsats/',
skip_ga360(activitystream.views.ActivityStreamDomesticHCSATFeedbackDataView.as_view()),
name='domestic-hcsats',
),
]
51 changes: 9 additions & 42 deletions activitystream/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,28 @@
)
from activitystream.serializers import (
ActivityStreamCmsContentSerializer,
ActivityStreamDomesticHCSATUserFeedbackDataSerializer,
ActivityStreamExpandYourBusinessCsatFeedbackDataSerializer,
ActivityStreamExpandYourBusinessTriageDataSerializer,
ActivityStreamExpandYourBusinessUserDataSerializer,
ActivityStreamExportAcademyBookingSerializer,
ActivityStreamExportAcademyCsatUserFeedbackDataSerializer,
ActivityStreamExportAcademyEventSerializer,
ActivityStreamExportAcademyRegistrationSerializer,
ActivityStreamExportAcademyVideoOnDemandPageTrackingSerializer,
ActivityStreamExportPlanCsatUserFeedbackDataSerializer,
ActivityStreamFindABuyerCsatUserFeedbackDataSerializer,
ActivityStreamLearnToExportCsatUserFeedbackDataSerializer,
ActivityStreamWhereToExportCsatUserFeedbackDataSerializer,
PageSerializer,
)
from core.models import CsatUserFeedback as WhereToExportCsatUserFeedback, MicrositePage
from core.models import (
HCSAT,
MicrositePage,
)
from domestic.models import ArticlePage, CountryGuidePage
from export_academy.models import (
Booking,
CsatUserFeedback,
Event,
Registration,
VideoOnDemandPageTracking,
)
from exportplan.models import CsatUserFeedback as ExportPlanCsatUserFeedback
from find_a_buyer.models import CsatUserFeedback as FindABuyerCsatUserFeedback
from international_online_offer.models import CsatFeedback, TriageData, UserData
from learn.models import CsatUserFeedback as LearnToExportCsatUserFeedback


class ActivityStreamView(ListAPIView):
Expand Down Expand Up @@ -277,13 +272,6 @@ def get_queryset(self):
return self.queryset.order_by('id')


class ActivityStreamExportAcademyCsatFeedbackDataView(ActivityStreamExportAcademyBaseView):
"""View to list export academy csat feedback data for the activity stream"""

queryset = CsatUserFeedback.objects.all()
serializer_class = ActivityStreamExportAcademyCsatUserFeedbackDataSerializer


class ActivityStreamHCSATBaseView(ActivityStreamBaseView):
filterset_class = ActivityStreamHCSATFilter
pagination_class = ActivityStreamHCSATPagination
Expand All @@ -292,29 +280,8 @@ def get_queryset(self):
return self.queryset.order_by('id')


class ActivityStreamWhereToExportCsatFeedbackDataView(ActivityStreamHCSATBaseView):
"""View to list where to export csat feedback data for the activity stream"""

queryset = WhereToExportCsatUserFeedback.objects.all()
serializer_class = ActivityStreamWhereToExportCsatUserFeedbackDataSerializer


class ActivityStreamFindABuyerCsatFeedbackDataView(ActivityStreamHCSATBaseView):
"""View to list find a buyer csat feedback data for the activity stream"""

queryset = FindABuyerCsatUserFeedback.objects.all()
serializer_class = ActivityStreamFindABuyerCsatUserFeedbackDataSerializer


class ActivityStreamLearnToExportCsatFeedbackDataView(ActivityStreamHCSATBaseView):
"""View to list learn to export csat feedback data for the activity stream"""

queryset = LearnToExportCsatUserFeedback.objects.all()
serializer_class = ActivityStreamLearnToExportCsatUserFeedbackDataSerializer


class ActivityStreamExportPlanCsatFeedbackDataView(ActivityStreamHCSATBaseView):
"""View to list Export plan csat feedback data for the activity stream"""
class ActivityStreamDomesticHCSATFeedbackDataView(ActivityStreamHCSATBaseView):
"""View to list domestic HCSAT feedback data for the activity stream"""

queryset = ExportPlanCsatUserFeedback.objects.all()
serializer_class = ActivityStreamExportPlanCsatUserFeedbackDataSerializer
queryset = HCSAT.objects.all()
serializer_class = ActivityStreamDomesticHCSATUserFeedbackDataSerializer
1 change: 0 additions & 1 deletion config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,6 @@
FEATURE_UKEA_TRADING_BLOC_FILTER = env.bool('FEATURE_UKEA_TRADING_BLOC_FILTER', False)
FEATURE_MARKET_GUIDES_SECTOR_LINKS = env.bool('FEATURE_MARKET_GUIDES_SECTOR_LINKS', False)

FEATURE_FAB_HCSAT = env.bool('FEATURE_FAB_HCSAT', False)
FEATURE_DESIGN_SYSTEM = env.bool('FEATURE_DESIGN_SYSTEM', False)

FEATURE_GREAT_ERROR = env.bool('FEATURE_GREAT_ERROR', False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<div class="great-container govuk-!-padding-top-4">
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<div class="great-bg-white govuk-!-padding-6 great-ds-box-shadow">
<div class="great-bg-white govuk-!-padding-6 great-ds-box-shadow great-ds-widget-container">
<form method="post" autocomplete="off">
{% csrf_token %}
<input type="hidden" id="sector" name="sector" value="{{ session_data.sector }}" />
Expand All @@ -32,6 +32,10 @@ <h1>
</div>

{% include 'domestic/contact/export-support/includes/continue-save-button.html' %}

{% if is_edit_mode %}
{% include 'domestic/contact/export-support/includes/cancel-button.html' with url='/guided-journey/step-' back_step=request.GET.return_to_step %}
{% endif %}
</form>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ <h1>
{% if field.name == 'not_sure_where_to_export' %}
<div class="govuk-form-group govuk-!-margin-top-3 govuk-!-margin-bottom-3 {% if field.errors %}govuk-form-group--error{% endif %}">
<div class="govuk-checkboxes__item govuk-!-margin-bottom-3 great-checkbox">
<input class="govuk-checkboxes__input" id="id_not_sure_where_to_export" name="not_sure_where_to_export" type="checkbox" value="{{ field.value }}" />
<input class="govuk-checkboxes__input" id="id_not_sure_where_to_export" name="not_sure_where_to_export" type="checkbox" />
<label id="id_not_sure_where_to_export-label" for="id_not_sure_where_to_export" class="govuk-label govuk-checkboxes__label">{{ field.label }}</label>
</div>
</div>
{% elif field.name == 'market_not_listed' %}
<div class="govuk-form-group govuk-!-margin-bottom-3 {% if field.errors %}govuk-form-group--error{% endif %}">
<div class="govuk-checkboxes__item govuk-!-margin-bottom-3 great-checkbox">
<input class="govuk-checkboxes__input" id="id_market_not_listed" name="market_not_listed" type="checkbox" value="{{ field.value }}" />
<input class="govuk-checkboxes__input" id="id_market_not_listed" name="market_not_listed" type="checkbox" />
<label id="id_market_not_listed-label" for="id_market_not_listed" class="govuk-label govuk-checkboxes__label">{{ field.label }}</label>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

<a href="{{ url }}" class="govuk-link great-ds-skip-control"><span>Cancel changes</span></a>
<a href="{{ url }}{{ back_step }}" class="govuk-link great-ds-skip-control"><span>Cancel changes</span></a>
Loading

0 comments on commit 989a0c9

Please sign in to comment.