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

Fix/press 6/84 feedback buttons reappear #64

Merged
merged 5 commits into from
Nov 28, 2024

Conversation

ajayadav09
Copy link
Contributor

@ajayadav09 ajayadav09 commented Nov 25, 2024

Proposed changes

  • Feedback Button reappears on reload or reopenoing :

https://jira.newfold.com/projects/PRESS6/issues/PRESS6-84

  • Higher z-index on woocommerce pages:

https://jira.newfold.com/projects/PRESS6/issues/PRESS6-86

Type of Change

Production

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update
  • Refactoring / housekeeping (changes to files not directly related to functionality)

Development

  • Tests
  • Dependency update
  • Environment update / refactoring
  • Documentation Update

Video

Checklist

  • I have read the CONTRIBUTING doc
  • I have viewed my change in a web-browser
  • Linting and tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Further comments

@ajayadav09 ajayadav09 requested a review from kreamweb November 25, 2024 14:17
@ajayadav09 ajayadav09 self-assigned this Nov 25, 2024
@ajayadav09 ajayadav09 added the code review Ready for a code review label Nov 25, 2024
Copy link
Contributor

@kreamweb kreamweb left a comment

Choose a reason for hiding this comment

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

we can move this:

	let savedResults = LocalStorageUtils.getResultInfo();
		savedResults = savedResults.map(result => {
			if (result.postId === postId ) {
				return { ...result, feedbackSubmitted: true };
			}
			return result;
		});
		localStorage.setItem(
			'helpResultContent',
			JSON.stringify( savedResults )
		);

inside utils.js like function of LocalStorageUtils

we can also optimize the map iteration code:

const updatedResults = savedResults.map(result =>
    result.postId === postId ? { ...result, feedbackSubmitted: true } : result
  );

The search Input that is the question block was set to empty in case of API failure so set the searchInput again
Copy link
Contributor

@kreamweb kreamweb left a comment

Choose a reason for hiding this comment

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

Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code review Ready for a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants