Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge: development into main #551

Merged
merged 118 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 117 commits
Commits
Show all changes
118 commits
Select commit Hold shift + click to select a range
7f31aae
draft: docs: Caching documentation (#460)
jimwashbrook Jan 24, 2024
5ad8a11
fix: handle textBodyDB entity being empty - possible fix
Jan 25, 2024
4fb5d07
Linted Code in Dfe.PlanTech.Domain/
github-actions[bot] Jan 25, 2024
b2f5b5b
ignore mapping of rich text id
Jan 26, 2024
0f5690e
chore: merge
Jan 26, 2024
aaad56f
fix: Check answers page title (#487)
jimwashbrook Jan 26, 2024
077eb08
Merge pull request #488 from DFE-Digital/bug/warning-component
uahussain12 Jan 26, 2024
585a50b
feat: Add caching docs (#486)
jimwashbrook Jan 26, 2024
068a23d
feat: Support preview mode in Content db (#489)
jimwashbrook Jan 26, 2024
ef6de0a
fix: Azure Function Tests (#490)
jimwashbrook Jan 26, 2024
34cbc09
fix: service config issue
Zac-Digital Jan 26, 2024
58cdc68
refactor: use guard statement for cleaner code
Zac-Digital Jan 26, 2024
7f0def4
refactor: create only adds contentcomponent
Zac-Digital Jan 26, 2024
761513c
refactor: revert changes and skip create event
Zac-Digital Jan 29, 2024
31a1564
merge from development
Iain-Stanger Jan 29, 2024
7349eea
refactor: only save or auto_save when a new entity has all its requir…
Zac-Digital Jan 29, 2024
48b4532
test: update tests
Zac-Digital Jan 29, 2024
a9da3a0
Merge pull request #491 from DFE-Digital/fix/193009
Zac-Digital Jan 29, 2024
a18ce89
tests: Initial programatic E2E tests work (#493)
jimwashbrook Feb 5, 2024
9edcad1
tests: Add category and sections to programatic tests (#494)
jimwashbrook Feb 5, 2024
c4ec901
W.I.P
Zac-Digital Feb 5, 2024
dee960a
tests: Refactor existing work on dynamic E2E tests (#496)
jimwashbrook Feb 6, 2024
8eef770
W.I.P
Zac-Digital Feb 6, 2024
edec867
fix: checkout repo
Zac-Digital Feb 6, 2024
5e740b1
refactor: remove superseded workflow
Zac-Digital Feb 7, 2024
2baeebc
refactor: add relevant triggers to paths and run some in parallel
Zac-Digital Feb 7, 2024
d26e8f0
refactor: concurrency groups, pass artifact name as variable
Zac-Digital Feb 7, 2024
10bb32b
refactor: concurrency group naming
Zac-Digital Feb 7, 2024
68e9c8d
chore: remove debug code
Zac-Digital Feb 7, 2024
edf8366
Merge pull request #497 from DFE-Digital/refactor/194327
Zac-Digital Feb 7, 2024
baada83
tests: Navigate through every question in a sub-topic using Contentfu…
jimwashbrook Feb 7, 2024
1bd6d12
tests: E2E tests for every possible recommendation page (#500)
jimwashbrook Feb 7, 2024
7756710
refactor: delete unused workflow
Zac-Digital Feb 7, 2024
f93c9e1
chore: update various versions in workflows
Zac-Digital Feb 8, 2024
c56497e
chore: update various versions in custom actions
Zac-Digital Feb 8, 2024
38b729e
tests: Last E2E component tests (#501)
jimwashbrook Feb 8, 2024
cc412c2
terraform-docs: automated action
github-actions[bot] Feb 8, 2024
8e2c1f5
refactor: see what happens if v2 is changed to v3 for terraform setup
Zac-Digital Feb 8, 2024
e692f29
Merge branch 'chore/194927' of github.com:DFE-Digital/plan-technology…
Zac-Digital Feb 8, 2024
cb17acf
refactor: see what happens if v2 is changed to v3 for terraform setup
Zac-Digital Feb 8, 2024
b417e68
chore: remove todo
Zac-Digital Feb 8, 2024
7e7c0df
tests: Split up unit tests by page/section (#502)
jimwashbrook Feb 8, 2024
4140332
Qa view spike (#504)
uahussain12 Feb 8, 2024
6dce184
Merge pull request #503 from DFE-Digital/chore/194927
Zac-Digital Feb 8, 2024
e32d7a0
wip cleanup (#498)
Iain-Stanger Feb 8, 2024
8fb6d04
chore: upgrade missed version
Zac-Digital Feb 8, 2024
eefa590
Merge pull request #505 from DFE-Digital/chore/upgrade-missed-version
Zac-Digital Feb 8, 2024
960e639
refactor: merge ShouldDropMessage and ShouldIgnoreMessage
Zac-Digital Feb 9, 2024
fc8657b
Format visualisations (#506)
uahussain12 Feb 9, 2024
b264fe0
refactor: Log which required properties are null in such an event
Zac-Digital Feb 9, 2024
d6c8e32
chore: remove block comment
Zac-Digital Feb 9, 2024
a12444c
fix: RichText retrieval bug (#507)
jimwashbrook Feb 9, 2024
180669b
refactor: Check validity of component always
Zac-Digital Feb 9, 2024
f01f493
refactor: remove unused parameter
Zac-Digital Feb 9, 2024
2c78453
refactor: remove unused parameter
Zac-Digital Feb 9, 2024
d60ad07
refactor: update dotnet-coverage to latest
Zac-Digital Feb 12, 2024
321c0fb
refactor: rollback dotnet-coverage to last known good version
Zac-Digital Feb 12, 2024
088fb4a
fix: rollback dotnet-coverage for sonarcloud
Zac-Digital Feb 12, 2024
c047d10
Merge pull request #513 from DFE-Digital/fix/sonarcloud-coverage
Zac-Digital Feb 12, 2024
c4a9a8c
Merge branch 'development' of github.com:DFE-Digital/plan-technology-…
Zac-Digital Feb 12, 2024
5c61937
test: update tests
Zac-Digital Feb 12, 2024
a4f0cd4
Feat/cleanup (#512)
Iain-Stanger Feb 13, 2024
858d341
refactor: change valid component logic
Zac-Digital Feb 13, 2024
97c1f92
chore: move node unit tests package files to actual folder (#515)
jimwashbrook Feb 13, 2024
878a010
Merge pull request #508 from DFE-Digital/refactor/195442
Zac-Digital Feb 13, 2024
c855249
chore: Update all nuget packages. (#510)
jimwashbrook Feb 13, 2024
51b30b5
feat: Convert RichTextContents function into a view (#509)
jimwashbrook Feb 13, 2024
c8e26f0
Feat/cleanup (#517)
Iain-Stanger Feb 13, 2024
2d65ac4
refactor: W.I.P add semantic versioning
Zac-Digital Feb 16, 2024
3e85834
refactor: global install semantic-release
Zac-Digital Feb 16, 2024
c7e1c3d
refactor: install dependencies
Zac-Digital Feb 16, 2024
4e98fe8
refactor: install dependencies with versions
Zac-Digital Feb 16, 2024
4281b27
feat: use semantic versioning
Zac-Digital Feb 16, 2024
adeaa13
refactor: run it on push test
Zac-Digital Feb 16, 2024
6542977
refactor: tag change
Zac-Digital Feb 16, 2024
7557945
refactor: integrate into workflow
Zac-Digital Feb 16, 2024
440467e
Merge pull request #520 from DFE-Digital/refactor/semantic-releases
Zac-Digital Feb 19, 2024
83e44fe
refactor: create contentful entity classes
Zac-Digital Feb 19, 2024
db3113d
Merge branch 'development' of github.com:DFE-Digital/plan-technology-…
Zac-Digital Feb 19, 2024
3c0dd43
Feat/cleanup (#518)
Iain-Stanger Feb 20, 2024
9183c9f
refactor: change string to Title component
Zac-Digital Feb 20, 2024
f62c455
fix(sql): :bug: Fixes a bug where Warning components weren't display …
jimwashbrook Feb 20, 2024
f80eabb
refactor: change Maturity enum to string
Zac-Digital Feb 20, 2024
87e2fcb
refactor: rename variables to match cms
Zac-Digital Feb 20, 2024
22c5034
refactor: add Title field to RecommendationChunk
Zac-Digital Feb 20, 2024
ede074b
refactor: change title component to header component
Zac-Digital Feb 20, 2024
b91a315
feat: Update Gov UK Packages (#523)
jimwashbrook Feb 20, 2024
a01f7a3
feat: add step-by-step navigation from govuk prototype (#525)
jimwashbrook Feb 20, 2024
46a6c2c
refactor: update interfaces
Zac-Digital Feb 20, 2024
f1317a0
test: add temp dummy tests
Zac-Digital Feb 20, 2024
1380605
refactor: use generic type in interface
Zac-Digital Feb 20, 2024
12918e1
fix: :green_heart: Semver release (#527)
jimwashbrook Feb 20, 2024
6e49ee2
:zap:: Update Category + Recommendation View Components (#529)
jimwashbrook Feb 21, 2024
a59d07e
refactor: debug test comment removal
Zac-Digital Feb 21, 2024
9873004
refactor: debug test comment removal
Zac-Digital Feb 21, 2024
1f7f7b6
refactor: debug test comment removal
Zac-Digital Feb 21, 2024
c6480b2
refactor: change test tag name
Zac-Digital Feb 21, 2024
1ab1088
refactor: add debug paths
Zac-Digital Feb 21, 2024
1db96a0
refactor: remove debug code
Zac-Digital Feb 21, 2024
dbc4711
Merge pull request #530 from DFE-Digital/refactor/semver-comment-disable
Zac-Digital Feb 21, 2024
3c36893
refactor: change Title to string, link SubtopicRecommendation to subt…
Zac-Digital Feb 21, 2024
f64fa1e
Merge pull request #522 from DFE-Digital/refactor/contentful-models
Zac-Digital Feb 21, 2024
ac1c3af
Feat/accordion view step by step (#528)
uahussain12 Feb 21, 2024
ae8c814
:hammer: Workflow + SQL script to clear user data from DB (#531)
jimwashbrook Feb 21, 2024
d4cbfa8
fix: remove step by step navigation js from layout (#533)
jimwashbrook Feb 22, 2024
d1c6fb1
chore: Add GovUK body class script in (#534)
jimwashbrook Feb 22, 2024
a15213a
Feat/CodeCleanup (#524)
Iain-Stanger Feb 22, 2024
7000cb0
fix: Fix SQL script to clear DB (#536)
jimwashbrook Feb 22, 2024
74875c9
docs(workflows): :memo: Add workflow changes to docs (#537)
jimwashbrook Feb 22, 2024
f693974
chore: Packages Update (#540)
Iain-Stanger Feb 26, 2024
b525923
fix: remove text match check (#542)
jimwashbrook Feb 28, 2024
44fdf86
fix(197631): :bug: Fix content ordering on page (#541)
jimwashbrook Feb 29, 2024
ebe0533
Trigger tf doc update (#544)
uahussain12 Feb 29, 2024
eec698e
fix: :lipstick: css stylings (#546)
jimwashbrook Feb 29, 2024
27a55fa
fix: Remove outdated copying of a specific file (#547)
jimwashbrook Feb 29, 2024
e32cf59
feat: Add order column to PageContents (#549)
jimwashbrook Feb 29, 2024
1b9d8d2
fix: no longer duplicate content (#550)
jimwashbrook Feb 29, 2024
0b862a2
conflict resolution
Iain-Stanger Feb 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/build-dotnet-app/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ runs:

steps:
- name: Setup .NET Core SDK ${{ inputs.dotnet_version }}
uses: actions/setup-dotnet@v3
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ inputs.dotnet_version }}
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/post-terraform-results/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ runs:

steps:
- name: Update PR with Terraform results
uses: actions/github-script@v6
uses: actions/github-script@v7
if: github.event_name == 'pull_request'
env:
PLAN: "terraform\n${{ inputs.plan_stdout }}"
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/run-e2e-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ runs:
config: baseUrl=${{ inputs.url }}

- name: Store screenshots on test failure
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: ./tests/Dfe.PlanTech.Web.E2ETests/cypress/screenshots

- name: Store videos
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-videos
Expand Down
11 changes: 11 additions & 0 deletions .github/scripts/clear-user-data-from-db.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
BEGIN TRANSACTION;

DELETE FROM [dbo].[response];
DELETE FROM [dbo].[submission];
DELETE FROM [dbo].[question];
DELETE FROM [dbo].[answer];
DELETE FROM [dbo].[signin];
DELETE FROM [dbo].[user];
DELETE FROM [dbo].[establishment];

COMMIT;
65 changes: 65 additions & 0 deletions .github/scripts/qa-data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import os
import pyodbc
import json
import struct
from azure import identity

def query_to_json(connection_string, sql_query):

if os.getenv("ENV") != "dev":
credential = identity.DefaultAzureCredential(exclude_interactive_browser_credential=True)
token_bytes = credential.get_token("https://database.windows.net/.default").token.encode("UTF-16-LE")
token_struct = struct.pack(f'<I{len(token_bytes)}s', len(token_bytes), token_bytes)
SQL_COPT_SS_ACCESS_TOKEN = 1256
connection = pyodbc.connect(connection_string, attrs_before={SQL_COPT_SS_ACCESS_TOKEN: token_struct})
else:
connection = pyodbc.connect(connection_string)
cursor = connection.cursor()
cursor.execute(sql_query)
result = cursor.fetchall()
connection.close()
return cursor, result

def main():

connection_string = os.getenv("SQL_CONNECTION_STRING")

data_folder = 'data'
if not os.path.exists(data_folder):
os.makedirs(data_folder)

section_query = "SELECT id, name FROM [Contentful].[Sections]"
cursor, sections = query_to_json(connection_string, section_query)

for section in sections:
section_id, section_name = section

sql_query = f'''
SELECT
Q.Id AS QuestionId,
Q.Text AS QuestionText,
O.[Order] AS QuestionOrder,
A.Text,
A.NextQuestionId
FROM
[Contentful].[Questions] Q
JOIN
[Contentful].[ContentComponents] O ON Q.Id = O.Id
LEFT JOIN
[Contentful].[Answers] A ON Q.Id = A.ParentQuestionId
WHERE
Q.SectionId = '{section_id}'
ORDER BY
O.[Order] ASC;
'''

cursor, result = query_to_json(connection_string, sql_query)

json_result = json.dumps([dict(zip([column[0] for column in cursor.description], row)) for row in result], indent=2)

output_file = os.path.join(data_folder, f'{section_name}.json')
with open(output_file, 'w') as file:
file.write(json_result)

if __name__ == "__main__":
main()
67 changes: 67 additions & 0 deletions .github/scripts/qa-visualisations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import os
import json
from graphviz import Digraph

def split_text(text, max_length):
if len(text) <= max_length:
return [text]
else:
split_index = text.rfind(' ', 0, max_length)
if split_index == -1:
return [text[:max_length]] + split_text(text[max_length:], max_length)
else:
return [text[:split_index]] + split_text(text[split_index+1:], max_length)

def create_questionnaire_flowchart(question_data):
tree = Digraph(format='png')

end_nodes = set()

for item in question_data:
current_question = item["QuestionId"]
next_question_id = item["NextQuestionId"]
answer_text = item["Text"]

question_lines = split_text(item["QuestionText"], 20)
question_text = "\n".join(question_lines)

tree.node(current_question, question_text, shape='box', style='filled', fillcolor='grey:white', width='2', gradient='200')

answer_lines = split_text(answer_text, 20)
answer_text = "\n".join(answer_lines)

if next_question_id:
tree.node(next_question_id, "Missing Content", shape='diamond', style='filled', fillcolor='red:white', width='2')
tree.edge(current_question, next_question_id, label=answer_text, color='black')
else:
end_nodes.add(current_question)

for end_node in end_nodes:
tree.node("end", "Check Answers", shape='box', style='filled', fillcolor='lightblue:white', width='2', gradient='300')
tree.edge(end_node, "end", label="No More Questions", color='black')

return tree

def process_data_files():
data_folder = 'data'
png_folder = 'visualisations'
if not os.path.exists(png_folder):
os.makedirs(png_folder)

for filename in os.listdir(data_folder):
if filename.endswith('.json'):
file_path = os.path.join(data_folder, filename)
with open(file_path, 'r') as file:
json_data = json.load(file)

flowchart = create_questionnaire_flowchart(json_data)
output_file = os.path.join(png_folder, f'{os.path.splitext(filename)[0]}')
flowchart.graph_attr['rankdir'] = 'LR'
flowchart.graph_attr['beautify'] = 'true'
flowchart.edge_attr['arrowhead'] = 'vee'
flowchart.edge_attr['arrowsize'] = '0.5'

flowchart.render(output_file, cleanup=True)

if __name__ == '__main__':
process_data_files()
58 changes: 0 additions & 58 deletions .github/workflows/build-and-deploy-azure-function.yml

This file was deleted.

Loading
Loading