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

Change Regular functions to arrow function #1239

Closed
5 tasks
Achele opened this issue Oct 26, 2022 · 6 comments · Fixed by #1257
Closed
5 tasks

Change Regular functions to arrow function #1239

Achele opened this issue Oct 26, 2022 · 6 comments · Fixed by #1257

Comments

@Achele
Copy link
Contributor

Achele commented Oct 26, 2022

💡Format this Issue Into a First Timers Issue

This has been marked as a good candidate for becoming a first-timers-only issue like these, meaning that it's simple, self-contained, and with some extra formatting✍️, could be a great entry point for a new contributor. If you're familiar enough with this code, please consider reformatting it as a first-timers-only issue, and then ping @publiclab/reviewers to get it labeled🏷. Or, if this is not your first time, try to solve it yourself🧑‍💻!


Hi, this is a first-timers-only issue. This means we've worked to make it more legible to folks who either haven't contributed to our codebase before, or even folks who haven't contributed to open source before.

If that's you, we're interested in helping you take the first step and can answer questions and help you out as you do. Note that we're especially interested in contributions from people from underrepresented groups in free and open-source software!

We know that the process of creating a pull request is one of the biggest barriers for new contributors. This issue is for you 💝

If you have contributed before, consider leaving this one for someone new, and looking through our general help wanted issues. Thanks!

🤔 What you will need to know.

Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.

📋 Step by Step

  • 🙋 Claim this issue: Claim the issue by commenting. If someone else has claimed it, ask if they've opened a pull request already and if they're stuck -- maybe you can help them solve a problem or move it along!
💡 Learn how to claim 🙋

Claiming an issue

Unless the issue is marked as reserved for someone, you can just say "I'd like to try this!" and then you've claimed it - no need to wait for someone to assign it to you. Just be sure you link your pull request (PR) to this issue so we can see where your solution is.

And open one early if possible - even before you've completed it with additional commits - and others can help you figure out any issues you may face.

  • 📝 Update the file DistortableImageEditSpec.js in the Leaflet.DistortableImage repository (press the little pen Icon) and edit the line as shown below.

See this page for some help in taking your first steps!

Below is a "diff" showing in red (and a -) which lines to remove, and in green (and a +) which lines to add:

-1  describe('L.DistortableImage.Edit', function() {
+1  describe('L.DistortableImage.Edit', () => {

-4  beforeEach(function(done) {
+4  beforeEach((done) => {

-17  L.DomEvent.on(ov.getElement(), 'load', function() { done(); });
+17  L.DomEvent.on(ov.getElement(), 'load', () => { done(); });

-19  afterEach(function() {
+19  afterEach(() => {

-24. it('Should be initialized along with each instance of L.DistortableImageOverlay.', function() {
+24  it('Should be initialized along with each instance of L.DistortableImageOverlay.', () => {

-28. it('Should keep handles on the map in sync with the corners of the image.', function() {
+28  it('Should keep handles on the map in sync with the corners of the image.', () => {

-38  edit._distortHandles.eachLayer(function(handle) {
+38. edit._distortHandles.eachLayer((handle) =>  {

-45. edit._freeRotateHandles.eachLayer(function(handle) {
+45  edit._freeRotateHandles.eachLayer((handle) => {

-50  describe('#replaceTool', function() {
+50. describe('#replaceTool', () => {

-51. describe('#replaceTool', function() {
+51  describe('#replaceTool', () => {

-65  it('It should do nothing if the first parameter does not exist', function() {
+65  it('It should do nothing if the first parameter does not exist', () => {

-78. it('It should do nothing if the second parameter already exists', function() {
+78. it('It should do nothing if the second parameter already exists', () => {

-89  it('Should add the new action to the image\'s `modes` if it is also a mode', function(done) {
+89  it('Should add the new action to the image\'s `modes` if it is also a mode', (done) =>  {

-97  L.DomEvent.on(ov3.getElement(), 'load', function() {
+97  L.DomEvent.on(ov3.getElement(), 'load', () => {

-112  describe('#_deselect', function() {
+112  describe('#_deselect', () => {

-113. it('It should hide an unlocked image\'s handles by updating their opacity', function() {
+113  it('It should hide an unlocked image\'s handles by updating their opacity', () => {

-121.  edit._handles.distort.eachLayer(function(handle) {
+121.  edit._handles.distort.eachLayer((handle) => {

-129  it('But it should not hide a locked image\'s handles', function() {
+129  it('But it should not hide a locked image\'s handles', () => {

-139  edit._handles.lock.eachLayer(function(handle) {
+139  edit._handles.lock.eachLayer((handle) => {

-147  it('Should remove an image\'s individual toolbar instance regardless of lock handles', function() {
+147  it('Should remove an image\'s individual toolbar instance regardless of lock handles', () => {

-162  setTimeout(function() {
+162  setTimeout(() => {

-168  describe('#nextMode', function() {
+168  describe('#nextMode', () => {

-169. it('Should update image\'s mode to the next in its modes array', function() {
+169  it('Should update image\'s mode to the next in its modes array', () => {

-180  it('Will also select the image when triggerd by dblclick', function() {
+180  it('Will also select the image when triggerd by dblclick', () => {

-185. setTimeout(function() {
+185  setTimeout(() => {

-190  it('It prevents dblclick events from propagating to the map', function() {
+190. it('It prevents dblclick events from propagating to the map', () => {

-199 setTimeout(function() {
+199. setTimeout(() => {

-208   it('Should call #setMode', function() {
+208   it('Should call #setMode', () => {

-215. it('Will still update the mode of an initialized image with suppressToolbar: true', function(done) {
+215  it('Will still update the mode of an initialized image with suppressToolbar: true', (done) => {

-220  L.DomEvent.on(ov2.getElement(), 'load', function() {
+220. L.DomEvent.on(ov2.getElement(), 'load', () => {

-236. describe('#setMode', function() {
+236. describe('#setMode', () => {

-237  it('Will return undefined if the passed value is not in the image\'s modes array', function() {
+237  it('Will return undefined if the passed value is not in the image\'s modes array', () => {

-243.  it('Will return undefined if image editing is not enabled', function() {
+243.  it('Will return undefined if image editing is not enabled', () => {

-249   it('Will return undefined if the passed mode is already the image\'s mode', function() {
+249. it('Will return undefined if the passed mode is already the image\'s mode', () => {

-256. it('Will still update the mode of an initialized image with suppressToolbar: true', function(done) {
+256. it('Will still update the mode of an initialized image with suppressToolbar: true', (done) => {

-261. L.DomEvent.on(ov2.getElement(), 'load', function() {
+261. L.DomEvent.on(ov2.getElement(), 'load', () => {
  • 💾 Commit your changes

  • 🔀 Start a Pull Request. There are two ways how you can start a pull request:

  1. If you are familiar with the terminal or would like to learn it, here is a great tutorial on how to send a pull request using the terminal.

  2. You can also edit files directly in your browser and open a pull request from there.

  • 🏁 Done Ask in comments for a review :)

🤔❓ Questions?

Leave a comment below!

Is someone else already working on this?

We encourage you to link to this issue by mentioning the issue # in your pull request, so we can see if someone's already started on it. If someone seem stuck, offer them some help! Otherwise, take a look at some other issues you can help with. Thanks!

(This issue was created by First-Timers-Bot.)

@Achele
Copy link
Contributor Author

Achele commented Oct 26, 2022

@jywarren @TildaDares please can you review this issue I created for first timers who are still looking for an issue to resolve.

@wangui-wamutitu
Copy link

@jywarren and @TildaDares if this issue qualifies as a first-timers issue after review I would love to claim it

@abba-danmusa
Copy link

I'll handle this issue

@TildaDares
Copy link
Member

Hi @wangui-wamutitu, please go ahead. Thank you!

@boluwatifee
Copy link
Contributor

@TildaDares this hasn't been worked on, can i go ahead?

@boluwatifee
Copy link
Contributor

@Achele please review and merge my pull request

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

Successfully merging a pull request may close this issue.

5 participants