Coder Social home page Coder Social logo

ember-link-action's Introduction

Ember Link Action

Build Status npm version Ember Observer Score

Ember addon. Fire action when LinkTo transitions to other route. OK for SEO solution.

Usage

Octane

You can pass an action as @invokeAction attribute of LinkTo component:

<LinkTo @route='cart' @invokeAction={{this.testAction}}>Cart</LinkTo>
<LinkTo @route='cart' @invokeAction={{fn this.testAction 'value1' 'value2'}}>
  Cart
</LinkTo>

Classic

You can pass closure action as invokeAction attribute of {{link-to}} component:

{{#link-to 'cart' invokeAction=(action 'testAction')}}
  Cart
{{/link-to}}

To pass parameters to action you can use:

{{#link-to 'cart' invokeAction=(action 'testAction' param1 param2)}}
  Cart
{{/link-to}}

Compatibility

  • Ember.js v3.12 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

This addon supports Embroider.

Most recent versions work with >= 3.0 versions of Ember. For more info check test scenarios in travis.yml.

For >= 2.0.0 AND < 3 compatibility use tested version: 1.0.0.

For 1.13.13 compatibility use tested version: 0.0.37.

Installation

ember install ember-link-action

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

ember-link-action's People

Contributors

dependabot[bot] avatar e00dan avatar greenkeeper[bot] avatar greenkeeperio-bot avatar mansona avatar nathanhammond avatar panman82 avatar renovate-bot avatar scottkidder avatar thorsteinsson avatar

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

Watchers

 avatar  avatar  avatar

ember-link-action's Issues

An in-range update of loader.js is breaking the build 🚨

Version 4.5.0 of loader.js just got published.

Branch Build failing 🚨
Dependency loader.js
Current Version 4.4.1
Type devDependency

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

As loader.js 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 could not complete due to an error Details

Commits

The new version differs by 7 commits.

  • 094e20b release v4.5.0 πŸŽ‰
  • db2f6a6 Merge pull request #126 from ember-cli/moduleId
  • 204838b rename mod.name => mod.id
  • 4fa0fe0 add require.moduleId to allow a module to know its ID
  • f62bc54 Merge pull request #121 from ember-cli/define-exports
  • d963886 Update README.md
  • 928e18f add define.exports

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 🌴

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

issue with the internal links

Im having issue with the internal link not working while source target is dic with Id

{{#link-to fragment='#section1' invokeAction=(action "selectPanal" 'section1')
class="nav-link" }} {{t "nav-section.population-detail"}} {{/link-to}}

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

The devDependency ember-ajax was updated from 3.1.1 to 3.1.2.

🚨 View failing branch.

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

ember-ajax is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Commits

The new version differs by 5 commits.

  • f5d3245 chore(release): 3.1.2
  • 55cbc7c chore(deps): install standard-version
  • 101c357 fix: is*Error type definitions
  • fe518dc fix: skip instead of returning url when namespace is present in url
  • 975724d fix: bump typescript to get working d.ts

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Action is not fired

The transition happens normally, but the action is not triggered. This is the template:

<li>{{#link-to "logout" invokeAction="invalidateSession"}}<i class="fa fa-sign-out"></i> LOGOUT{{/link-to}}</li>

The action is defined on the application route:

import Ember from 'ember';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';

export default Ember.Route.extend(ApplicationRouteMixin, {
    session: Ember.inject.service('session'),

    actions: {
        invalidateSession: function() {
            this.get('session').invalidate();
        }
    }
});

The action is working fine with:

 <li><a href="#" {{action 'invalidateSession'}}><i class="fa fa-sign-out"></i> LOGOUT</a></li>

But with that I loose the link-to functionality, of course. Specifically, the whole application is reloaded (because the a tells the browser to navigate to another page I guess, even though I am using href="#")

I am running [email protected]. I have installed [email protected]. I am not sure ember-cli is automatically picking it up. Normally the

var app = new EmberApp(defaults, {
    // Add options here
});

should automatically package the necessary modules, right? (btw: what heuristics is EmberApp using to decide what to package?)

How can I verify if the ember-link-action package is included in the application?

Actions on the router

if you get a chance to make this read the actions on the router it would be great. Current;y my global actions (Login, Logout) are on the application router. The ember input and link-to can use them.

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

Version 6.2.0 of ember-cli-babel just got published.

Branch Build failing 🚨
Dependency ember-cli-babel
Current Version 6.1.0
Type dependency

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

ember-cli-babel is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error 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 🌴

Missing release tag

I am trying to fix all deprecation notes and one comes from ember-link-action as I am using the latest release (0.0.34). Why there is no release tag for the version that we can fetch from master? I don't want to depend on master branch as it will most probably change in future, also adding hash commit in package.json sucks. We definitely need 0.0.35 release.

An in-range update of ember-cli-htmlbars-inline-precompile is breaking the build 🚨

Version 0.4.3 of ember-cli-htmlbars-inline-precompile just got published.

Branch Build failing 🚨
Dependency ember-cli-htmlbars-inline-precompile
Current Version 0.4.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-htmlbars-inline-precompile 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 could not complete due to an error Details

Commits

The new version differs by 7 commits0.

  • 79d934d v0.4.3
  • c2e6b20 Merge pull request #81 from rwjblue/fix-version-check
  • 88484a6 Use fork of ember-cli-coffeescript (that uses compatible version checker).
  • d9d92d7 Update ember-cli-htmlbars version to be compatible with ember-cli-version-checker@2.
  • 5a032cd Update ember-cli-version-checker to be aware of nested packages.
  • 80cccc9 Add yarn.lock.
  • e772ee6 Update CHANGELOG for 0.4.2.

false

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 🌴

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

Version 4.2.0 of ember-resolver just got published.

Branch Build failing 🚨
Dependency ember-resolver
Current Version 4.1.0
Type devDependency

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

As ember-resolver 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 could not complete due to an error Details

Commits

The new version differs by 13 commits.

  • 218f83c v4.2.0
  • dd8a476 Merge pull request #199 from ember-cli/ember-cli
  • d041f7c Bump ember-cli (w/o eslint)
  • 6614e68 Merge pull request #198 from ember-cli/pass-referrer-v2
  • 5f425d6 Normalize referrer and lookupString, add config flag
  • d153cc8 Merge pull request #192 from 201-created/defaultType
  • aec0059 defaultType support, mv partials code to resolver
  • 9dec996 Merge pull request #190 from 201-created/no-normalize
  • 8d97d8b Assert against get, not normalize
  • d87ce8e Merge pull request #186 from ember-cli/typo
  • d0ad411 fix file name typo
  • 8ae3114 Merge pull request #184 from acorncom/patch-1
  • 5c20636 Fixes a small typo

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 🌴

An in-range update of ember-disable-prototype-extensions is breaking the build 🚨

Version 1.1.2 of ember-disable-prototype-extensions just got published.

Branch Build failing 🚨
Dependency ember-disable-prototype-extensions
Current Version 1.1.0
Type devDependency

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

As ember-disable-prototype-extensions 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 could not complete due to an error Details

Commits

The new version differs by 7 commits.

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 🌴

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

Version 1.3.2 of ember-cli-htmlbars just got published.

Branch Build failing 🚨
Dependency ember-cli-htmlbars
Current Version 1.3.1
Type devDependency

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

As ember-cli-htmlbars 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 could not complete due to an error Details

Commits

The new version differs by 4 commits0.

false

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 🌴

Use a component instead of reopening

Hi, would it be possible to extend Ember.LinkComponent with a new LinkToAction component instead of reopening? I made a quick failed attempt…

This would be to not pollute an already heavy LinkComponent.

Deprecated Dependency [email protected]

Starting with Ember 3.27, ember-cli-babel versions prior to 7.26.6 will cause following deprecation warning:
"Prior to v7.26.6, ember-cli-babel sometimes transpiled imports into the equivalent Ember Global API, potentially triggering this deprecation message indirectly, even when you did not observe these deprecated usages in your code."

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

Version 6.4.2 of ember-cli-babel just got published.

Branch Build failing 🚨
Dependency ember-cli-babel
Current Version 6.4.1
Type dependency

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

ember-cli-babel is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 5 commits.

  • bf126fe v6.4.2
  • 3f9f223 Merge pull request #158 from dwickern/sourcemaps
  • 8119645 Respect babel sourceMaps option
  • 90cde9e Merge pull request #157 from rwjblue/add-plugin-info
  • b5aa0b3 Add info on adding custom plugins.

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 🌴

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): replace dependency babel-eslint with @babel/eslint-parser 7.11.0
  • fix(deps): update dependency ember-cli-babel to v7.26.11
  • fix(deps): update dependency ember-cli-htmlbars to v5.7.2
  • chore(deps): update dependency ember-cli-dependency-checker to v3.3.2
  • chore(deps): update dependency qunit to v2.19.4
  • chore(deps): update glimmer.js packages to v1.1.2 (@glimmer/component, @glimmer/tracking)
  • chore(deps): update dependency @ember/test-helpers to v3
  • chore(deps): update dependency @embroider/test-setup to v3
  • chore(deps): update dependency ember-cli to v5
  • chore(deps): update dependency ember-maybe-import-regenerator to v1
  • chore(deps): update dependency ember-qunit to v7
  • chore(deps): update dependency ember-resolver to v11
  • chore(deps): update dependency ember-source to v5
  • chore(deps): update dependency ember-template-lint to v5
  • chore(deps): update dependency ember-try to v3
  • chore(deps): update dependency eslint to v8
  • chore(deps): update dependency eslint-plugin-ember to v11
  • chore(deps): update dependency qunit-dom to v2
  • fix(deps): update dependency ember-cli-htmlbars to v6
  • πŸ” Create all rate-limited PRs at once πŸ”

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

npm
package.json
  • ember-cli-babel 7.26.6
  • ember-cli-htmlbars 5.7.1
  • @ember/optional-features 2.0.0
  • @ember/test-helpers 2.2.6
  • @embroider/test-setup 0.41.0
  • @glimmer/component 1.0.4
  • @glimmer/tracking 1.0.4
  • babel-eslint 10.1.0
  • broccoli-asset-rev 3.0.0
  • ember-auto-import 1.11.3
  • ember-cli 3.26.1
  • ember-cli-dependency-checker 3.2.0
  • ember-cli-inject-live-reload 2.1.0
  • ember-cli-sri 2.1.1
  • ember-cli-terser 4.0.2
  • ember-disable-prototype-extensions 1.1.3
  • ember-export-application-global 2.0.1
  • ember-load-initializers 2.1.2
  • ember-maybe-import-regenerator 0.1.6
  • ember-qunit 5.1.4
  • ember-resolver 8.0.2
  • ember-source 3.26.1
  • ember-source-channel-url 3.0.0
  • ember-template-lint 3.4.2
  • ember-try 1.4.0
  • eslint 7.28.0
  • eslint-plugin-ember 10.5.0
  • eslint-plugin-node 11.1.0
  • loader.js 4.7.0
  • npm-run-all 4.1.5
  • qunit 2.16.0
  • qunit-dom 1.6.0
  • node 10.* || >= 12
travis
.travis.yml
  • node 12

  • Check this box to trigger a request for Renovate to run again on this repository

Abort transition based on the actions result

Would it be hard to abort the transition when false is returned from the action?

use case:

{{#link-to 'orders' invokeAction=(action 'onOrderRemove' model)}}CANCEL ORDER{{/link-to}}
  actions: {
    onOrderRemove: function (order) {
      let confirmed = confirm('Are you sure you want to cancel?');

      if (confirmed) {
        order.destroyRecord();
        return true;
      } else {
        return false;
      }
    }
  }

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

Version 6.3.0 of ember-cli-babel just got published.

Branch Build failing 🚨
Dependency ember-cli-babel
Current Version 6.2.0
Type dependency

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

ember-cli-babel is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 1 commits.

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 🌴

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

Version 6.4.1 of ember-cli-babel just got published.

Branch Build failing 🚨
Dependency ember-cli-babel
Current Version 6.4.0
Type dependency

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

ember-cli-babel is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 6 commits.

  • 63045ce v6.4.1
  • 6e8bc39 Merge pull request #154 from rwjblue/provide-annotation-to-babel-transpiler
  • 465353d Refactor README.
  • 79e5604 Update babel-plugin-debug-macros to avoid message building when test passes.
  • c53b873 Add convienient broccoli debug tooling.
  • 4e523f5 Provide annotation to broccoli-babel-transpiler.

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 🌴

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.