Giter Site home page Giter Site logo

angular-cron-jobs / angular-cron-jobs Goto Github PK

View Code? Open in Web Editor NEW
116.0 8.0 67.0 1.05 MB

UI Component For Creating Cron Job Syntax To Send To Server

Home Page: http://angular-cron-jobs.github.io/angular-cron-jobs/#/

License: MIT License

JavaScript 81.69% CSS 3.06% HTML 15.25%

angular-cron-jobs's People

Contributors

dmitryefimenko avatar epgoranova avatar jacobscarter avatar olegyuzvik avatar rajanrastogi avatar tkarls avatar vascofernandes avatar wowo 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

angular-cron-jobs's Issues

value.forEach is not a function

Hello,

When selecting Month interval the error bellow appears in console:

angular.js:13920 TypeError: value.forEach is not a function
at SelectController.writeNgOptionsMultiple [as writeValue] (angular.js:28925)
at NgModelController.ngModelCtrl.$render (angular.js:31205)
at ngModelWatch (angular.js:27815)
at Scope.$digest (angular.js:17515)
at Scope.$apply (angular.js:17790)
at HTMLSelectElement. (angular.js:31142)
at defaultHandlerWrapper (angular.js:3497)
at HTMLSelectElement.eventHandler (angular.js:3485)

Issue can be reproduced on you demo website when using allowMultiple: true

What can produce this error ?
What is the influence on the final result ?

Thanks

Bower.json dependency problem

Hello,

Currently angular-mocks is listed as a normal dependency. This causes problems (in our setup at least) as angular-mocks will be part of the final distro.

Should it be listed in the "devDependencies" instead? Like this:

"dependencies": {
    "angular": "*"
  },
  "devDependencies": {
    "angular-mocks": "*"
  }`

Generated cron expression is not valid

I am using the cron expression generated by your utility with Quartz scheduler and the validation fails because we are not specifying the year part.

Is it possible to add a configuration provider to angular-service so that user can optionally turn this on.

Changing
var cron = ['*', '*', '*', '*', '*'];
to
var cron = ['*', '*', '*', '*', '*', '*'];
in service.setCron method of cronService fixes this issue.

styling of dropdowns in Firefox

Firefox's native styling of select dropdowns looks very "off." If we can have the provision to wrap each select dropdown with a parent, it would make custom styling much easier.

screen shot 2015-10-14 at 11 59 31 am

Allow list of values for fields

Hi- great directive, thanks!

It would be useful to be able to use a multi-select for the second input field, so multiple days could be selected if 'Every Week' is selected, or multiple months selected if 'Every Year'.

Integration with the latest Angular 2 Applications

Anytime I import this module in the Ionic 2 / Angular 2 using the ngModule decorator, I get the

"angular is not a function".

Is there a way around this or is there an angular2 version of this module?

how can i add 'custom' in drop-down.

I have added custom in base frequency with value as 7. When i add job that time it shows me custom under cron drop down but in edit case when i pass custom expression in model it doesn't change the value of drop-down. Need help of how can i achieve this.

Is there a way to set after init has happened?

Is there a way to update the cron data after it's already been initialized?

For example after a new file is loaded from disk I'd like to update the cron with the data from the file but I'm not sure if this is currently possible.

I know the first time it renders it will render with cronInitData but I don't see a way to set the data after it's been initialized once.

Thanks.

Month and day of the week seems to be inverted.

After some try I discovered, according to fromCron, that the cron string is parsed as m h D w M y, but, according to crontab documentation, should be m h D M w y.
This generates weekly task which results in invalid cron.

The generated cron seems to suffer of the same issue.

v2.0.0 broke init functionality

While working on merging init and output I noticed that ever since v2.0.0, the init does not work because of the changes to cronService.fromCron() function.

Steps to reproduce:

  • select base;
  • trigger init value change in the model
  • observe that inputs didn't get populated properly

Particularly, it seems that if's failing because of lines line that:

frequency.minuteValue = [parseInt(cron[0])];

... where the parsed value is wrapped in an array.

Not sure if this is a known "work in progress" situation or not, so I'm wondering if I should poke around this or let you fix this one and proceed with my stuff after.

Additional comma after Saturday

Quick fix, for lines 208-216, there is an additional comma after day 'Saturday' in .filter('dayName', ...).

This is problematic as it's obviously not great syntactically but it also makes Closure compiler fail.

Ability to use a custom template.

It would be great to be able to use a custom template.
I cannot integrate this into my website because I need support for foreign languages and support for custom design.

Maybe allow something like this ?

<cron-selection output="myOutput">
    <my-custom-html-here>
        Custom html that comply with angular-cron-jobs requirements
        that also includes my design and translations. 
    </my-custom-html-here>
</cron-selection>

Thank you for your awesome work ! :)

'option' should be 'options'

The readme says that configs should be set on

$scope.myConfig = {
    option: {
        allowWeek : false,
        allowMonth : false,
        allowYear : false
    }
}

But the directive looks for config.options

Thanks!

Scope parameter value not passing plz help

Hi

i have added html code as

"cron-selection config="cronOptions" ng-model="cronExpression""

and in controller

$scope.cronExpression = "0 0 * * *"

$scope.cronOptions = {
allowMultiple: true,
quartz: true
};

but the problem is when i have select a time thats not update the $scope.cronExpression ????

weird behavior when re-selecting base

Steps to reproduce:

  • select "Week" for base
  • select "Monday" for dayValue
  • change base to "Month"
  • observe that base is set to "Day"

Similar thing happens when your first select "Month" and go up to "Year".
I poked around a bit, but could not find where exactly the issue is.

Minor number suggestion

        switch (input) {
            case 1:
                return '1st';
            case 2:
                return '2nd';
            case 3:
                return '3rd';
            case 21:
                return '21st';
            case 22:
                return '22nd';
            case 23:
                return '23rd';
            case 31:
                return '31st';
            case null:
                return null;
            default:
                return input + 'th';
        }

Allow 'name' attribute to be provided for input field

I'm using this directive as a enhancement for an text input field in a server-side generated form. Currently I'm binding the output to my own hidden field so that the form can be submitted via POST, but it would be nice if this could be integrated into the directive.
E,g If the element the directive is applied to has a 'name' attribute, copy it to the inner select input

I may attempt a pull request for this if other may find it useful.

"config" is not working

I'm trying to perform a basic configuration by removing select options Minute and Hour following the instruction given on Demo with config. Even at the demo page the component is not behaving as expected (both month and year are still there).

At first view $scope.config is undefined when app reaches the code where the options should be removed.

Could you support empty selection

Hi,

thank you for this module!
It is possible to provide a selection to set the output to null or an empty string?

Many thanks in advance!

Cheers,
Stefan

supports events

It is not possible to know if value beet changed. I used $watch, but it does not same as blur or change.

expose base and possibly other parts

I have a case when I need to know what base user selected. I know that internally there is a variable for that, but maybe we could expose this info to the outside?
While we are at it, perhaps it would be a good idea to also expose other potentially useful stuff.
What do you think about it?

failing init * * * * * - every minute

if my server returns cronTime * * * * * (every minute), it'll run fromCron() function and wrongfully set frequency.base to every hour. See related lines of code

This should be:

if (cron[0] === '*' && cron[1] === '*' && cron[2] === '*' && cron[3] === '*' && cron[4] === '*') {
   frequency.base = 1; // every minute
} else if (cron[1] === '*' && cron[2] === '*' && cron[3] === '*' && cron[4] === '*') {
   frequency.base = 2; // every hour
} else if(cron[2] === '*' && cron[3] === '*'  && cron[4] === '*') {
   frequency.base = 3; // every day
} else if(cron[2] === '*' && cron[3] === '*') {
   frequency.base = 4; // every week
} else if(cron[3] === '*' && cron[4] === '*') {
   frequency.base = 5; // every month
} else if(cron[4] === '*') {
   frequency.base = 6; // every year
}

allow validation

Currently the output property for the cron-selection will default to * * * * * even if nothing is selected. That does not seem like the right behavior.
Some forms might require cron to be selected. Others might not.
Because it's defaulted to a value, there is no way to enforce required validation.

Also, on a side note (this should have been a separate issue), what's the reason for separating attributes init and output?
I haven't came across a situation when I'd need to bind these to different props. Why not combine them into ng-model?

options' values' types are inconsistent

First thing is first - awesome work!

Now the issue: I'm trying to create a different template using angular-material and therefore converting all <select> elements into <md-select>

It appears that angular's select directive is more forgiving on the values, which is why code works for the default template. However, angular-materials directive is having troubles because of the lines like below and similar:

if(n && n.base && n.base === '4') {

It seems that all values are initially declared as integers. However, in the if statements the comparison uses string value. This should be:

if(n && n.base && n.base === 4) {

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.