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: Removed Hardcoded Locales and Improved Error Handlings #2125

Merged
merged 10 commits into from
Jul 2, 2024

Conversation

vijayaragavan462
Copy link
Contributor

Purpose

Added some more error handling to the application when some fields are removed from the content model and fixed some bugs reported by users

Approach

When there is fields that are missing which was required to use this application we shown a message to the user what was the exact issue is.
Screenshot 2024-06-17 195917

Testing steps

If the user deletes some of the fields from the content model, it will show the actual issue that has to be fixed.

@vijayaragavan462 vijayaragavan462 requested a review from a team as a code owner June 17, 2024 14:33
@vijayaragavan462 vijayaragavan462 changed the title Deployment fix: Removed Hardcoded Locales and Improved Error Handlings Jun 17, 2024
@vijayaragavan462
Copy link
Contributor Author

Hi team,

This pull request is high-priority. Could you please review it at your earliest convenience? Your timely attention to this pull request would be greatly appreciated.

Thank you!

setMissedField(missedObject);
}

}, [])

Choose a reason for hiding this comment

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

Is it intentional that the dependency array is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, It will happen only once initially.

if (url) {
checkImageURL(url, function(isValid:boolean) {
if (isValid) {
console.log('The image URL is valid.');

Choose a reason for hiding this comment

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

Is this console log still needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not needed anymore

setSelectedImage(sdk.entry.fields.title.getValue())
setImageStatus(true)
} else {
console.log('The image URL is invalid.');

Choose a reason for hiding this comment

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

Same question: Is this console log still needed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not Needed

@@ -349,7 +349,7 @@ body {
}

.linkUploadImage > img {
width: 100%;
/* width: 100%; */

Choose a reason for hiding this comment

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

Should this commented code be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes of course, it can be removed

}

setDefaultLocale(sdk?.locales?.default);
}, [])

Choose a reason for hiding this comment

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

Same question about the dependency array: is it intentionally empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, intentionally.

<img src={fieldMissing} alt="Field Missing" style={{ height: "100%" }} />
</div>
<div>
It seems you are missed some fields in this content type which is required to use this custom application.

Choose a reason for hiding this comment

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

Consider writing this a little more clearly. "It seems you have missed some fields..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure , will do that.

size="small"
contentType="Fields Missing"
title={`Name of fields : ${missedField.map((x: any) => x.name)}`}
description="Verify the field type should be 'Short text field' in Content model"
Copy link

Choose a reason for hiding this comment

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

Similarly you may want to rewrite this to say "... in the Content model"

Copy link

Choose a reason for hiding this comment

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

This file needs to be removed

Copy link

@david-shibley-contentful david-shibley-contentful left a comment

Choose a reason for hiding this comment

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

The blocking change that is required is to remove .contentful/.circleci/config.yml. The rest of the comments are just suggestions to consider

@vijayaragavan462
Copy link
Contributor Author

vijayaragavan462 commented Jul 1, 2024

Hi @david-shibley-contentful ,
All the suggested changes were completed, and we removed the config.yml file from the Circeci folder.

Choose a reason for hiding this comment

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

looks like you removed the wrong file

@david-shibley-contentful

@vijayaragavan462 we need you to remove .contentful/.circleci/config.yml but it looks like you removed .circleci/config.yml instead. Please correct these changes

@vijayaragavan462
Copy link
Contributor Author

vijayaragavan462 commented Jul 2, 2024

@vijayaragavan462 we need you to remove .contentful/.circleci/config.yml but it looks like you removed .circleci/config.yml instead. Please correct these changes

Sure @david-shibley-contentful , I have corrected those changes.

@david-shibley-contentful david-shibley-contentful added this pull request to the merge queue Jul 2, 2024
Merged via the queue into contentful:main with commit 0c10024 Jul 2, 2024
4 checks passed
@github-actions github-actions bot mentioned this pull request Jul 2, 2024
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.

None yet

3 participants