Skip to content

Commit

Permalink
Sprint 67 - Sgt Lonely - release 1 (#806)
Browse files Browse the repository at this point in the history
* tss-2038-fix-csat-keyboard-nav (#764)

* fix keyboard navigation and focus

* Fix formating

* feat focus and hover highlights the star

---------

Co-authored-by: Uka Osim <[email protected]>

* Feature/tss 2038/csat keyboard fixes (#767)

* fix keyboard navigation and focus

* Fix formating

* feat focus and hover highlights the star

* changing hover and focus for CSAT

---------

Co-authored-by: Feroze Rub <[email protected]>

* Feature/tss 2038/csat keyboard fixes (#769)

* fix keyboard navigation and focus

* Fix formating

* feat focus and hover highlights the star

* changing hover and focus for CSAT

* added thicker border on the stars on focus

---------

Co-authored-by: Feroze Rub <[email protected]>

* Tss 2045 dmas hcsat focus appearance issue and and tabbing paging issue (#770)

* wip

* now focus goes to stars when tabbed

* Feature/tss 2038/csat keyboard fixes (#767)

* fix keyboard navigation and focus

* Fix formating

* feat focus and hover highlights the star

* changing hover and focus for CSAT

---------

Co-authored-by: Feroze Rub <[email protected]>

* Feature/tss 2038/csat keyboard fixes (#769)

* fix keyboard navigation and focus

* Fix formating

* feat focus and hover highlights the star

* changing hover and focus for CSAT

* added thicker border on the stars on focus

---------

Co-authored-by: Feroze Rub <[email protected]>

* Tss 2045 dmas hcsat focus appearance issue and and tabbing paging issue (#770)

* wip

* now focus goes to stars when tabbed

* TSS/1977: add a policy team (#773)

* Building forms

* Building views

* Adding views to URLs file

* Building HTML files

* Adding funcs to get data from API

* Adding policy team section to barrier details page

* Formatting

* Adding policy team dummy data to metadata file

* Adding new tests

* Updating dummy barrier to include policy team info

* Adding history functionality

* Formatting

* Amending for Flake8 error

* Making policy team descriptions dynamic

* Formatting

* Removing Barrier Category from page

* Removing comments

* Frontend test for policy teams

* Formatting

* removing unused imports

* Cleaning up tests

* Formatting

* updating to absolute imports

* Formatting

* fixing faulty test

* TSS-2016: policy teams search (#776)

* Building forms

* Building views

* Adding views to URLs file

* Building HTML files

* Adding funcs to get data from API

* Adding policy team section to barrier details page

* Formatting

* Adding policy team dummy data to metadata file

* Adding new tests

* Updating dummy barrier to include policy team info

* Adding history functionality

* Formatting

* Amending for Flake8 error

* Making policy team descriptions dynamic

* Formatting

* Removing Barrier Category from page

* Removing comments

* Frontend test for policy teams

* Formatting

* removing unused imports

* Cleaning up tests

* Formatting

* updating to absolute imports

* Formatting

* fixing faulty test

* Adding HTML

* Primary functionality

* Frontend test

* Formatting

* Removing category filtering from search page

* Removing category search tests

---------

Co-authored-by: abarolo <[email protected]>

* TSS-2081: Policy Teams History (#781)

* Rendering policy teams correctly

* Adding test

* Formatting

* Hotfix: TSS-2019: Policy teams bug  (#779)

* Fixing bug

* Fixing test

* Tweaking copy

* tss-2119: Dependency updates (#789)

Co-authored-by: abarolo <[email protected]>

* Allow template countdown check to be bypassed for published barriers (#791)

Co-authored-by: santinomolinaro <santino.molinaro@mail>

* Updating dashboard banner to display message about Policy Team functionality (#793)

Co-authored-by: santinomolinaro <santino.molinaro@mail>

* Removing padding on the text within banner notification component (#796)

Co-authored-by: santinomolinaro <santino.molinaro@mail>

* Tss 1937 dmas dashboard build parent ticket (#797)

* tss-2038-fix-csat-keyboard-nav (#764)

* fix keyboard navigation and focus

* Fix formating

* feat focus and hover highlights the star

---------

Co-authored-by: Uka Osim <[email protected]>

* Feature/tss 2038/csat keyboard fixes (#767)

* fix keyboard navigation and focus

* Fix formating

* feat focus and hover highlights the star

* changing hover and focus for CSAT

---------

Co-authored-by: Feroze Rub <[email protected]>

* Feature/tss 2038/csat keyboard fixes (#769)

* fix keyboard navigation and focus

* Fix formating

* feat focus and hover highlights the star

* changing hover and focus for CSAT

* added thicker border on the stars on focus

---------

Co-authored-by: Feroze Rub <[email protected]>

* Tss 2045 dmas hcsat focus appearance issue and and tabbing paging issue (#770)

* wip

* now focus goes to stars when tabbed

* Feature/tss 2038/csat keyboard fixes (#767)

* fix keyboard navigation and focus

* Fix formating

* feat focus and hover highlights the star

* changing hover and focus for CSAT

---------

Co-authored-by: Feroze Rub <[email protected]>

* Feature/tss 2038/csat keyboard fixes (#769)

* fix keyboard navigation and focus

* Fix formating

* feat focus and hover highlights the star

* changing hover and focus for CSAT

* added thicker border on the stars on focus

---------

Co-authored-by: Feroze Rub <[email protected]>

* Tss 2045 dmas hcsat focus appearance issue and and tabbing paging issue (#770)

* wip

* now focus goes to stars when tabbed

* dashboard v2 structure GDS

* base branch lint

* TSS-1970 changing footer per new design with the correct links

* lint fix

* TSS/1977: add a policy team (#773)

* Building forms

* Building views

* Adding views to URLs file

* Building HTML files

* Adding funcs to get data from API

* Adding policy team section to barrier details page

* Formatting

* Adding policy team dummy data to metadata file

* Adding new tests

* Updating dummy barrier to include policy team info

* Adding history functionality

* Formatting

* Amending for Flake8 error

* Making policy team descriptions dynamic

* Formatting

* Removing Barrier Category from page

* Removing comments

* Frontend test for policy teams

* Formatting

* removing unused imports

* Cleaning up tests

* Formatting

* updating to absolute imports

* Formatting

* fixing faulty test

* TSS-2016: policy teams search (#776)

* Building forms

* Building views

* Adding views to URLs file

* Building HTML files

* Adding funcs to get data from API

* Adding policy team section to barrier details page

* Formatting

* Adding policy team dummy data to metadata file

* Adding new tests

* Updating dummy barrier to include policy team info

* Adding history functionality

* Formatting

* Amending for Flake8 error

* Making policy team descriptions dynamic

* Formatting

* Removing Barrier Category from page

* Removing comments

* Frontend test for policy teams

* Formatting

* removing unused imports

* Cleaning up tests

* Formatting

* updating to absolute imports

* Formatting

* fixing faulty test

* Adding HTML

* Primary functionality

* Frontend test

* Formatting

* Removing category filtering from search page

* Removing category search tests

---------

Co-authored-by: abarolo <[email protected]>

* TSS-1970-dmas-dashboard-v-2-html-template-layout-structure (#774)

* adding base structure to the page

* lint fix

* structure set for dashboard v2

* extending gov-uk stylesheet

* added search page link with search term

* fixing dashboard deasign

* update based on chnages made to design

* lint fix

* feature/TSS-1968-dmas-dashboard-v-2-whats-new-on-dmas (#782)

* adding the whats new on dmas section

* fixing used tags

* Dashboard tasks list (#787)

Co-authored-by: santinomolinaro <santino.molinaro@mail>

* Re-align tasks list summary columns

* Summary cards and integrated filters (#792)

* Summary cards and integrated filters

* Tidy up

* Format

* Fix tests

* Fix tests

* TSS-1967 dmas-dashboard-v-2-dashboard-charts (#790)

* intial charts

* lint fix

* added css and scss loader for react

* charts loading with gds layout

* rendering all charts appropriately

* fixing lint issues

* using gds color scheme

* lint fix

* Dashboard layout fix (#795)

* Dashboard live data feed (#799)

* Dashboard live data feed

* Format

* Format

* f

* Sort imports

* Tidy up

---------

Co-authored-by: Feroze Rub <[email protected]>
Co-authored-by: Uka Osim <[email protected]>
Co-authored-by: Elizabeth Pedley <[email protected]>
Co-authored-by: abarolo <[email protected]>
Co-authored-by: abarolo <[email protected]>
Co-authored-by: santinomolinaro <santino.molinaro@mail>

* TSS-2137-dmas-dashboard-v-2-summary-page-filter-update (#798)

* dashboard v2 structure GDS

* base branch lint

* TSS-1970 changing footer per new design with the correct links

* lint fix

* TSS-1970-dmas-dashboard-v-2-html-template-layout-structure (#774)

* adding base structure to the page

* lint fix

* structure set for dashboard v2

* extending gov-uk stylesheet

* added search page link with search term

* fixing dashboard deasign

* update based on chnages made to design

* lint fix

* feature/TSS-1968-dmas-dashboard-v-2-whats-new-on-dmas (#782)

* adding the whats new on dmas section

* fixing used tags

* Dashboard tasks list (#787)

Co-authored-by: santinomolinaro <santino.molinaro@mail>

* Re-align tasks list summary columns

* Summary cards and integrated filters (#792)

* Summary cards and integrated filters

* Tidy up

* Format

* Fix tests

* Fix tests

* TSS-1967 dmas-dashboard-v-2-dashboard-charts (#790)

* intial charts

* lint fix

* added css and scss loader for react

* charts loading with gds layout

* rendering all charts appropriately

* fixing lint issues

* using gds color scheme

* lint fix

* Dashboard layout fix (#795)

* now we have the multiple filter search

* filter on dashboard is being more reactive

* lint fix

* reactive filtering working well

* lint fix

* updating syntax for data

* status open works now

* lint fix

* fixing location filters

* lint fix

* remove unsed

* remove unsed

* removed non required logs

* removing print

* bug issues

* fixing lint issues

* fixing admin areas

* fixing admin areas

* PR review fix

* added back the pie chart and added text search param

* search term update

---------

Co-authored-by: Santino Molinaro <[email protected]>
Co-authored-by: santinomolinaro <santino.molinaro@mail>
Co-authored-by: Feroze Rub <[email protected]>

* Refactor/Tidy up (#801)

* Related barrier POC (#802)

* Related barrier POC

* Adding save search button when a search returns no results (#805)

Co-authored-by: santinomolinaro <santino.molinaro@mail>

* Hotfix - remove quotes causing problems for pie chart (#807)

Co-authored-by: santinomolinaro <santino.molinaro@mail>

---------

Co-authored-by: Uka Osim <[email protected]>
Co-authored-by: Elizabeth Pedley <[email protected]>
Co-authored-by: abarolo <[email protected]>
Co-authored-by: abarolo <[email protected]>
Co-authored-by: Santino Molinaro <[email protected]>
Co-authored-by: santinomolinaro <santino.molinaro@mail>
  • Loading branch information
7 people authored Sep 23, 2024
1 parent fbf3dd9 commit 6d3378d
Show file tree
Hide file tree
Showing 18 changed files with 804 additions and 93 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ django-static: ## Compress SCSS and collect static files, clears staticfiles fol

.PHONY: react-watch
react-watch: ## Run react's dev server (tailing).
npm run dev
npm run dev; npm run watch

.PHONY: django-test
django-test: ## Run django tests. (Use path=appname/filename::class::test) to narrow down
Expand Down
16 changes: 15 additions & 1 deletion barriers/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
BarrierSearchCompany,
CompanyDetail,
)
from barriers.views.core import BarrierDetail, Dashboard, Home, WhatIsABarrier
from barriers.views.documents import DownloadDocument
from barriers.views.edit import (
BarrierEditCausedByTradingBloc,
Expand Down Expand Up @@ -177,6 +176,15 @@
EditWTOStatus,
)

from .views.core import (
BarrierDetail,
Dashboard,
GetDashboardSummary,
Home,
WhatIsABarrier,
)
from .views.related_barriers import RelatedBarriers

app_name = "barriers"

urlpatterns = [
Expand Down Expand Up @@ -897,4 +905,10 @@
name="mention_turn_notifications_on",
),
path("home/", Home.as_view(), name="home"),
path(
"barriers/<uuid:barrier_id>/related/",
RelatedBarriers.as_view(),
name="related_barriers_detail",
),
path("dashboard-summary/", GetDashboardSummary.as_view(), name="dashboard_summary"),
]
37 changes: 37 additions & 0 deletions barriers/views/core.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import logging
import urllib.parse

from django.http import JsonResponse
from django.views import View
from django.views.generic import TemplateView

from barriers.forms.search import BarrierSearchForm
Expand Down Expand Up @@ -149,9 +151,16 @@ def get_context_data(self, form, **kwargs):
summary_url = f"dashboard-summary?{search_params}"
summary_stats = client.get(summary_url)

metadata = get_metadata()

context_data.update(
{
"page": "dashboard",
"trading_blocs": metadata.get_trading_bloc_list(),
"admin_areas": self.get_admin_areas_data(
metadata.get_admin_area_list()
),
"countries_with_admin_areas": metadata.get_countries_with_admin_areas_list(),
# "my_barriers_saved_search": my_barriers_saved_search,
# "team_barriers_saved_search": team_barriers_saved_search,
# "draft_barriers": draft_barriers,
Expand All @@ -173,3 +182,31 @@ def get_context_data(self, form, **kwargs):
context_data["pagination"] = self.get_pagination_data(object_list=task_list)

return context_data

def get_admin_areas_data(self, admin_areas_metadata):
# Admin area data works differently to both trading blocs and countries
# We only want admin areas for specific countries and we need them formatted and
# sorted in a particular way so the Javascript and HTML can display them correctly
# in seperate drop down lists.
filtered_areas = {}

for area in admin_areas_metadata:
country = area["country"]["id"]
if filtered_areas.get(f"{country}") is None:
filtered_areas[f"{country}"] = [
{"value": area["id"], "label": area["name"]}
]
else:
filtered_areas[f"{country}"].append(
{"value": area["id"], "label": area["name"]}
)

return filtered_areas


class GetDashboardSummary(View):
def get(self, request, *args, **kwargs):
client = MarketAccessAPIClient(request.session.get("sso_token"))
summary_url = f"dashboard-summary?{request.GET.urlencode()}"
resp = client.get(summary_url)
return JsonResponse(resp)
17 changes: 17 additions & 0 deletions barriers/views/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,20 @@ def strategic_assessment(self):
return self._strategic_assessment
raise Http404("Strategic assessment does not exist")
return self._strategic_assessment


class RelatedBarriersContextMixin:
_client = None

@property
def client(self):
if self._client is None:
self._client = MarketAccessAPIClient(self.request.session.get("sso_token"))
return self._client

def get(self, request, *args, **kwargs):
context = self.get_context_data(**kwargs)
context["related_barriers"] = self.client.barriers.get_similar(
kwargs["barrier_id"]
)
return self.render_to_response(context)
7 changes: 7 additions & 0 deletions barriers/views/related_barriers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from django.views.generic import TemplateView

from .mixins import BarrierMixin, RelatedBarriersContextMixin


class RelatedBarriers(RelatedBarriersContextMixin, BarrierMixin, TemplateView):
template_name = "barriers/related_barriers.html"
10 changes: 10 additions & 0 deletions core/frontend/src/js/react/constants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
export const GDS_TRANSPORT_FONT = '"GDS Transport",Arial,sans-serif';

export const SCREEN_READER_CLASSES = "sr-only govuk-visually-hidden";

export const BARRIER_STATUS = {
0: "Unfinished",
2: "Open",
3: "Resolved: In part",
4: "Resolved: In full",
5: "Dormant",
6: "Archived",
7: "Unknown",
};
Loading

0 comments on commit 6d3378d

Please sign in to comment.