@beauraines/toggl-cli 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [2.1.1](https://github.com/beauraines/toggl-cli/compare/v2.1.0...v2.1.1) (2024-01-04)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * Improves handling of time entries with out a description ([#136](https://github.com/beauraines/toggl-cli/issues/136)) ([888248d](https://github.com/beauraines/toggl-cli/commit/888248d982a9bbd5bff1f46f8171c4911d4ea7b8)), closes [#135](https://github.com/beauraines/toggl-cli/issues/135)
11
+
5
12
  ## [2.1.0](https://github.com/beauraines/toggl-cli/compare/v2.0.3...v2.1.0) (2023-10-17)
6
13
 
7
14
 
package/cmds/ls.mjs CHANGED
@@ -39,7 +39,7 @@ export const handler = async function (argv) {
39
39
  timeEntries.forEach(element => {
40
40
  report.push(
41
41
  {
42
- description: element.description,
42
+ description: element.description ? element.description : 'no description',
43
43
  project: projects.filter(p => p.id == element.project_id)[0]?.name,
44
44
  project_id: projects.filter(p => p.id == element.project_id)[0]?.id,
45
45
  start: convertUtcTime(element.start),
@@ -11,7 +11,7 @@ export const handler = async function (argv) {
11
11
  if (currentTimeEntry) {
12
12
  const stopped = await client.timeEntries.stop(currentTimeEntry)
13
13
  const duration = dayjs.duration(stopped.duration * 1000).format('H[h] m[m]')
14
- console.log(`Stopped ${stopped.description} after ${duration}`)
14
+ console.log(`Stopped ${stopped.description ? stopped.description : `time entry with no description`} after ${duration}`)
15
15
  } else {
16
16
  console.log('There is no time entry running!')
17
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beauraines/toggl-cli",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "CLI client for Toggl Time Tracker",
5
5
  "main": "cli.js",
6
6
  "bin": {
package/utils.js CHANGED
@@ -110,7 +110,7 @@ export const displayTimeEntry = async function (timeEntry) {
110
110
  if (!timeEntry) {
111
111
  console.log('There is no time entry running!')
112
112
  } else {
113
- console.info(`${chalk.blueBright(timeEntry.description)} ${chalk.yellow('#'+timeEntry.id)}`)
113
+ console.info(`${chalk.blueBright(timeEntry.description ? timeEntry.description : 'no description')} ${chalk.yellow('#'+timeEntry.id)}`)
114
114
  console.info(`Billable: ${chalk.gray(timeEntry.billable)}`)
115
115
 
116
116
  // TODO this should be abstracted for reuse