Git Product home page Git Product logo

ember-shepherd's Introduction

ember-shepherd

Ship Shape

ember-shepherd is built and maintained by Ship Shape. Contact us for Ember.js consulting, development, and training for your project.

npm version Download count all time npm Ember Observer Score CI Build Code Climate Test Coverage

This is an Ember wrapper for the Shepherd, site tour, library. It provides additional functionality, on top of Shepherd, as well.

Compatibility

  • Ember.js v4.8 or above
  • Ember CLI v4.8 or above
  • Node.js v18 or above

Installation

ember install ember-shepherd

Documentation

View Docs

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

ember-shepherd's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ember-shepherd's Issues

Using the Shepherd events

Not sure if this is already possible or not so excuse my naivety.

Is it possible to observe the events emmitted by Shepherd? For example, I need to trigger a flash message after the walkthrough ends. So I'd hopefully be able to do something along the lines of:

triggerFlashMessage: Ember.on('tour.cancel', { // Tour has been cancelled }

Many thanks!

Default highlighting/arrow ui

Would love a non trivial implementation of highlight that basically positions a div over the target element so that it doesn't affect ui. On a related note, a default arrow that points to the element would really help as well. Either one of these or both of them would really improve the user experience.

Classes in 'defaults' config not being appended to dom

When I set classes in my 'defaults' config, they get added to the object, but do not translate to the dom. Am I missing something?

As you can see, I added modal and myclass to the defaults classes, and they do not show up in the dom.

screenshot 2016-01-15 11 11 04

screenshot 2016-01-15 11 13 52

Here is my defaults object:

this.get('tour').set('defaults', {
  classes: 'myclass modal shepherd-element shepherd-open shepherd-theme-arrows',
  modal: true,
  scrollTo: false,
  showCancelLink: true,
  copyStyles: false,
  highlightClass: 'highlight'
});

Ability to pass ember templates to shepherd's text field

  • It's hard to manually change class names for deeply nested components. (all buttons for example have the shepherd-button class.)
  • One way to make it easier would be to have some some style addons (i.e. ember-shepherd-bootstrap)

Is there some crucial information I missed in the docs that would make this possible?


Update: 9/9/16

Honestly, this issue changed a lot over its 28 day life.

What it became is the realization that due to how shepherd was designed, we can not currently use htmlbars in a step's text property.


attachTo shouldn't be required

Per the Shepherd docs, "if you don't specific an attachTo the element will appear in the middle of the screen." I get Uncaught TypeError: Cannot read property 'element' of undefined when attachTo isn't defined.

Demo seems to be broken on Chrome

image
I see the following when I visit http://ember-shepherd.shipshape.io/. The tour popup does not fully appear, and appears frozen (in a partial animation?). Buttons are not clickable.

It is reproducible in Chrome Version 66.0.3359.139 (Official Build) (64-bit), but it is not reproducible in Safari Version 11.1 (11605.1.33.1.4). I am using a Mac. There is no error in the console. Warnings were:

vendor-9eb434e783f88d936264afe89fceff37.js:3908 [Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
on @ vendor-9eb434e783f88d936264afe89fceff37.js:3908
onTourStart @ vendor-9eb434e783f88d936264afe89fceff37.js:4137
e._join @ vendor-9eb434e783f88d936264afe89fceff37.js:1454
e.join @ vendor-9eb434e783f88d936264afe89fceff37.js:1423
ot.join @ vendor-9eb434e783f88d936264afe89fceff37.js:2433
(anonymous) @ vendor-9eb434e783f88d936264afe89fceff37.js:2437
value @ vendor-9eb434e783f88d936264afe89fceff37.js:3780
value @ vendor-9eb434e783f88d936264afe89fceff37.js:3979
start @ vendor-9eb434e783f88d936264afe89fceff37.js:4136
(anonymous) @ dummy-4bf0226f3813439d8a02071215bd140f.js:14
e.invoke @ vendor-9eb434e783f88d936264afe89fceff37.js:1399
e.flush @ vendor-9eb434e783f88d936264afe89fceff37.js:1394
e.flush @ vendor-9eb434e783f88d936264afe89fceff37.js:1402
e.end @ vendor-9eb434e783f88d936264afe89fceff37.js:1414
e._run @ vendor-9eb434e783f88d936264afe89fceff37.js:1455
e._join @ vendor-9eb434e783f88d936264afe89fceff37.js:1454
e.join @ vendor-9eb434e783f88d936264afe89fceff37.js:1423
ot.join @ vendor-9eb434e783f88d936264afe89fceff37.js:2433
(anonymous) @ vendor-9eb434e783f88d936264afe89fceff37.js:2437
l @ vendor-9eb434e783f88d936264afe89fceff37.js:250
c @ vendor-9eb434e783f88d936264afe89fceff37.js:251
vendor-9eb434e783f88d936264afe89fceff37.js:251 [Violation] 'setTimeout' handler took 78ms
vendor-9eb434e783f88d936264afe89fceff37.js:3908 [Violation] Added non-passive event listener to a scroll-blocking 'mousewheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952

Integration tests failing when injecting the tour service.

Hi there πŸ‘‹

I've noticed that after calling the tour service in one of my components, that component's integration test would start failing with the following error Attempting to inject an unknown injection: 'service:window'.

I tracked it down to the ember-window-mock library that is a dependency of ember-shepherd, specifically here https://github.com/kaliber5/ember-window-mock#integrationunit-tests

I fixed my issues by following the steps outlined above ☝️ but it required a bit of hunting around.

Not sure if you can think of a fix to avoid this being an issue or perhaps just a documentation update to let people know that could be an issue.

Apart from that, enjoying the library, thanks ✌️

Check for required elements on tour start?

Hey, I was thinking we should probably be checking for the required elements when the tour starts. I've found that, between setting the steps and starting the tour, elements might change on the page. I am setting the steps of my tour for a route in setupController, so is maybe there's a better place to do the tour configuration?

An in-range update of ember-cli-shims is breaking the build 🚨

Version 1.1.0 of ember-cli-shims just got published.

Branch Build failing 🚨
Dependency ember-cli-shims
Current Version 1.0.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-cli-shims is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • βœ… codeclimate/coverage 91.99% Details

  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Ability to call super from all options (i.e. build off default values)

The two places this comes across most is classes and beforeShowPromise:

  • I think a classNames setup might be a nice feature that would allow for dryer code
  • Also, a this._super(...arguments); would go a long ways in beforeShowPromise

// sorry for all the issues... ill start wrapping them up, just in a time of heavy code production

Scrolls down when it doesn't need to

I'm not sure if this is related to #35, but I don't think it is.

You can see it on the project page. When you load it, it scrolls down until the element it is pointed at is at the top of the page (if your page is cached, you might need to do this in incognito).

Is there any way to disable this jumping and only scroll if the element is out of the view? Thanks!

screen shot 2016-02-06 at 4 00 38 pm

Way to get user to confirm quitting a tutorial

What happened

I want to use a browser's native alert for confirming a tutorial quit.

I tried to monkey patch with the following code, but was unsuccessful:

    var route = this;
    Ember.$("body").on("click", ".shepherd-cancel-link", function(e){
      var stopTutorial = confirm('Are you sure you want to stop the tutorial?');
      if ( stopTutorial ) { return; }
      e.preventDefault();  // first attempt
      route.get('tour').start();   // second attempt 
    });

2 unsuccessful attempts

  • e.preventDefault(); - you probably use ember bindings, rendering this useless
  • route.get('tour').start(); - gets demo to start, but it's completely reset

Using npm to pull in sheperd and tether dependencies

Hi there,

Thanks for this amazing add-on. We've been trying it out with some great success.

I was just wondering if you've ever thought of pulling the dependencies in via npm instead of bower?

The reason I'm asking is that we also use ember-modal-dialog and ember-tooltips both of which use ember-tether to pull in the tether dependency via npm.

I'm not completely sure what happens if you pull tether in through npm and bower. I was just curious if you'e ever thought of this before?

Thanks,
Ian

Doesn't support attachTo object

Shepherd seems to allow you to use an object to define the attachTo behavior:

For example: ".some #element left", or {element: '.some #element', on: 'left'}. If you use the object syntax, element can also be a DOM element. If you don't specify an attachTo the element will appear in the middle of the screen.

However, trying to use this with ember-shepherd breaks the tour with the following error

Uncaught TypeError: currentStep.options.attachTo.split is not a function

Which corresponds to the code found here.

After an upgrade

After upgrading to ember 2.10.0 I'm getting an exception for shepherd. When I remove it from my app thing work again...

ideas?

shepherd.js:25 Uncaught TypeError: Cannot read property 'Utils' of undefined(…)
(anonymous function) @ shepherd.js:25
(anonymous function) @ shepherd.js:9
(anonymous function) @ shepherd.js:11

loader.js:219 Uncaught Error: Could not find module `ember-resolver` imported from `plhw-client/resolver`(…)
missingModule @ loader.js:219
findModule @ loader.js:230
Module.findDeps @ loader.js:170
findModule @ loader.js:233
Module.findDeps @ loader.js:170
findModule @ loader.js:233
requireModule @ loader.js:20
(anonymous function) @ app-boot.js:4

_this.getElementForCurrentStep()

I am trying to implement the add-on, but I can't get it to work properly. When I add steps to the tour, including the default next button, I get a console error when it hits _this.getElementForCurrentStep():

Uncaught TypeError: Cannot read property 'style' of null

Any thoughts as to why?

Here are my options:

    this.get('tour').set('steps', [
      {
        id: 'tour-step-1',
        options: {
          title: 'Step 1 title!',
          text: ['Step 1 text.'],
          builtInButtons: [
            {
              classes: 'btn',
              text: 'Exit',
              type: 'cancel'
            },
            {
              classes: 'btn btn-success',
              text: 'Next',
              type: 'next'
            }
          ]
        }
      },

      // Step 2
      {
        id: 'tour-step-2',
        options: {
          attachTo: '.main-menu bottom',
          title: 'Step 2 title',
          text: ['Step 2 text'],
          builtInButtons: [
            {
              classes: 'btn',
              text: 'Exit',
              type: 'cancel'
            },
            {
              classes: 'btn btn-success',
              text: 'Next',
              type: 'next'
            }
          ]
        }
      }
    ]);

Using:

    "ember": "2.2.0",
    "ember-data": "2.2.1"

Arrows not being added to pinned tethers (ones where they are successfully attached)

  • Arrows are only applied to correctly attached tethers. Is there a way to get it to work for pinned arrows too? see tether-theme-arrows.sass
  • For example, being pinned in the x direction (i.e pinned right) shouldn't prevent arrows being added to tethers attached successfully in the y direction (i.e. attached top)

a cool way to solve it might be to somehow do something like :

  • $('head').append('<style>.column:before{width:800px !important;}</style>');

a la stack overflow

Get to 100% code coverage

We currently have 92% code coverage, but it would be great to get to 100% and make the tests more robust, so we can be sure the addon continues to work well.

An in-range update of ember-cli-eslint is breaking the build 🚨

Version 3.0.3 of ember-cli-eslint just got published.

Branch Build failing 🚨
Dependency ember-cli-eslint
Current Version 3.0.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-cli-eslint is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • βœ… codeclimate/coverage 91.99% Details

  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 17 commits .

  • d479e5b 3.0.3
  • 8ecfea7 Merge pull request #159 from rwjblue/update-babel-6
  • 792e14c Remove ember-cli-babel dependency.
  • 8c20b23 Merge pull request #160 from ember-cli/greenkeeper/ember-cli-blueprint-test-helpers-0.17.1
  • d6ab08e chore(package): update ember-cli-blueprint-test-helpers to version 0.17.1
  • d96906c Merge pull request #155 from jeffjewiss/readme-linting
  • 6285ccd Merge pull request #157 from ember-cli/greenkeeper/testdouble-2.0.1
  • 305f8ec chore(package): update testdouble to version 2.0.1
  • 65c15de update readme: add note about linting build files
  • 1a07faa Merge pull request #156 from ember-cli/greenkeeper/ember-resolver-3.0.0
  • 4eaa075 chore(package): update ember-resolver to version 3.0.0
  • 1ab3776 Merge pull request #149 from ember-cli/greenkeeper/fs-extra-2.0.0
  • 527f250 Merge pull request #151 from ember-cli/greenkeeper/ember-cli-blueprint-test-helpers-0.15.0
  • 3fe511f chore(package): update ember-cli-blueprint-test-helpers to version 0.15.0
  • c613913 chore(package): update fs-extra to version 2.0.0

There are 17 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Allow user to decide where to place the `shepherdOverlay` element

Current behavior

The element gets appended to body. In my case, it's a bit complicated since I have to place it in a different element to make the highlighting work properly.

Proposed behavior

The user can pass in an optional config option modalContainer (defaults to body) which influences where the modal element will be placed. Usage:

// tour setup goes here
tour.setProperties({
  modal: true, 
  modalContainer: '.some-modal-container'
});

Let me know what you think :) Happy to create a PR in case the proposal is accepted.

Custom button actions

Hi,

This is a great library but i'm stuck trying to use more button types that the built-in ones.

In my step I'm using the builtInButtons option taken from the dummy app but wanting to include a button which has a custom action.

      ...
      builtInButtons: [
        {
          classes: 'button cancel-button',
          text: '<span class="button-text">Close</span>',
          type: 'cancel'
        },
        {
          classes: 'button tour-button',
          text: '<span class="button-text">Take the tour</span>',
          type: 'next'
        },
        {
          classes: 'button sign-in-button',
          text: '<span class="button-text">Sign in</span>',
          action: 'signin'
        }
      ],
      ...

Both the next and cancel work as expected, but I haven't been able to get the custom action to work no matter what I try.

First, I tried to add it as a custom event when I set the defaults for the tour like this,

    tour.on('signin', () => {
      console.log('sign in');
    });

Then as a simple action in the route from which the service is added

  action: {
    signin() {
      console.log('action sign in');
    }
  }

And failing that using the when option in the step

      when: {
        signin: () => {
          console.log('sign in from when');
        }
      }

I feel I must have missed something but can't seem to work out what.

If you could help I'd be happy to update the documentation to include this as it would be a big help (at least to me).

Thanks.

Fix breaking changes in FastBoot 1.0

The current ember-cli-fastboot releases (1.0.0-rc.1 and above) introduce breaking changes. These will most likely break your current FastBoot implementation.

See ember-fastboot/ember-cli-fastboot#387 for more information and a guide on how to fix your addon. Also you may want to visit the -fastboot Slack channel to get help from other users.

Note: this issue has been created automatically, by searching for certain patterns in your code. If you think this has been falsely created, feel free to close!

Clarify/change builtInButtons

We still call this builtInButtons, but it actually supports custom buttons too now, so we should update docs and possibly change the name.

Install Error

Hi There,

Per the instructions, I just ran ember install ember-shepherd then ember s to recompile the app. When I do this, the app fails to load and my console is spitting out the following error application.inject is not a function. Do I need to perform additional configuration to get the app up and running? We're running on Ember 1.13 and Ember-Cli 0.2.7.

Thanks,
Eric

Question: Attaching to elements in the corner

Is there any way to offset or alter the attaching behavior for elements that exist in the corner of the page?

The default behavior of centering on the selected side of the element doesn't work very well for elements in or near the corner, currently.

Tagged releases?

Hey, do you think it'd be a good idea to tag released? I know you're keeping up with semver, so maybe it would be good to do that as well as keep up a changelog attached to each one.

Body classes on tour complete

I have a few styles that I'm adding to my app based on wether the tour is actually running. This is working great except that all of the classes for the tour persist even when the tour has been completed or cancelled. It would be really nice if the tour was torn down once it was finished.

Add `tmp` dir to the .npmignore.

Disclaimer: I do not use the package, this was found during automated npm packages downloading.

Your current package size is 107 MiB packed, 622 MiB unpacked. 621 MiB of that are inside the tmp dir. I think that this probably got packed to the release by mistake.

Btw: you also packed your .idea dir to the release.

Needs a release

I think the latest update to ember-tether fixes the babel deprecation, would appreciate a release πŸ‘

Route Transition

Is there already a way span a tour over multiple routes?
I tried with the beforeShowPromise function, which fires the promise too early before html classes are available...

this.get('tour').set('steps', [
  {
    id: 'intro',
    options: {
      attachTo: '.first-element bottom',
      beforeShowPromise: function() {
         return new Promise(function(resolve) {
             router.transitionTo('myurl').finally(() => {
                 resolve();
             });
        });
      },
     // ...
}]);

Any recommendations?

thx

Configuration Error

After running $ ember install:addon ember-shepherd app immediately breaks, citing the following error: (Path or pattern "bower_components/shepherd.js/shepherd.js" did not match any files), as there is no 'ember-shepherd' directory in 'bower_components'. Most other addon's I have used refer to dependency in bower.json. Emerber-shepherd directory is added to node_modules, and package.json includes shepherd dependency. Seems to be missing path for bower. -- hope this helps, as I am eager to implement in my development.

No support for advanceOn (shepherd step option)

From the step options in the shepherd docs:

advanceOn: An action on the page which should advance shepherd to the next step. It can be of the form "selector event", or an object with those properties. For example: ".some-element click", or {selector: '.some-element', event: 'click'}. It doesn't have to be an event inside the tour, it can be any event fired on any element on the page. You can also always manually advance the Tour by calling myTour.next().

An in-range update of ember-source is breaking the build 🚨

Version 2.13.1 of ember-source just got published.

Branch Build failing 🚨
Dependency ember-source
Current Version 2.13.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As ember-source is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 15 commits.

  • 57b6b82 Release v2.13.1.
  • 637c0a4 Add 2.13.1 to CHANGELOG.
  • 566f5a8 Lock down testem version.
  • 0e51ff3 Lock down route-recognizer to 0.3.0.
  • a8931d1 [BUGFIX release] Ensure debug statements are no-ops in production builds.
  • 1cd162d fixup! [BUGFIX release] MODEL_FACTORY_INJECTIONS is now always false.
  • 20e0ba6 [BUGFIX release] Ensure nested custom elements render properly.
  • 005cff8 [BUGFIX release] MODEL_FACTORY_INJECTIONS is now always false.
  • c736afc [BUGFIX release] Remove reference to dist/ember.js file.
  • 2c23df8 [BUGFIX release] Fix EmberError import in system/router
  • d8c1641 [DOC release] correct casing of _routermicrolib deprecation url
  • bb57294 [BUGFIX Release]fix mocha blueprint service test filename
  • a4bfeea [BUGFIX beta] Fix double container destroy
  • b64ce22 [BUGFIX release] Ensure that it is possible to experiment with syntax.
  • c4e4415 Fix access to service:-document in engines

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Tether is end-of-life

It might be worth mentioning in the readme that Tether.js, the library that Shepherd uses for positioning popups, is end-of-life. Plus, Shepherd's future seems tenuous at best given Hubspot's apparent abandonment of open source maintenance.

Jittery behavior with disableScroll in Safari mobile

Thanks for the great addon, first of all. This is not a major issue, but disableScroll does not seem to work smoothly in Safari mobile. In iOS chrome I see a fairly smooth "snap-back", but in Safari it jitters back and forth rapidly, creating a flicker effect which is a bit jarring to the user.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.