• Bootstrap and custom CSS Classes

    I would like to suggest that when writing html classes, we should start with bootstrap class names and then write our own.

    Wrong

    <div class="d-flex bf-card flex-column bf-component mx-5 pl-5">

    👌 Good

    <div class="d-flex flex-column mx-5 pl-5 bf-card bf-component">


    JS Widgets events

    I would also like to suggest to keep events (on a JS widget) as much separated by selector as possible. This is not merging selectors on one event, prefer creating a new line for that element. Or even better, to find a class that can synthesize on one event

    Wrong

    ...
    events: {
      'focusin #form-checkout__cardholderName, focusin #form-checkout__cardExpirationMonth, focusin #form-checkout__cardExpirationYear ': 'handleCleanError',
    }
    

    👌 Good

    ...
    events: {
       'focusin #form-checkout__cardholderName': 'handleCleanError',
       'focusin #form-checkout__cardExpirationMonth': 'handleCleanError',
       'focusin #form-checkout__cardExpirationYear': 'handleCleanError',
       'focusin #form-checkout__securityCode': 'handleCleanError',
       'focusin #form-checkout__identificationNumber': 'handleCleanError',
    }
    

    Better: creating a class that can propagate the event to all the elements with it

    ...
    events: {
       'focusin .form-checkout-validate': 'handleCleanError',
    }
    
  • ## Git
    
    **Please always use lowercase and use middle dash for separate connecting words on banch names.**

    NOTE: In the part of Merge Request the link of documentation is broken

    
    ### Merge Request
    
    When your changes will be ready to be tested by QA you need to create a Merge request, please use this [merge request template](/benandfrank/.gitlab/merge_request_templates/merge_request.md) to create it.

    Questions on Access a Dictionary Element part.

    I can see is for a dictionary where we are not secure about it has a specify key, Is OK if we use?

    value = d['foo']

    when We know exactly the structure of one directory

  • Thanks for notice the broken link and your suggestion in git section @Fabfm4

    About your question with dictionaries, I just see something that could be a problem, If the dict changes in structure then de use of value = d['foo'] will return an Exception and using the get() function we always have a value

  • Nice!, I get it, Thanks @leonardoAlonso :)

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment