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

Display change requests #114

Merged
merged 2 commits into from
Feb 11, 2025
Merged

Display change requests #114

merged 2 commits into from
Feb 11, 2025

Conversation

albertkol
Copy link
Contributor

@albertkol albertkol commented Jan 18, 2025

Display change requests on the pages that received change requests.

Description

Apply is adding an extra metadata, change_requests.

change_requests are structured as such:

{
    "component.name": [
        "message_1", 
        "message_2"
    ],
    "component_2.name": [
        "message_3",
    ],
}

These will be displayed in the notification banner, above the form.

The catch is, we only need to display the banner on the form pages that the component is placed.

That is why we loop through all components on the page, to find out if the component received feedback:

const component = this.pageDef.components.find(component => component.name === componentName);
if (component) {
    // Add an object to viewModel.changeRequests
    viewModel.changeRequests.push({
        title: component.title,
        messages: messages
    });
}

Since all components can receive feedback, all components considered a question, we should display the banner on all possible Form Runner pages. So perhaps PageControllerBase is the place to add this logic?

Screenshots

Now:
image

Before:
image

ksp37-dluhc
ksp37-dluhc previously approved these changes Jan 21, 2025
Copy link

@ksp37-dluhc ksp37-dluhc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

Copy link
Collaborator

@sfount sfount left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TS looks reasonable to me, a few optional changes to the markup

runner/src/server/views/layout.html Outdated Show resolved Hide resolved
runner/src/server/views/layout.html Outdated Show resolved Hide resolved
ksp37-dluhc
ksp37-dluhc previously approved these changes Jan 29, 2025
Copy link
Collaborator

@nuwan-samarasinghe nuwan-samarasinghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@albertkol @samuelhwilliams @MarcUsher shall we have a discussion about the change ? So safer side I am blocking the merge better if we can have a call if this is an urgent one we can merge.

@albertkol albertkol force-pushed the display-feedback-message branch from f1fbbb6 to e09046f Compare February 5, 2025 16:26
@albertkol
Copy link
Contributor Author

To do:

  • move logic to PageController
  • make a partial from the HTML and use the partial in layout.html
  • write unit test
  • create jira ticket for e2e test

@samuelhwilliams
Copy link
Contributor

samuelhwilliams commented Feb 6, 2025

create jira ticket for e2e test

or you could do it in the same pr because it's just a test for this feature 👀

@albertkol
Copy link
Contributor Author

You offering to help out with it @samuelhwilliams ? 👀

@albertkol albertkol force-pushed the display-feedback-message branch from 517d958 to 5197f50 Compare February 8, 2025 10:58
@albertkol
Copy link
Contributor Author

albertkol commented Feb 10, 2025

I am a bit unsure how to run e2e tests on local.

So for now we will stick to the unit tests only.

Rest of the feedback was addressed.

@nuwan-samarasinghe
Copy link
Collaborator

Changes are ok but e2e fails so we cannot merge these changes can you fix that @albertkol we should have a passing e2e branch before merge

image

@albertkol albertkol force-pushed the display-feedback-message branch 3 times, most recently from 0568db4 to c56d1b9 Compare February 10, 2025 21:58
Copy link
Collaborator

@nuwan-samarasinghe nuwan-samarasinghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@nuwan-samarasinghe nuwan-samarasinghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@albertkol albertkol force-pushed the display-feedback-message branch from 1263dca to 283076b Compare February 11, 2025 11:35
@albertkol albertkol force-pushed the display-feedback-message branch from 283076b to ba6fdde Compare February 11, 2025 11:43
@albertkol albertkol merged commit ccd9886 into main Feb 11, 2025
15 checks passed
@albertkol albertkol deleted the display-feedback-message branch February 11, 2025 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants