Browse Source

test book time;

master
stingl 4 years ago
parent
commit
5a1f3967a8
  1. 4
      .idea/timetrack.iml
  2. BIN
      assets/img/gitlab.png
  3. BIN
      assets/img/jira.png
  4. BIN
      assets/img/redmine.png
  5. 37
      js/app.js

4
.idea/timetrack.iml

@ -4,5 +4,9 @@
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="izitoast" level="application" />
<orderEntry type="library" name="quill" level="application" />
<orderEntry type="library" name="quill.snow" level="application" />
<orderEntry type="library" name="quill.bubble" level="application" />
</component> </component>
</module> </module>

BIN
assets/img/gitlab.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
assets/img/jira.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
assets/img/redmine.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

37
js/app.js

@ -211,6 +211,7 @@ const TimeTrack = {
}, },
stopTracking(ticket) { stopTracking(ticket) {
// console.log(ticket); // console.log(ticket);
let component = this;
ticket.trackingStopped = moment(); ticket.trackingStopped = moment();
ticket.tracking = false; ticket.tracking = false;
@ -233,6 +234,27 @@ const TimeTrack = {
} }
} }
if (this.ticketSystemUrl && this.isTicketNumber(ticket.number)) {
iziToast.show({
message: 'Buchung gespeichert',
color: 'blue',
buttons: [
['<button>' +
'<a href="' + component.ticketSystemUrl + ticket.number.replace('#', '').trim()+'/time_entries/new?time_entry[hours]='+Math.round(minutesSpent)/60+'">' +
'<img src="'+component.ticketSystemIcon+'" class="ticket-icon"/>' +
'</a>' +
'</button>', function (instance, toast) {
instance.hide({
transitionOut: 'fadeOutUp',
onClosing: function(instance, toast, closedBy){
component.restoreTrashed();
}
}, toast, 'buttonName');
}, true]
]
});
}
ticket.history.pushToBeginning(historyEntry); ticket.history.pushToBeginning(historyEntry);
} }
@ -792,6 +814,21 @@ const TimeTrack = {
fun: this.fun, fun: this.fun,
theme: this.theme theme: this.theme
}); });
},
ticketSystemIcon() {
if (this.ticketSystemUrl) {
if (this.ticketSystemUrl.find('redmine')) {
return 'assets/img/redmine.png';
}
if (this.ticketSystemUrl.find('jira')) {
return 'assets/img/jira.png';
}
if (this.ticketSystemUrl.find('gitlab')) {
return 'assets/img/gitlab.png';
}
}
} }
} }
}; };