Drupal

Easy Commerce

drupal.org - Modules - Wed, 01/10/2018 - 11:22
Categories: Drupal

Lullabot: Guidelines for Writing Proper Tickets and Commits

drupal.org aggregator - Wed, 01/10/2018 - 11:12

Have you ever been assigned a ticket with a title like “Some Images Don’t Work,” or opened a monstrous pull request containing a single commit labeled “bug fixes” as your only clue to the changes made? This level of ambiguity is frustrating and can end up costing exorbitant time and money to research. The titles, descriptions, and messages we provide in our workflow should make the jobs of not only our peers easier but also future team members who will inherit the project.

By tweaking our process just a little to document while we work, we can alleviate stress and save time and money on the project. Now don’t go breaking out the wikis and word processors just yet. Much of the critical documentation can be done within the tools you are already using. Writing actionable ticket titles, informative descriptions, and properly referencing related issues and resources can remove mountains of ambiguity and save yourself loads of time filling in the blanks or worse, making assumptions.

Before we get into the details, we need to think about the motivations behind the madness. If we’re going to spend more time writing up descriptions and details, what do we get for it? Anytime you are writing words that another person will read, think about who that person is. It might be a new developer on the team who doesn't have your background knowledge or you in a few months. Maybe a project manager, maybe a stakeholder. Will a machine be able to read and interpret this? All of these factors should influence what you write, regardless of whether it is a description of a bug or a commit message. What information will the next person need so they can eliminate assumptions about the task? Keeping this concept in mind, consider the following benefits:

  • Hours of time spent onboarding a new developer could be reduced.
  • Determining who signed off on a ticket and the process they followed could be done by inspecting a commit’s notes.
  • Changelogs could be automatically generated in different formats for stakeholders and developers.
  • Stop cursing out the previous development team because you don’t understand why they chose a particular method.
  • Or worse, don’t waste your time refactoring that code, then reverting it because you finally did figure out why they chose a particular method.
  • Spend time developing instead of researching a ticket.

As you’re creating a ticket, a commit message, or a pull request; remove the space for assumption. Explain why you did what you did, and, if necessary, how. Let’s start at the beginning with the ticket queue.

Tickets

In this section, we’ll focus on the most granular of issue types: tasks and bugs. Epics and user stories have their own sets of rules and fall outside the scope of this article.

Ticket titles are the first field that someone reads. As I’m looking at my queue, I should know specifically what the ticket is intended to resolve by its title. Consequently, the title should describe the action that the ticket is to fulfill. Here are a couple of examples of good and bad versions of a ticket titles.

Good: “Prevent Nav Bar From Bouncing on Scroll”

Bad: “Navigation is Wonky”

Good: “Implement Home Page Right Rail Promo Block”  

Bad: “Homepage updates”

A helpful hint to consider when writing a title is that it should complete the phrase “This ticket will….” If you’ve done this correctly, the title will always begin with a verb; a call to action. When I see a ticket with the title, “Some Links are Yellow,” I think to myself, “Yes, yes they are. I’m assuming they shouldn’t be since you created a ticket, but what do you want me to do?  Should all links be yellow?  Or none of them?  What color should they be?”  Now, imagine you are a stakeholder reading over a list of completed tickets.  What would you think as you read this title?

Sometimes you’re going to need more than just the title to convey the complete purpose of the ticket, so make sure your ticket descriptions eliminate any room for assumption as well. For bugs, include the steps it takes to reproduce the issue, the environment where you encountered it (OS, browser, device, etc), and what the desired result should be. For simple tasks, reference any comps that describe how it should be implemented and consider user interactions if there are any.  The description field should provide extra information about the goal of the ticket.

If you are having trouble coming up with a specific enough title, consider breaking the ticket down into smaller subtasks, or promoting the ticket to an epic.

Branches

When you start your work, the best practice is to keep your main line of code clear by creating feature branches in your VCS to work on new tickets.  Branches should be filterable, recognizable, and attributable. That is to say, I want to be able to locate a branch quickly by who created it, which issue it’s tied to, and what it’s about.

I prefer a format like this: "owner/issue-id/short-description"

Which could end up looking like: "keyboardcowboy/proj-1234/fix_jumping_nav"

Think about who will see the branch names: myself, other developers, maybe a project manager, the repo gatekeeper if you have one, and machines. Using this format, I can now easily find my branches to create a pull request; I can check if anyone else has a branch for this ticket number; and I can allow project software, such as Jira or GitHub, to reference this branch by searching for the issue number pattern.

undefined Commit Messages

Developers may recognize the commit message prompt as that annoying thing GIT makes you do before you can push your changes. While it may be annoying when you’re working on your own, I guarantee that coworkers and your future self will appreciate the detailed messages you provide.

The reason for the commit message is to describe the changes taking place in that commit. If you find you can’t describe everything in one sentence, try breaking the commit into smaller, atomic commits. This makes it easier to roll back isolated changes if necessary and allows you to describe each change more succinctly. Just as with the issue titles, describe what the commit does. Someone else should be able to read it and understand to a basic degree what this change encompasses.

It’s also extremely helpful to precede the commit message with the issue number. The software can recognize certain patterns in commit messages and generate links from them. Tools like PHPStorm can help automate this for your process by integrating with GIT.

undefined

Here’s an example of well formatted, atomic commits vs a lazy commit.

Good Commits:

[proj-1234] Refactor white space in CSS so it’s readable. [proj-1234] Remove deprecated classes and definitions from CSS and templates. [proj-1234] Increase transition timing on navigation dropdown. The nav seemed to be jumping when the user scrolled while it was open. Increasing the transition timing allows it to expand and contract more smoothly and alleviates the jumpiness. [proj-1234] Fix merge conflict in update hook number.

Bad Commits:

Nav stuff.

Notice how the third good commit has multiple lines. The other commits in this set were ancillary to the issue.  The third commit is where the critical changes were made, so I explained my reasoning and why it fixes the issue. Without that, it looks like I just changed the timing. You might be able to trace the PR back to the original issue and piece things together, but a brief explanation directly in the commit can save time and headaches.

It may seem like overkill, but commits become very handy for the next developer, especially if you are using an IDE that integrates with GIT.

undefined Pull Requests

Pull requests are a common method to contribute to a project without needing commit access to the repository or to the main code branch.  The title of your pull request should follow the same structure as issues, but with one caveat; like tickets, they should describe the action that will occur if the code is merged, but they should also be prefixed with the issue-id of the issue they resolve. In GitHub, for example, the pattern "#ID" creates a link to that issue number. Even if you are not using GitHub as your issue manager, this is still an important reference, especially if you are running on a standard sprint cycle and need to generate reports for what was completed in each release.  Humans can follow this pattern to reference tickets as well as machines.

When you merge a pull request, a commit is made against the base branch and the title of the pull request is used in the commit message. Wouldn't it be nice if you could search through all the commits between release tags, find any that are pull requests and print them with references to their original issue as a change report? It’s surprisingly simple to automate that process if you follow these guidelines. Here’s an example of a good and a bad pull request title.

Good: “[PROJ-1234] Prevent Nav Bar From Bouncing on Scroll”

Bad: “Navbar Issues”

Imagine reading this as a code reviewer or a stakeholder trying to gauge what was accomplished in the last release. Which is going to be more informative? The title text describes exactly what was addressed, and the prefixed issue number provides the information needed to create a link directly to the original issue.

Just as with the original issue, you have an area for a summary in the pull request. I’ve found the most success in separating business discussions and technical review discussions between the issue management software and the pull request tool respectively. If necessary, provide testing instructions in the proper place and that your team follows any documentation guidelines consistently.

Automated Changelogs

Stakeholders often ask us to provide a list of everything that changed in the last release. Long sprint cycles and large teams can make this a challenge, especially if your issues, commits, and pull requests are vague.  The aforementioned guidelines not only make the project more understandable for people, but also for robots. On a project where the stakeholder required that an email is sent out after every release containing all the changes in that release, we used a simple, custom node script to pull all the commits made between tags and format them into a human-readable list using markdown. That list could be copied and pasted into various places, such as email and GitHub releases.  I’ve found a growing number of utility programs that attempt to do this or something similar. In a single command, you have a perfectly formatted, readable changelog, complete with links to the original issues!

Here are a few helpful tools I’ve found so far:

Documentation doesn't have to be boring and time-consuming. You can clarify your project with just a few simple refinements in your existing process and drastically reduce time spent writing up wiki documentation. Writing more detailed and informative tickets, commits, and pull requests will reduce sunk developer time, provide clarity for your stakeholders, ease your onboarding process, and provide better accountability and understanding throughout the project.

Do you have any suggestions or tips for documenting as you work? I’d love to hear about them!

Categories: Drupal

Acquia Developer Center Blog: Working with BLT: An Automation Layer for Testing, Building, and Launching Drupal 8 Applications

drupal.org aggregator - Wed, 01/10/2018 - 09:57

Mike Madison, a Technical Architect in Acquia Professional Services, recently completed a Drupal site build for a major public transit agency in the United States. We spoke with him about his experiences using BLT -- an open-source Acquia product that provides an automation layer for testing, building, and launching Drupal 8 applications -- on this project. Mike said that BLT has been a critical component of the project’s success, and has especially helped in three primary ways: by accelerating project spin-up, improving developer onboarding, and increasing development velocity and delivery consistency.

Tags: acquia drupal planet
Categories: Drupal

Mediacurrent: Do Drupal and Digital Right in 2018: Know Where and How to Start

drupal.org aggregator - Wed, 01/10/2018 - 09:30

When you’re solely focused on Digital Strategy and Drupal as your open source website and web application development framework like Mediacurrent has been for the last 10 years, you’re deeply invested in all of the great challenges and rewards that come with delivering products and solutions that are essentially only limited to your creativity and what you can dream up.

Categories: Drupal

It's Drupal Contrib Wednesday! Post recent contrib module likes/dislikes

Drupal - Open Source Content Platform - Wed, 01/10/2018 - 09:08

Have you tried a new module or theme recently, or do you have a favorite that nobody seems to know about? Tell us what you like or dislike.

(Check out the weekly post schedule in the sidebar)

submitted by /u/AutoModerator
[link] [comments]

Tim Millwood: 10 years of Drupal

drupal.org aggregator - Wed, 01/10/2018 - 08:28
10 years of Drupal

At 12:54pm on January 15th 2008 (based on the created time stamp of "1200401651") I signed up for my Drupal.org account while working for International Baccalaureate. Before my interview there I had never heard of Drupal, but managed to ace the interview and get the job, no idea why I didn't bother signing up for Drupal.org until after I started the job, but hey, that's just how it was. I was jamesfk who introduced me to Drupal there and who I worked with building a bunch of community sites in Drupal 5, then 6. I got the chance to visit Toronto for training with Lullabot where I got to meet great people such as James Walker, Matt Westgate, Jeff Robbins, Addison Berry, and fellow student Doug Vann. I also landed a trip to DrupalCon DC 2009, where I met even more great people and many people I now knew virtually from Drupal.org, IRC, and Twitter.

Later in 2009 I started work with Mark Boulton who was already well into his work with the Drupal.org redesign, and starting work on the new admin theme for Drupal 7. It was awesome to be a part of these projects, as well as many Drupal projects which were coming in on the back of these. While working here I got to attend DrupalCamp UK, DrupalCon Paris, and DrupalCon Copenhagen.

In 2011 I moved to a position at Acquia which saw me become the 4th Acquia employee in the UK, along with great Drupalists like Hernâni, and the first support engineer based in Europe, shortly followed by Aurelien. Later that year I co-load organization of DrupalCon London (or Croydon) with Jeff. At Acquia I moved to help form the customer success team, assisting clients getting their Drupal sites up and running and launch successfully.

After nearly 4 years I left Acquia to join Appnovation who were looking to setup a UK office in Wales (where I live). This also saw me start working with Pfizer on their Drupal 8 projects, initially I was contributing to a lot of the Composer related issues, then moved on to start the Workflow Initiative.

Outside of "work" in this time I have contributed to many contrib modules, become the core maintainer for Statistics, Content Moderation, and Node modules, been a DrupalCon track chair three times, attended 9 DrupalCons, written Drupal articles for Net magazine and appeared on some Drupal podcasts. Outside of Drupal I have moved house twice, got married, and had two kids.

It's been a fun time, here's to the next 10 years!

timmillwood Wed, 10/01/2018 - 13:28 Tags drupal planet drupal-planet drupal Add new comment
Categories: Drupal

Valuebound: My first impression of learning AngularJS

drupal.org aggregator - Wed, 01/10/2018 - 08:07

Before we delve into the ocean of understanding and learning curves of AngularJS, let me share my insights and experience of working on web development. Later, I will tell you why experiences are worth sharing.

For the past four-and-a-half years, I have been working in an IT industry. Started my career as a Drupal developer, working on web building, site building, extending features, development as well as designing. During this journey, I came across many technologies which I was expected to learn from scratch to bind/ integrate one to another. 

Cutting a long story to short! So why did I started learning AngularJS? What is the scope of AngularJS? And why I am sharing my experiences with…

Categories: Drupal

Drupal styling not showing on subdomain

Drupal - Open Source Content Platform - Wed, 01/10/2018 - 06:29

I've created a drupal site at a subdomain like so admin.example.com. The styling appears fine on the homepage but when I navigate to any other page on the subdomain the styling link is broken. All the stylings work fine when I host it at example.com. It's a fresh drupal install with minimal changes.

submitted by /u/_crabz_
[link] [comments]

Select2 Boxes

drupal.org - Modules - Wed, 01/10/2018 - 05:34
Categories: Drupal

Drupal content type page display in views?

Drupal - Open Source Content Platform - Wed, 01/10/2018 - 04:14

Good morning,

I recently started a new job as a developer and i was tasked to setup 2 drupal 8 websites. In my background i have experience with wordpress but never worked with drupal. I got the sites working but i dunno if i had the best approach and i want the community opinion on it.

I had a users page in which i had to show the users groups, laboratories and publications. All of these were imported by a script that i made. Basically instead of using the drupal default content display i created custom views and a consequent block and attached multiple attachments (before or after) in order to build the intended display.

Do you seasoned drupal developers agree with this approach?

Thx

submitted by /u/ratedam
[link] [comments]

How do you deal with pretty similiar content?

Drupal - Open Source Content Platform - Wed, 01/10/2018 - 02:43

Hey everybody! I‘m working with Drupal for several years now but there is one thing I always think about what may be the best way to solve that.

If your project needs pretty similiar content types, for example a static page and a services content type where you just got an extra image field or sth. like that. And you need to be possible to aggregate just the services content via views.

Whats your way to deal with this scenario? Different content types? Just an extra checkbox at the static page type to check if its a service page?? Something I‘m missing here?

Hope to hear from you!

submitted by /u/FNGR2911
[link] [comments]

Need help with setting up a grid to carousel media view

Drupal - Open Source Content Platform - Tue, 01/09/2018 - 17:51

I had posted this under the weekly noobs thread, however I believe this could be valuable for a lot of starting developers if a solution is found. This is an x-post from the drupal answers stack exchange website.

Alright everyone, I'm sure this is a relatively simple thing, but I'm on the verge of tearing my hair out.

What I'm trying to accomplish is setting up images to appear in a grid, that when clicked pulls up a >gallery/carousel, allowing you to scroll through the images there as well.

I've downloaded the slick modules, and correct dependencies. I also have bootstrap correctly set up as well. Honestly if you have an alternative your prefer more, please let me know.

https://www.drupal.org/project/slick -https://github.com/kenwheeler/slick/ -https://github.com/gdsmith/jquery.easing https://www.drupal.org/project/slick_media https://www.drupal.org/project/media_entity_image https://www.drupal.org/project/video_embed_field https://www.drupal.org/project/blazy

Drupal 8

I have no idea what I'm doing, I found one decent example of what I'm trying to do here, https://blueimp.github.io/Gallery/. At the bottom is the lightbox image gallery. That's essentially what I'm trying to mimic.

Terribly sorry for this jumbled up mess. I'll restructure it for better clarity if need be. Thank you in advance.

submitted by /u/Delta365
[link] [comments]

Glassdimly tech Blog: Overriding Drupal 8's .eslintrc.json File in Your Theme With Extends

drupal.org aggregator - Tue, 01/09/2018 - 17:44

I had to do a little RTFMing today, and so I thought I'd post about it.

First of all, this is how you set up PhpStorm to use ES6 eslint settings. You may find it useful

Is the linter getting in your way? The first way to override an eslint setting is inline, disabling it on a one-off basis.

Categories: Drupal

HTTP Cache Control

drupal.org - Modules - Tue, 01/09/2018 - 16:43

HTTP Cache Control module helps fine grain control of Drupal's Cache Control headers.

Categories: Drupal

Glassdimly tech Blog: Drupal ES6 Linting in PhpStorm. Or, PhpStorm Drupal Error: Cannot find module 'eslint-config-airbnb'

drupal.org aggregator - Tue, 01/09/2018 - 15:40

You may not know this, but support for ES6 was added in Drupal 8.4. It wasn't in the release notes, but I was delighted to learn of it.

You have probably landed here because you have gotten Error: Cannot find module 'eslint-config-airbnb'.

Categories: Drupal

DrupalEasy: Mastering Pantheon Workflows (especially these 5 elements) is Awesome

drupal.org aggregator - Tue, 01/09/2018 - 15:28

The following is a guest blog post by Brian Coffelt.

Train to Reign

I’m surprised often by the slow adoption rate of quality development workflows. Time probably plays a big part. One thing I have experienced though, is that in order to get the full value of tools, especially software, you really need to spend the time learning how to use them properly.  

Since I changed my career to become a Drupal developer, I haven’t had a day of regret, nor a day when I did not realize that the key to success is learning more: More about the software, more about techniques, and more about the tools that make Drupal development better. It all feeds into what I learned early on in DrupalEasy’s Career training program, and that I still feel are the best parts of this amazing Drupal-based vocation: to create quality work and become part of the Community.

So when I had the chance to take DrupalEasy’s Mastering Pantheon Workflows course, I jumped at it.  I have been relying on (and loving!) Pantheon’s website management platform since my early career training, and am a huge fan of the great workflow and development tools it offers.  The Workflows class, which is several afternoons a week for six weeks, was time truly well spent. It taught me to really leverage Pantheon’s advantages, and has made me a better developer.

Top 5 Takeaways

The quality of the curriculum and instruction of this course are second to none.  I mean it. DrupalEasy’s insight on what is important provides tremendous value to the time spent in the class and honing your skills. As any professional web developer knows, a great development workflow is worth its weight in gold. This class helped me learn a Docker-based local development workflow that has been directly applied to my everyday routine as well as that of my team.  In addition, learning how Composer manages dependencies was an eye opener for me. It allows my projects to be very lean, efficient, and modular. There are plenty more topics I can point to, but the top 5 area’s we covered that make my day-to-day better and easier are:

  1. Composer integration and dependency management
  2. Drupal 8 configuration management (exporting & importing)
  3. Docksal/Lando local environment structure & setup
  4. Higher level Terminus commands
  5. Development workflows between Pantheon environments and local

The instruction, either direct or via additional screencasts, was always thorough, well planned, and thoughtful. The instructor, Mike Anello (@ultimike), always allows time for questions and troubleshooting. Integrating a class Slack channel was valuable for questions and troubleshooting between classes as well as resource sharing (links, documents, etc.). I still keep in contact with my classmates as often as I can via Slack, email or Drupal events.

Worth the time

It may seem like a few afternoons a week for six weeks will chew up your schedule, but in fact, the opposite is the case. The skills acquired from this class can immediately boost your production, proficiency, and overall value, all of which are well worth the financial and time commitment.

I am definitely a better Drupal developer after having taken the Workflows course. The knowledge, experience, and overall comfort level I achieved has given me valuable skills that I use and share with others every day. The class always stresses the pursuit of best practices to minimize development time and maximize results. I recommend this course to Drupal developers looking to streamline their Pantheon development workflow. It’s certainly well worth the investment.

DrupalEasy’s next Mastering Professional Drupal Development Workflows with Pantheon course starts in February.  Contact DrupalEasy for more information.

Categories: Drupal

Zhilevan Blog: How to write custom Twig filter in Drupal 8

drupal.org aggregator - Tue, 01/09/2018 - 15:24
Twig is one of the  good template engines which is provided by SensioLabs, It’s syntax originates from Jinja and Django template, it’s Secure, Flexible and Fast :  Twig is a modern template engine for PHP • Fast: Twig compiles templates down to plain optimized PHP code. The overhead compared to regular PHP code was reduced to the very minimum.
Categories: Drupal

NASA Astronomy Picture of the Day

drupal.org - Modules - Tue, 01/09/2018 - 13:36

Incorporate NASA's Astronomy Picture of the Day as a block on your website.

Prerequisites:

Dependencies:

Categories: Drupal

Acro Media: Drupal Commerce 2: How to Add Storewide Discounts

drupal.org aggregator - Tue, 01/09/2018 - 13:33

Drupal Commerce 2 comes with an easy to use Promotions sub-module built right in to its core. No add-on modules are needed anymore. The sub-module lets you add a variety of promotions to your eCommerce website, such as discounts off of an entire order, discounts based on the amount spent, product and category specific discounts, and more. The options are extremely versitile, usage statistics are available and coupon codes can easily be added to any promotion that has been created.

In this Acro Media Tech Talk video, we user our Urban Hipster Commerce 2 demo site to quickly show you how to add a 20% storewide discount through the Promotion sub-module UI. 

Its important to note that this video was recorded before the official 2.0 release of Drupal Commerce. The current state of the Promotions sub-module is even more robust than what you see here, and many excellent improvements have been (and continue to be) made.

Urban Hipster Commerce 2 Demo site

This video was created using the Urban Hipster Commerce 2 demo site. We've built this site to show the adaptability of the Drupal 8, Commerce 2 platform. Most of what you see is out-of-the-box functionality combined with expert configuratoin and theming.

More from Acro Media Drupal modules in this demo

Categories: Drupal

Pages