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

feat: Add snippets for all Layer classes [#34] #63

Merged
merged 13 commits into from
Oct 31, 2024

Conversation

BochaberiDaisy
Copy link
Contributor

Fix: #34

@hhkaos, please check the PR.

I have added snippets to all the Layers.
Let me know if any changes are needed 🙂

Copy link
Member

@hhkaos hhkaos left a comment

Choose a reason for hiding this comment

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

Hi @BochaberiDaisy ! Thank you very much for the PR. It is a great start and a lot of work, I really appreciate it. I have started checking and I have just noticed we need to review to meet the conventions. A few example I noticed so far:

  • Prefixes in class constructors should match the Class Capitalization (e.g. graphicsLayer should be GraphicsLayer; addGeoRSSLayershould beGeoRSSLayer`, etc.). Prefixes starting with lowercase are used for class properties objects, common procedures, and enumerations. If you want to suggest a change, please check the issue Snippet "prefix" convetions #10.
  • In the body I have seen inconsistencies with map.add(layerVariable) and not storing the variable. I don't have an strong opinion about having the statement or not, but if we add it, the layer variable should be instantiated within the snippet. If you want to suggest a change, please check the issue Snippet "body" conventions #19.
  • The descriptions are not following the conventions. Some descriptions are a little bit short. You can reuse text from the API reference. And the class initiatilization do not finish with the paths.

I have added some comments just to illustrate some examples.
Thanks again!

"CSVLayer({",
"\turl: \"${1:https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.csv}\",",
"\tcopyright: \"${2:USGS Earthquakes}\",",
"\tpopupTemplate: ${3:template}",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"\tpopupTemplate: ${3:template}",

The popupTemplate is not mandatory and templateis not a snippet. I think it would be better just to remove it, don't you think?.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I totally agree

snippets/javascript.json Outdated Show resolved Hide resolved
"\tcopyright: \"${2:USGS Earthquakes}\",",
"\tpopupTemplate: ${3:template}",
"});",
"map.add(csvLayer);"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"map.add(csvLayer);"

I would suggest keeping it small, especially if csvLayer variable is not even instantiated.

snippets/javascript.json Outdated Show resolved Hide resolved
snippets/javascript.json Outdated Show resolved Hide resolved
"\t}",
"});",
"",
"table.load().then(function() {",
Copy link
Member

Choose a reason for hiding this comment

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

I feel this table load could be omited

"\t\t\ttype: \"${6:string}\"",
"\t\t},",
"\t\t{",
"\t\t\tname: \"${7:place}\",",
Copy link
Member

Choose a reason for hiding this comment

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

Probably we can remove this place field. It is redundant considering we have other "string field" already..

snippets/javascript.json Outdated Show resolved Hide resolved
snippets/javascript.json Outdated Show resolved Hide resolved
snippets/javascript.json Outdated Show resolved Hide resolved
@BochaberiDaisy
Copy link
Contributor Author

BochaberiDaisy commented Oct 30, 2024

Here is the task list for the progress on the changes requested.

Copy link
Member

@hhkaos hhkaos left a comment

Choose a reason for hiding this comment

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

Amazing work @BochaberiDaisy ! 👏 😍

I just added a few minor things. And I would say just make sure to prettify (fix all indentations).

"});",
"let url = URL.createObjectURL(blob);",
"",
new CSVLayer({",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
new CSVLayer({",
"new CSVLayer({",

snippets/javascript.json Outdated Show resolved Hide resolved
snippets/javascript.json Outdated Show resolved Hide resolved
snippets/javascript.json Outdated Show resolved Hide resolved
snippets/javascript.json Outdated Show resolved Hide resolved
snippets/javascript.json Show resolved Hide resolved
snippets/javascript.json Outdated Show resolved Hide resolved
snippets/javascript.json Outdated Show resolved Hide resolved
Copy link
Member

@hhkaos hhkaos left a comment

Choose a reason for hiding this comment

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

Amazing work @BochaberiDaisy ! 👏 😍

I just added a few minor things. And I would say just make sure to prettify (fix all indentations).

@BochaberiDaisy
Copy link
Contributor Author

@hhkaos, I have pushed the requested changes. Please check it out.

Thank you for the feedback!

Copy link
Member

@hhkaos hhkaos left a comment

Choose a reason for hiding this comment

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

Awesome work @BochaberiDaisy , it looks good to me, thank you very much for the hard work!

@hhkaos hhkaos merged commit b97de63 into Esri:master Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add snippets for all Layer classes
2 participants