moshe / pagerduty-angular

nice javascript-angular wrapper for pagerduty incidents, let you the ability to search and filter
http://moshe.github.io/pagerduty-angular/#/
19 stars 4 forks source link

Oncall addition listing? #4

Open echoe opened 7 years ago

echoe commented 7 years ago

Hi,

I'm sorry, I don't have any real angular experience - is there a 'best way' to expand this script to also pull oncall users/contact info for specific events, depending on the event provenance? I've pulled what I can outside of using this second API point (I have a link people can click to see who's on call for the alert) - and I have a test instance built off of this script which pulls the entire oncall array down into a field - but I've been having issues getting the part of the array(s) that I need due to the AngularJS framework. Any help would be appreciated.

Thank you for making the dashboard in general, though - my company's currently using it with my small tweaks and it's very helpful :)

moshe commented 7 years ago

Hi @echoe, Nice to hear you are using my repo (: I will be happy to review and merge your changes into the master branch, just submit a PR.

Regarding the oncall feature request, let me check if I understand currently: For each incident (event) you want to know who was oncall during the incident period? Do you started working on it? You can submit a PR and I can help getting this done.

echoe commented 7 years ago

I have a fork with the current 'what I'm using' on my github here: https://github.com/echoe/pagerduty-angular . If you want I can PR that. :)

I also have a test that's further along in actually getting the oncall data I want - it's there but unsorted, basically, and probably not being called correctly. That also looks way worse right now as the data isn't properly formatting in the cells of the angular app. If you want I can PR that instead? My issue is that I have very little true HTML formatting experience, so I don't know how to grab stuff out of the array that it's in. What I've read seems to point towards changing a lot of the current angular setup, so it's currently a 'nice to have' that I don't have time for as I'm going to need to learn Angular to get it done myself, heh.

But yes - for each incident I want ... basically, the best thing to have would be if I could query the relevant oncall data just like I can query the incident data in your current setup - then I could edit it as I needed over time. The end goal is to have a dashboard that lists: -the alert subject -When was it created? -Current state (triggered/etc./etc.) -the oncall person for that alert at levels 1/2/3 along with methods of contact - so that other parts of our team here know who they need to call if they need to do it.

I adjusted it to have everything except for the oncall data on the page - the oncall data is via a link right now. Getting it without clicking the link and going through/logging in to pagerduty/etc. requires calling a different API endpoint to get the relevant data. If you set up an API call in app.js that set all of the relevant oncall data for an incident to something for each incidents list (maybe it would be in something like incident.oncall?), I could pretty easily just grab the data I want from that and call it with incident.oncall.(stuff) to grab the correct data out of the arrays.

I had two other small questions, I guess - if you want I can make new issues for them: -Are the resolve/acknowledge icons supposed to do anything? I can't click them or do anything with them. I don't specifically need this but it may be good for you to know, if you're working on it and want it to have that working. :)

-It would be nice to have this script just have the auth token inside the app, instead of require that you fill it in. I did just make that change myself (and it was pretty easy to do) so it's not necessary really, but maybe as a nice to have?