-
Notifications
You must be signed in to change notification settings - Fork 25
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
fix: Removed Hardcoded Locales and Improved Error Handlings #2125
Conversation
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); | ||
} | ||
|
||
}, []) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.'); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.'); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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%; */ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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); | ||
}, []) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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..."
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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"
.contentful/.circleci/config.yml
Outdated
There was a problem hiding this comment.
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
There was a problem hiding this 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
Hi @david-shibley-contentful , |
.circleci/config.yml
Outdated
There was a problem hiding this comment.
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
@vijayaragavan462 we need you to remove |
Sure @david-shibley-contentful , I have corrected those changes. |
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](https://private-user-images.githubusercontent.com/131851314/340342363-a7cd30aa-bca6-4acc-b317-675d9e4b7fb8.jpg?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk5NDk2MDEsIm5iZiI6MTcxOTk0OTMwMSwicGF0aCI6Ii8xMzE4NTEzMTQvMzQwMzQyMzYzLWE3Y2QzMGFhLWJjYTYtNGFjYy1iMzE3LTY3NWQ5ZTRiN2ZiOC5qcGc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzAyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwMlQxOTQxNDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1jZTRkYjcwNDNkNmNiOGFjNmY2NDk4MmZiZGEwZmMzNDVmNzU0M2Q0YmE4NTk4MDQyZTU0MGE3YTgzMDFlZDRlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.cN6okyZpbwJpFJYKp1Txs0cjndd0yBwcmQBIZpq-oD0)
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.