1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

44 Commits

Author SHA1 Message Date
Chris Cummer
8eb4a25891
WTF-1070 Read response body data before closing (#1071)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2021-03-27 19:30:18 -07:00
David Bouchare
49109c77f7
[several modules] Close the response body (#1040) 2021-01-16 12:36:29 -08:00
Chris Cummer
fd794707cd
☢️ WTF-1031 Support multiple simultaneous configurations (#1032)
* WTF-1031 Rename WtfApp.app to WtfApp.tviewApp

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-1031 Add scaffolding for main to support multiple WtfApp instances

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-1031 WIP

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Remove common functionality from KeyboardWidget and into Base

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Augment with some descriptive comments

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Add full support for multiple app instances via the AppManager.

Still to do:

* Config support for multiple apps/multiple config files
* The ability to switch between apps

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Move SetTerminal out of main and into its own file

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-12-21 03:25:41 -08:00
Chris Cummer
d6a0797bf2 Simplify the inclusion of the Common config settings into each module
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:18:46 -08:00
Chris Cummer
f9a06540f1 Simplify the view loading for the keyboard widget
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:12:15 -08:00
Chris Cummer
4a820dd0e5 Make every widget a keyboard widget
Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-11-26 23:12:15 -08:00
Tim Hwang
9b0f4a50e8 fix: fix Jira module title formatting
Closes #942. Filing to get the ball rolling, happy to change anything.
2020-07-29 10:32:34 -04:00
Sam Roberts
3c405da087 Use docker-credential-helper to manage secrets
Store service credentials securely in the stores supported by docker:
- https://github.com/docker/docker-credential-helpers#available-programs

Introduces a top-level config property, "secretStore" and additional
command line arguments to manage the stored secrets.

The value of secretStore is used to find a helper command,
`docker-credential-<secretStore>`.

The docker project currently provides 4 store helpers:
- "osxkeychain" (OS X only)
- "secretservice" (Linux only)
- "wincred" (Windows only)
- "pass" (any OS supporting pass, which uses gpg2)

Docker-for-desktop installs the credential helpers above, as well as
"desktop" (docker-credential-desktop).

Generic installation instructions for the helpers:
- https://github.com/docker/docker-credential-helpers#installation

Users could provide additional helpers, the only requirement is that the
helper implements the credential store protocol:
- https://github.com/docker/docker-credential-helpers#development

The credential protocol is open, and new credential stores can be
implemented by any CLI satisfying the protocol:
- https://github.com/docker/docker-credential-helpers#development

The modifications to existing modules is not tested due to lack
of API keys, but demonstrates the unobtrusive changes required to
use the secret store.
2020-05-10 19:26:32 -07:00
Chris Cummer
f0ca3b8a58
Another actions test (#889)
* Another actions test

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Add BuildTest action

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Remove lint check for the time being (so many issues)

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Fix issues found by errcheck

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Fix errors found by staticcheck

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Fix issues found by goimports

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Comment out the  action for the time being

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Fix shadowed variables

Signed-off-by: Chris Cummer <chriscummer@me.com>

* go mod tidy

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Remove buildtest.yml

Signed-off-by: Chris Cummer <chriscummer@me.com>

* go mod tidy

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-05-09 12:51:08 -07:00
Chris Cummer
200dbcc03c
WTF-730 Fix missing color key config error (#738)
* WTF-730 Fix missing color key config error

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Add Subheading color formatting to modules

Users can now set a `subheading` color in their config to change the
color of subheadings in widget display.

Defaults to `red`.

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Fix oustanding color issues

Clean up missing color config changes not addressed in earlier commits.

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Remove unused dependency

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Base cleanup

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Fix a few bugs related to color config changes

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Fix issues with PagerDuty subheading display

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-730 Fix bug with Todo list colour rendering

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-09 11:21:45 -08:00
Chris Cummer
1bfca29d17
WTF-657 Add spec coverage for cfg/common_settings.go (#728)
* WTF-657 Add spec coverage for cfg/common_settings.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Add spec coverage for cfg/position_validation.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Add spec coverage for cfg/validations.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Add spec coverage for checklist/checklist.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Add spec coverage for checklist/checklist_item.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Add spec coverage for utils/conversions.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Get rid of utils.Home() function

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Add spec coverage for utils/homedir.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Add spec coverage for utils/text.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Clean up utils/utils.go

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-10-30 17:35:00 -07:00
Chris Cummer
bf877f5fa7 Constantize the defaultFocus value for each module 2019-09-22 18:12:29 -07:00
Tim Scheuermann
8d3763d0a6
Added info for using Jira with Basic-Auth 2019-09-12 13:35:52 +02:00
Sean Smith
36fbad54d8 Fix JSON parsing
Issue #600 points out Jenkins module panics occasionally
I noticed that a number of places panic because of JSON parsing
Centralize JSON parsing, have it return an error, and have widgets
report the error
2019-09-07 15:14:33 -04:00
Chris Cummer
d0095f9e62
Merge pull request #591 from lesteenman/WTF-574-change-jira-status-layout
WTF-574: Change display of Jira columns.
2019-09-02 16:03:00 -07:00
Sean Smith
8835f532cc Refactor a number of widgets to display client errors
Rather than swallowing or crashing, display appropriate errors
2019-09-01 13:19:07 -04:00
Erik Steenman
35797d2db6 WTF-574: Change display of Jira columns.
- Single-word status is now shown
- All columns are now of equal width
- Issue type and issue status columns are now trimmed to
  a certain max length (7 and 14 characters, respectively).
2019-08-31 22:47:34 +02:00
Chris Cummer
fce8b69459 Support case-insensitive 'apiKey' config keys
'apiKey' is one that people are likely to spell wrong in their configs
as 'apikey'. Given that there's no sanity-checking around required
config values yet, and a missing API key can cause silent failures in
some modules, be liberal in accepting spelling.
2019-08-29 06:34:52 -07:00
Sean Smith
14e7619075 Renormalize the redraw function
Have all instances take a function
Update the remaining modules to take this into account
Numerous smaller refactors to make some widgets work more or less the same
2019-08-27 21:51:37 -04:00
Chris Cummer
523a0bec2c Remove the need for every module to define a widget.Refresh keyboard control 2019-08-23 21:18:51 -07:00
Chris Cummer
5337656c58 Remove the need for every module to define a widget.ShowHelp keyboard control
This common functionality is moved up to KeyboardWidget. Modules now
include widget.InitializeCommonControls() instead.
2019-08-23 21:18:51 -07:00
Chris Cummer
4e46fff145 Move the utils.go file into the /utils directory 2019-08-05 10:50:12 -07:00
Chris Cummer
dbc047516d Move all components responsible for module composition into /view 2019-08-04 21:42:40 -07:00
Chris Cummer
b07f3c5e67 Reimpliments the module configuration validation
Now supports displaying errors from multiple widgets.
2019-07-07 16:04:43 -07:00
Chris Cummer
2da3344612 Get --module=[modname] working again (broke when position config validation was added) 2019-07-06 01:55:54 -07:00
Sean Smith
f4f2901e58 Add help strings from h-r 2019-07-05 12:16:55 -04:00
Sean Smith
c4d58ece81 Add a helper function to do highlighting in a uniform way 2019-05-24 22:06:47 -04:00
Kirill Motkov
f0771cd013 Some code improvements
* Some assignments simplified by using assignment operators
* Rewrite switch statement with only one case as if.
* Rewrite if-else chain as a switch statement.
* go fmt `modules/todoist/project.go` file.
2019-05-21 17:29:09 +03:00
Sean Smith
a2f5db7847 Harmonize keyboard controls
Make sure everyone has a refresh option
Have specific ordering:
 - Help
 - Refresh
 - Select next
 - Select prev
 - ...

Add unselect where applicable
2019-05-20 18:45:08 -04:00
Sean Smith
7f3daaac59 Have keyboard widget manage its own help
Define help with keys
This means that keys and help are automatically in sync
This means that you can't define keys, but forget help
This unfortunately also means that formatting may not be quite as good
2019-05-11 12:15:52 -04:00
Sean Smith
210723cd74 Create abtract scrollable widget
This cleans up a bunch of boilerplate for scrollable items and standardizes their usage
2019-05-10 17:06:45 -04:00
Sean Smith
018d2af3ae Add a global Redraw method for TextWidget
Partially addresses #429, by centralizing widget drawing
2019-05-10 08:42:37 -07:00
Sean Smith
a5f98c138a Move closing region tag to the end of the line
Highlight works by highlighting the entire region that exists
Since current region starts and immediately ends, there is no highlighting
2019-05-09 11:00:19 -04:00
Chris Cummer
2d0706c40b WTF-427 Use new keyboard implementation for widgets. Closes #427 2019-05-06 12:54:07 -07:00
Sean Smith
14abd422b2 Add default titles, to mimic original behavior
Have the modules set their own titles
If no title is specified, use this title, rather than default to name
2019-04-30 23:38:37 -04:00
Sean Smith
17d53ca39a Update title handling so that config based title can be used
There is already default handling of title. Remove instances where people are unknowingly overriding it
For instances where we want to set special things, make sure to use CommonSettings.Title, so people can still override
2019-04-30 07:13:52 -07:00
Sean Smith
5abd701b40 Decouple modules from global config
Rather than referencing wtc.Config, instead pass the global config
Also, look up config for the module early and pass that in sooner, to deal with fewer long paths and get rid of the
ConfigKey variable
2019-04-27 22:26:23 -04:00
Chris Cummer
5445309aa0 WTF-315 Fix race conditions caused by writing to view 2019-04-25 19:39:49 -07:00
Chris Cummer
88fdf9702b WTF-400 Move settings-related functions from util.go into common_settings.go 2019-04-21 21:35:45 -07:00
Chris Cummer
f09d08bda2 WTF-400 Common settings implemented 2019-04-18 18:22:19 -07:00
Chris Cummer
b50c762dab WTF-400 Move name and configKey values from widget to settings 2019-04-17 17:16:26 -07:00
Chris Cummer
fea83a38b2 WTF-400 Jira extracted to new config format 2019-04-15 10:46:41 -07:00
Chris Cummer
aa313bdaa4 WTF-389 Log an exception and terminate if widget config is invalid
If, on startup, a widget's positional configuration is invalid (ie:
cannot be displayed onscreen) then terminate the app and inform about
which widget is erroring
2019-04-12 05:29:44 -07:00
Sean Smith
8030380f89 Migrate all modules to their own subfolder
Handles #375
2019-02-18 11:16:34 -05:00