Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add comments to refactored ui #775

Merged
merged 232 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
232 commits
Select commit Hold shift + click to select a range
8d26ab6
refactor(elm): created Shared model
KellyMerrick Dec 27, 2023
9bb887d
chore: elm-format
plyr4 Dec 28, 2023
ba318a8
chore: refactor toasties
plyr4 Dec 28, 2023
d181af0
chore: remove repo
plyr4 Dec 28, 2023
6ef7c53
refactor(elm): refactored user using shared model
KellyMerrick Dec 28, 2023
f4e6dce
refactor(elm): refactored sourceRepos using shared model
KellyMerrick Dec 28, 2023
88f4189
refactor(elm): refactored time using shared model
KellyMerrick Dec 28, 2023
a9d9549
refactor(elm): refactored entryURL using shared model
KellyMerrick Dec 28, 2023
e483ba0
refactor(elm): refactored visibility using shared model
KellyMerrick Dec 28, 2023
23cf225
refactor(elm): refactored buildMenuOpen using shared model
KellyMerrick Dec 28, 2023
b74c369
refactor(elm): refactored pipeline using shared model
plyr4 Jan 2, 2024
8128c6d
refactor(elm): refactored templates using shared model
plyr4 Jan 2, 2024
2bf109e
refactor(elm): exposing only model
plyr4 Jan 2, 2024
f57fece
refactor(elm): todo comments and use Shared.Flags
plyr4 Jan 2, 2024
876fa65
refactor(elm): prepare for Msg and more todo comments
plyr4 Jan 2, 2024
d6f728b
refactor: starting to deal with Effect, Pages, and tons of Msg
plyr4 Jan 2, 2024
42007f3
refactor(elm): starting to populate new home page
KellyMerrick Jan 3, 2024
230765d
refactor: split Api.elm to fix cycle import with refactored msg flow
plyr4 Jan 4, 2024
95ba8bf
refactor: rename page to legacyPage, rename pageModel to page, reorde…
plyr4 Jan 4, 2024
be1c083
refactor: make init look like elm-land init
plyr4 Jan 4, 2024
acc4ff0
refactor: organized Main.elm into sections of keep then remove
plyr4 Jan 4, 2024
daecf39
refactor: tons of main.elm organization, layouts, auth, and login code
plyr4 Jan 8, 2024
a8b3e12
refactor: auth working, tons of comments, needs cleanup
plyr4 Jan 10, 2024
f7cc6de
refactor: cleaning up auth code and moving things to shared.msg
plyr4 Jan 10, 2024
2c88b43
refactor: moved clipboard copy alert to shared.msg
plyr4 Jan 10, 2024
6d2f97e
refactor: adding Authenticate page
plyr4 Jan 11, 2024
47b7018
refactor: fixed auth/login flow, implemented most of source repos
plyr4 Jan 12, 2024
f2e3d40
refactor: dynamic route, and functioning default layout, work in prog…
plyr4 Jan 14, 2024
3e0047a
refactor: components for the default layout, layout and component props
plyr4 Jan 15, 2024
f2a2b44
refactor: rename Login_ model to AccountLogin_
plyr4 Jan 15, 2024
5febcb3
refactor: enable repo, shared effect msg, re-usable alerts
plyr4 Jan 15, 2024
3c6f0a5
refactor: wip subscriptions, more cleanup, layout and source repos al…
plyr4 Jan 15, 2024
bdb2ab6
refactor: license headers, moved everything to components and utils, …
plyr4 Jan 16, 2024
8286ab6
refactor: move help commands into util
plyr4 Jan 16, 2024
3f79653
refactor: rename Util to Utils
plyr4 Jan 16, 2024
047bc12
refactor: move help commands into util
plyr4 Jan 16, 2024
482ff11
refactor: created Org_Repo_ page
plyr4 Jan 16, 2024
42720a5
refactor: nested layouts for org page
plyr4 Jan 17, 2024
bc09a54
refactor: moved Tabs into Components
plyr4 Jan 17, 2024
646a678
refactor: repo layout, deployments and org page improvements
plyr4 Jan 17, 2024
c16b802
refactor: moved Pager into Components
plyr4 Jan 18, 2024
c1d6791
refactor: query parameters and pagination
plyr4 Jan 18, 2024
7eccbc7
stubbed todos for Build click callbacks
plyr4 Jan 18, 2024
3519f0a
refactor(builds): get actions menu to display
KellyMerrick Jan 18, 2024
0fafced
chore: removed all legacy code
plyr4 Jan 19, 2024
ee6de5a
chore: removed all legacy code and cleaned up various things
plyr4 Jan 19, 2024
b706de1
fix: dont set Loading on GotoPage
plyr4 Jan 19, 2024
72664d9
refactor: stubbed split vela files, fixed page naming, cleaned up ref…
plyr4 Jan 20, 2024
7feb6ab
refactor: rename and add notes to the PageTemplate
plyr4 Jan 20, 2024
e649888
refactor: org secrets and add org secrets pages
plyr4 Jan 20, 2024
1e30c6a
refactor: build layout and build_ page
plyr4 Jan 21, 2024
a1a3ba9
refactor: working on build layout and pages, stuck on tab switch load ux
plyr4 Jan 22, 2024
8793d99
refactor: wip build steps+logs
plyr4 Jan 22, 2024
f5e2548
refactor: steps+logs nearly complete
plyr4 Jan 22, 2024
2485978
refactor: steps+services+logs
plyr4 Jan 23, 2024
8350bfa
refactor: repo secrets, org+repo edit secret, initialized audit page
plyr4 Jan 23, 2024
dfb805a
refactor: audit+hooks+redeliver
plyr4 Jan 23, 2024
0cf9523
refactor: implement Repo_Schedules page
plyr4 Jan 23, 2024
043240b
refactor: cleaning up secret forms
plyr4 Jan 23, 2024
4b35340
refactor: cleaning up secret forms
plyr4 Jan 23, 2024
3f1fce7
refactor: add deployment and auth redirect fix for query params
plyr4 Jan 23, 2024
e355cb1
refactor: repo settings page with new allow events
plyr4 Jan 24, 2024
19d86cd
refactor: fix auth redirects with hash and query params
plyr4 Jan 24, 2024
5460c9e
refactor: developed pattern for loading and updating shared page reso…
plyr4 Jan 24, 2024
f8aee61
refactor: cleaning up Vela.elm
plyr4 Jan 24, 2024
52d56b8
refactor: remove unused dir
plyr4 Jan 24, 2024
4ec3b3b
refactor: pipeline expansion
plyr4 Jan 24, 2024
0a8015c
refactor: clean up page titles
plyr4 Jan 24, 2024
53a1dd2
refactor: clean up imports and RemoteData
plyr4 Jan 24, 2024
ac73711
refactor: clean up Errors imports
plyr4 Jan 24, 2024
02686f0
refactor: fix source repo view link
plyr4 Jan 24, 2024
1da9ac1
refactor: fix line focus dom functionality
plyr4 Jan 25, 2024
19de625
refactor: build graph implementation with auto refresh
plyr4 Jan 25, 2024
360e9ba
refactor: refined line focusing
plyr4 Jan 26, 2024
c29f22b
refactor: clear logs on collapse
plyr4 Jan 26, 2024
4646e23
refactor: logs optimizations and working lazy6
plyr4 Jan 26, 2024
e4dc4fa
refactor: implement auto refresh on a few pages
plyr4 Jan 26, 2024
7275348
refactor: implement schedule add/edit
plyr4 Jan 27, 2024
5c412c6
refactor: fix deployment ref textarea3 rows
plyr4 Jan 27, 2024
3953b61
refactor: clean up hardcoded docs urls
plyr4 Jan 27, 2024
1a4996d
refactor: cleaned up msgs and added grouping comments
plyr4 Jan 27, 2024
e868ca7
refactor: applied favorite button to repo and builds layouts using pa…
plyr4 Jan 28, 2024
9c0c12f
refactor: delete secret/schedule with confirmation and redirects
plyr4 Jan 28, 2024
bde20e8
refactor: refined some shared layout builds logic, separating the pag…
plyr4 Jan 28, 2024
f09ab58
refactor: repo settings functionality, tons of code consistency for a…
plyr4 Jan 29, 2024
4962fab
refactor: redid repo settings enabled
plyr4 Jan 29, 2024
8897bdc
refactor: table consistency, components for cells, and simplified css
plyr4 Jan 30, 2024
2f25327
refactor: table alignment fix, deployments clone link fix
plyr4 Jan 31, 2024
0ceb949
refactor(wip): help component
plyr4 Jan 31, 2024
7cd2ee5
refactor: remove unused imports
plyr4 Jan 31, 2024
f7c8ab0
refactor: replace routes during auth process, not push
plyr4 Feb 1, 2024
4a6e993
refactor: use old secrets routes
plyr4 Feb 1, 2024
c682a4b
refactor: move crumbs into nav props
plyr4 Feb 1, 2024
d6533ae
refactor: add secrets engine support via route and api, even tho it m…
plyr4 Feb 1, 2024
32e5264
refactor: move org and repo secrets modules to match elm land route s…
plyr4 Feb 1, 2024
5f2d48a
refactor: consistent props field order for engine
plyr4 Feb 1, 2024
e04bbd0
refactor: shared secrets
plyr4 Feb 1, 2024
13c512b
refactor: fix shared secrets header
plyr4 Feb 2, 2024
eb25600
refactor: auto refresh tweaks, organize secrets data
plyr4 Feb 2, 2024
0e8978a
refactor: favicons
plyr4 Feb 2, 2024
3afa056
refactor: organize msg
plyr4 Feb 2, 2024
cd26163
refactor: fix table icon spacing
plyr4 Feb 2, 2024
54f796e
refactor: fix builds pager alignment
plyr4 Feb 2, 2024
2e36467
refactor: pagination consistency, urlchanged with tab switch focus sk…
plyr4 Feb 2, 2024
1e1e1e9
refactor: fix graph, clear on init
plyr4 Feb 2, 2024
6c4b43f
refactor: fix graph, clear on failure
plyr4 Feb 5, 2024
88e7091
refactor: backporting #762 and #763
plyr4 Feb 5, 2024
a4db7db
wip: backporting allow events for secrets and repos
plyr4 Feb 5, 2024
fa86d91
refactor: backported allow_events from v23
plyr4 Feb 5, 2024
193069b
refactor: remove unused code and rename elm fields to allowEvents
plyr4 Feb 5, 2024
ea5185d
refactor: rearrange type order and add allow events header
plyr4 Feb 5, 2024
c81f1ff
refactor: backported deployments from v23
plyr4 Feb 5, 2024
d39d8aa
refactor: backported delete event from v23
plyr4 Feb 5, 2024
2955fb1
refactor: backported delete event from v23, forgot builds filter key
plyr4 Feb 5, 2024
2ec0ae2
chore: revert docker-compose change
plyr4 Feb 5, 2024
93da718
chore: revert docker-compose change
plyr4 Feb 5, 2024
e82ec0b
chore: general cleanup and consistency with comments etc
plyr4 Feb 5, 2024
dcba756
chore: clean up imports and exports
plyr4 Feb 5, 2024
d060094
chore: backport cypress test changes from v23
plyr4 Feb 5, 2024
0685782
chore: linting
plyr4 Feb 5, 2024
536c742
chore: elm test placeholder
plyr4 Feb 5, 2024
208cbe4
chore: elm test placeholder
plyr4 Feb 5, 2024
a54ba9e
chore: merge with main
plyr4 Feb 5, 2024
1573aea
refactor: move loading spinners to components
plyr4 Feb 5, 2024
b6e59c8
wip: fixing cypress accessibility tests
plyr4 Feb 6, 2024
1e6eeba
fix: cypress a11y light theme tests
plyr4 Feb 6, 2024
1e3fd41
refactor: in progress cypress test fixes
plyr4 Feb 6, 2024
da75e14
refactor(builds): get actions menu to display and begin restart build
KellyMerrick Feb 6, 2024
1aac2a4
Merge branch 'refactor/elm-rebuild-cypress' into refactor/elm-rebuild
plyr4 Feb 6, 2024
bc31b2e
chore: variable for base api changed
plyr4 Feb 6, 2024
de1b1df
elm-format
plyr4 Feb 6, 2024
7d30e7e
chore: comment
plyr4 Feb 6, 2024
db9f35d
refactor: added helper to parse org/repo from build.link and used it …
plyr4 Feb 6, 2024
6be7031
refactor(builds): repo actions menu cancel working
KellyMerrick Feb 7, 2024
dbd91ae
refactor(builds): actions menu restart and cancel on org builds page
KellyMerrick Feb 8, 2024
d7b8f34
refactor(build): restart build and almost cancel
KellyMerrick Feb 13, 2024
93176d5
refactor(build): cancel build
KellyMerrick Feb 13, 2024
f458030
Refactor/elm rebuild tests (#767)
plyr4 Feb 14, 2024
0842658
Merge branch 'main' into refactor/elm-rebuild
plyr4 Feb 14, 2024
0d2e08a
refactor: approve build
plyr4 Feb 14, 2024
29b677c
refactor: approve build
plyr4 Feb 14, 2024
7dfcad2
refactor: remove flaky test
plyr4 Feb 14, 2024
6178d88
refactor: add link to alerts
plyr4 Feb 14, 2024
6d87823
refactor: enable builds tests for actions buttons and fix cypress tes…
plyr4 Feb 14, 2024
652614c
tweak: increase a11y test timeout
plyr4 Feb 15, 2024
26b4fae
fix: flaky pipeline test
plyr4 Feb 15, 2024
b0c3145
tweak: increase a11y test timeout
plyr4 Feb 15, 2024
eea50ea
refactor(contextual help): add cli commands
KellyMerrick Feb 20, 2024
e142ddf
Merge branch 'contextual_help' into refactor/elm-rebuild
KellyMerrick Feb 20, 2024
8df4af0
refactor(contextual help): inconsistent spacing
KellyMerrick Feb 20, 2024
30453e0
refactor(contextual help): update secrets help
KellyMerrick Feb 20, 2024
96f76fa
refactor(contextual help): increase readability
KellyMerrick Feb 21, 2024
60ced6a
refactor(contextual help): vela validate pipeline -h
KellyMerrick Feb 21, 2024
6981cc0
fix: persist source repos across pages and fix copy button size
plyr4 Feb 29, 2024
20be5ff
fix: close identity menu when clicking list items
plyr4 Feb 29, 2024
48d5c5a
fix: put source repos link in org layout
plyr4 Feb 29, 2024
6959182
test(contextual help): update cli command to pass
KellyMerrick Feb 29, 2024
fc398a5
fix: secrets spacing, source repos focus, default enabled events, min…
plyr4 Feb 29, 2024
f0a9f41
fix: enable repo bug, set active to true
plyr4 Feb 29, 2024
19eebe5
tweak: move delete events back to the bottom
plyr4 Feb 29, 2024
e399605
fix: added break word wrap to table names
plyr4 Feb 29, 2024
c42f397
fix: placeholder consistency
plyr4 Feb 29, 2024
44a3edf
refactor: fix buttons consistency, more verbose button text, various …
plyr4 Mar 4, 2024
f77bfc8
feat: add terminal logging to task callback for a11y tests
plyr4 Mar 4, 2024
07b3372
tweak: increase a11y test timeout
plyr4 Mar 4, 2024
74d8c08
tweak: increase a11y test timeout
plyr4 Mar 4, 2024
f823f81
fix: test content and violation callback cleanup
plyr4 Mar 4, 2024
842cabb
fix: form style consistency, schedule allow event
plyr4 Mar 4, 2024
c02147f
fix: backport approved builds PR769
plyr4 Mar 4, 2024
75455af
fix: cypress test for Confirm Disable text
plyr4 Mar 4, 2024
bea0f86
Merge branch 'refactor/elm-rebuild-tweaks' of github.com:go-vela/ui i…
plyr4 Mar 4, 2024
0a63810
chore: merge with main
plyr4 Mar 4, 2024
6510cdc
fix: prev next pagination labels for org repos
plyr4 Mar 4, 2024
4fdc7a6
enhance: allow hiding build header and paginators
plyr4 Mar 4, 2024
297ba3b
fix: remove button padding
plyr4 Mar 4, 2024
9be1f08
fix: pagination and event filter experience for zero builds
plyr4 Mar 4, 2024
b5cd214
chore: toasty consistency non-settings pages
plyr4 Mar 5, 2024
b1f3778
docs(Components): adding comments and periods
KellyMerrick Mar 5, 2024
342f3a4
docs(Components): adding comments and periods
KellyMerrick Mar 5, 2024
5b00e87
chore: toasty consistency on settings pages
plyr4 Mar 5, 2024
03bde7a
Merge branch 'refactor/elm-rebuild' of github.com:go-vela/ui into ref…
plyr4 Mar 5, 2024
18ac31f
fix: hide repo settings update buttons when no input has been provided
plyr4 Mar 5, 2024
bc74ec4
fix: updating hardcoded test strings
plyr4 Mar 5, 2024
3ebb155
fix: cypress test tweaks for source repos and enable all
plyr4 Mar 5, 2024
3ce94bb
Merge branch 'main' into refactor/elm-rebuild
plyr4 Mar 5, 2024
2bf031e
enhance: add showAlert predicate for http errors, and skip 401 alerts…
plyr4 Mar 6, 2024
3b6e70d
Merge branch 'refactor/elm-rebuild' of github.com:go-vela/ui into ref…
plyr4 Mar 6, 2024
ab1c65e
fix: lint
plyr4 Mar 6, 2024
d53001b
fix: output timeout, not limit
plyr4 Mar 6, 2024
3e8c0e8
tweak: use prev next labels for secrets tables
plyr4 Mar 6, 2024
4cbe96d
fix: org specific no builds header
plyr4 Mar 6, 2024
037c379
docs(Pages): adding comments and periods
KellyMerrick Mar 11, 2024
612ae82
docs(Components): reverting comments to move to another branch
KellyMerrick Mar 11, 2024
60e38e8
Merge branch 'refactor/elm-rebuild' of github.com:go-vela/ui into ref…
KellyMerrick Mar 11, 2024
4a355a9
docs(Components): adding comments and periods
KellyMerrick Mar 11, 2024
5cc0870
docs(various): adding comments
KellyMerrick Mar 27, 2024
c541439
chore: merge in main
KellyMerrick Mar 29, 2024
698eac0
Merge branch 'main' into refactor/elm-rebuild_comments
KellyMerrick Mar 29, 2024
f7d4b88
chore: merge cypress from main
KellyMerrick Mar 29, 2024
0627737
Merge branch 'refactor/elm-rebuild_comments' of github.com:go-vela/ui…
KellyMerrick Mar 29, 2024
846c3b4
docs(various): adding comments
KellyMerrick Apr 3, 2024
9d30027
Merge branch 'main' of github.com:go-vela/ui into refactor/elm-rebuil…
KellyMerrick Apr 3, 2024
3e717d7
Merge branch 'main' into refactor/elm-rebuild_comments
KellyMerrick Apr 3, 2024
6bc3721
docs(various): mostly punctuation, few missed comments
KellyMerrick Apr 3, 2024
cf7f957
Merge branch 'refactor/elm-rebuild_comments' of github.com:go-vela/ui…
KellyMerrick Apr 3, 2024
abf56ec
Merge branch 'main' into refactor/elm-rebuild_comments
KellyMerrick Apr 8, 2024
cfb2783
Merge branch 'main' of github.com:go-vela/ui into refactor/elm-rebuil…
KellyMerrick Apr 8, 2024
dea3d62
docs(various): addressing some feedback, and other minor tweaks
KellyMerrick Apr 9, 2024
8d49d08
Merge branch 'refactor/elm-rebuild_comments' of github.com:go-vela/ui…
KellyMerrick Apr 9, 2024
6f87f3f
docs(various): addressing some feedback.
KellyMerrick Apr 10, 2024
bc32409
docs(various): comment clarification.
KellyMerrick Apr 10, 2024
53d5e28
docs(various): comment clarification.
KellyMerrick Apr 10, 2024
8b51170
Merge branch 'main' into refactor/elm-rebuild_comments
KellyMerrick Apr 15, 2024
ec77937
Merge branch 'main' of github.com:go-vela/ui into refactor/elm-rebuil…
KellyMerrick Apr 15, 2024
40c34a8
Merge branch 'main' into refactor/elm-rebuild_comments
KellyMerrick Apr 26, 2024
7f791f8
Merge branch 'main' into refactor/elm-rebuild_comments
KellyMerrick May 8, 2024
892fb5a
Merge branch 'refactor/elm-rebuild_comments' of github.com:go-vela/ui…
KellyMerrick May 8, 2024
93549c7
docs(Loading.elm): small clarification.
KellyMerrick May 8, 2024
ff4b455
docs(Loading.elm): correct the correct thing.
KellyMerrick May 8, 2024
527d285
Update src/elm/Components/Build.elm
KellyMerrick May 8, 2024
cf26480
Update src/elm/Components/Search.elm
KellyMerrick May 8, 2024
ce1ca86
Update src/elm/Pages/Org_/Repo_/Build_/Pipeline.elm
KellyMerrick May 8, 2024
6e1556e
Update src/elm/Components/Util.elm
KellyMerrick May 8, 2024
7430612
docs(various): address feedback
KellyMerrick May 8, 2024
8f9f683
Merge branch 'refactor/elm-rebuild_comments' of github.com:go-vela/ui…
KellyMerrick May 8, 2024
b09c9d2
docs(Route): removing comments
KellyMerrick May 8, 2024
aafbb9c
Update src/elm/Pages/Org_/Builds.elm
KellyMerrick May 8, 2024
4635074
Update src/elm/Pages/Org_.elm
KellyMerrick May 8, 2024
6fc0b29
docs(Main/Pages): removing comments
KellyMerrick May 8, 2024
aaf55fa
Merge branch 'main' into refactor/elm-rebuild_comments
plyr4 May 10, 2024
0826542
fix: elm-format
plyr4 May 10, 2024
7e9d01d
fix: merge with main
plyr4 May 10, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions src/elm/Api/Api.elm
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import Task exposing (Task)
-- TYPES


{-| RequestConfig : a basic configuration record for an API request
{-| RequestConfig : basic configuration record for an API request.
-}
type alias RequestConfig a =
{ method : String
Expand All @@ -40,13 +40,13 @@ type alias RequestConfig a =
}


{-| Request : wraps a configuration for an API request
{-| Request : wraps a configuration for an API request.
-}
type Request a
= Request (RequestConfig a)


{-| ListResponse : a custom response type to be used in conjunction
{-| ListResponse : custom response type to be used in conjunction
with API pagination response headers to discern between
a response that has more pages to fetch vs a response that has
no further pages.
Expand All @@ -60,14 +60,14 @@ type ListResponse a
-- HELPERS


{-| request : turn a request configuration into a request
{-| request : turn a request configuration into a request.
-}
request : RequestConfig a -> Request a
request =
Request


{-| toTask : turn a request config into an HTTP task
{-| toTask : turn a request config into an HTTP task.
-}
toTask : Request a -> Task (Http.Detailed.Error String) ( Http.Metadata, a )
toTask (Request config) =
Expand All @@ -81,7 +81,7 @@ toTask (Request config) =
}


{-| toStringTask : turn a request config into an HTTP task
{-| toStringTask : turn a request config into an HTTP task.
-}
toStringTask : Request String -> Task (Http.Detailed.Error String) ( Http.Metadata, String )
toStringTask (Request config) =
Expand All @@ -95,7 +95,7 @@ toStringTask (Request config) =
}


{-| toAllTask : like _toTask_ but attaches a custom resolver to use in conjunction with _tryAll_
{-| toAllTask : like _toTask_ but attaches a custom resolver to use in conjunction with _tryAll_.
-}
toAllTask : Request a -> Task (Http.Detailed.Error String) ( Http.Metadata, ListResponse a )
toAllTask (Request config) =
Expand All @@ -109,14 +109,14 @@ toAllTask (Request config) =
}


{-| listResponseToList : small helper that forwards the inital HTTP task to the recurse function
{-| listResponseToList : small helper that forwards the inital HTTP task to the recurse function.
-}
listResponseToList : Task (Http.Detailed.Error String) ( Http.Metadata, ListResponse a ) -> Task (Http.Detailed.Error String) ( Http.Metadata, List a )
listResponseToList task =
task |> recurse


{-| listResponseResolver : turns a response from an HTTP request into a 'ListResponse' response
{-| listResponseResolver : turns a response from an HTTP request into a 'ListResponse' response.
-}
listResponseResolver : RequestConfig a -> Http.Response String -> Result (Http.Detailed.Error String) ( Http.Metadata, ListResponse a )
listResponseResolver config response =
Expand Down Expand Up @@ -152,7 +152,7 @@ listResponseResolver config response =
Err (Http.Detailed.BadStatus m b)


{-| recurse : keeps firing off HTTP tasks if the response is of type Partial
{-| recurse : keeps firing off HTTP tasks if the response is of type Partial.

Thanks to "https://github.com/correl/elm-paginated" for the inspiration

Expand All @@ -173,7 +173,7 @@ recurse originalRequest =
)


{-| update: aggregates the results from two responses as needed
{-| update : aggregates the results from two responses as needed.
-}
update : ( Http.Metadata, ListResponse a ) -> ( Http.Metadata, ListResponse a ) -> ( Http.Metadata, ListResponse a )
update old new =
Expand All @@ -188,7 +188,7 @@ update old new =
( meta, Partial request_ (oldItems ++ newItems) )


{-| withAuth : returns an auth header with given Bearer token
{-| withAuth : returns an auth header with given Bearer token.
-}
withAuth : Session -> Request a -> Request a
withAuth session (Request config) =
Expand All @@ -209,7 +209,7 @@ withAuth session (Request config) =
-- METHODS


{-| get : creates a GET request configuration
{-| get : creates a GET request configuration.
-}
get : String -> Endpoint -> Decoder b -> Request b
get api endpoint decoder =
Expand All @@ -222,7 +222,7 @@ get api endpoint decoder =
}


{-| post : creates a POST request configuration
{-| post : creates a POST request configuration.
-}
post : String -> Endpoint -> Http.Body -> Decoder b -> Request b
post api endpoint body decoder =
Expand All @@ -235,7 +235,7 @@ post api endpoint body decoder =
}


{-| put : creates a PUT request configuration
{-| put : creates a PUT request configuration.
-}
put : String -> Endpoint -> Http.Body -> Decoder b -> Request b
put api endpoint body decoder =
Expand All @@ -248,7 +248,7 @@ put api endpoint body decoder =
}


{-| delete : creates a DELETE request configuration
{-| delete : creates a DELETE request configuration.
-}
delete : String -> Endpoint -> Decoder b -> Request b
delete api endpoint decoder =
Expand All @@ -261,7 +261,7 @@ delete api endpoint decoder =
}


{-| patch : creates a PATCH request configuration
{-| patch : creates a PATCH request configuration.
-}
patch : String -> Endpoint -> Decoder b -> Request b
patch api endpoint decoder =
Expand All @@ -278,7 +278,7 @@ patch api endpoint decoder =
-- ENTRYPOINT


{-| try : default way to request information from an endpoint
{-| try : default way to request information from an endpoint.

example usage:
Api.try UserResponse <| Api.getUser model authParams
Expand All @@ -290,7 +290,7 @@ try msg request_ =
|> Task.attempt msg


{-| tryAll : will attempt to get all results for the endpoint based on pagination
{-| tryAll : will attempt to get all results for the endpoint based on pagination.

example usage:
Api.tryAll RepositoriesResponse <| Api.getAllRepositories model
Expand All @@ -303,7 +303,7 @@ tryAll msg request_ =
|> Task.attempt msg


{-| tryString : way to request information from an endpoint with a string response
{-| tryString : way to request information from an endpoint with a string response.

example usage:
Api.tryString UserResponse <| Api.getUser model authParams
Expand Down
8 changes: 4 additions & 4 deletions src/elm/Api/Endpoint.elm
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ import Url.Builder as UB exposing (QueryParameter)
import Vela


{-| apiBase : is the versioned base of all API paths
{-| apiBase : the versioned base of all API paths.
-}
apiBase : String
apiBase =
"api/v1"


{-| Endpoint : represents any one unique API endpoint
{-| Endpoint : represents any one unique API endpoint.
-}
type Endpoint
= Authenticate Auth.Session.AuthParams
Expand Down Expand Up @@ -55,7 +55,7 @@ type Endpoint
| PipelineTemplates Vela.Org Vela.Repo Vela.Ref


{-| toUrl : turns and Endpoint into a URL string
{-| toUrl : turns and Endpoint into a URL string.
-}
toUrl : String -> Endpoint -> String
toUrl api endpoint =
Expand Down Expand Up @@ -162,7 +162,7 @@ toUrl api endpoint =
url api [ "deployments", org, repo ] <| Pagination.toQueryParams maybePage maybePerPage


{-| url : creates a URL string with the given path segments and query parameters
{-| url : creates a URL string with the given path segments and query parameters.
-}
url : String -> List String -> List QueryParameter -> String
url api segments params =
Expand Down
2 changes: 1 addition & 1 deletion src/elm/Api/Header.elm
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module Api.Header exposing (get)
import Dict exposing (Dict)


{-| get : looks for the specified header key and returns the value
{-| get : looks for the specified header key and returns the value.

we lower case they keys because different browsers may return them in diff cases

Expand Down
Loading
Loading