Skip to content

Fix/dont rename non cloudinary props #181

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

Merged
5 commits merged into from
Jul 16, 2020
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jul 16, 2020

No description provided.

@ghost ghost requested a review from patrick-tolosa July 16, 2020 11:15
@ghost ghost merged commit 46d96ec into master Jul 16, 2020
if (!isInView && this.shouldLazyLoad(options)) {
attributes.dataSrc = attributes.dataSrc || attributes.src;
attributes['data-src'] = attributes.dataSrc || attributes.src;
Copy link
Contributor

Choose a reason for hiding this comment

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

@maoznir , why do we need this line AND lines 61-64?

const {cloudinaryProps, cloudinaryReactProps, nonCloudinaryProps} = extractCloudinaryProps(options);
options = {...cloudinaryProps, ...cloudinaryReactProps};

//const snakeCaseOptions = toSnakeCaseKeys(options);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove

Comment on lines +82 to +83
let tagAttributes = cld.videoTag(publicId, options).attributes();
tagAttributes = {...Util.withCamelCaseKeys(tagAttributes), ...nonCloudinaryProps};
Copy link
Contributor

Choose a reason for hiding this comment

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

You have the cloudinary+react props in options and the non-cloudinary props in nonCloudinaryProps, why do we need to create a tag for getting those tagAttributes?

@@ -94,6 +94,14 @@ describe('Image', () => {

expect(tag.find('img').prop('src')).to.match(/fn_wasm:blur.wasm\/sample/);
});
it('should not change kebab-case param names', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

it('should not change kebab-case for non-cloudinary param names', () => {

);

expect(tag.find('img').prop('data-testid')).to.equal('testing');
expect(tag.find('img').prop('datatestid')).to.equal(undefined);
Copy link
Contributor

Choose a reason for hiding this comment

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

dataTestid

@@ -190,4 +190,13 @@ describe('Video', () => {
expect(video.prop('plays_inline')).to.equal(undefined);
expect(video.prop('auto_play')).to.equal(undefined);
});
it('should not change kebab-case param names', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

it('should not change kebab-case for non-cloudinary param names', () => {


const video = tag.find('video');
expect(video.prop('data-testid')).to.equal("testing");
expect(video.prop('datatestid')).to.equal(undefined);
Copy link
Contributor

Choose a reason for hiding this comment

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

dataTestid

This pull request was closed.
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.

3 participants