Skip to content

Commit dafb96e

Browse files
committed
feat: add update_grid_view_col()
1 parent 500a6bf commit dafb96e

13 files changed

+138
-1
lines changed

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export(update_base)
6767
export(update_base_ui_acl)
6868
export(update_base_user)
6969
export(update_data_src)
70+
export(update_grid_view_col)
7071
export(update_integration)
7172
export(update_plugin)
7273
export(update_tbl)

R/nocodb.gen.R

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2335,6 +2335,39 @@ update_tbl_view_col <- function(id_view_col,
23352335
invisible(id_view_col)
23362336
}
23372337

2338+
#' Update NocoDB grid view column
2339+
#'
2340+
#' Updates the metadata of the specified grid view column on a NocoDB server via its
2341+
#' [`PATCH /api/v2/meta/grid-columns/{id_view_col}`](https://meta-apis-v2.nocodb.com/#tag/Views/operation/db-view-grid-column-update) API endpoint.
2342+
#'
2343+
#' @inheritParams update_tbl_view_col
2344+
#' @param order `r pkgsnip::type("int", 1L)`
2345+
#' A number to assign as the grid view columns's UI order "weight".
2346+
#'
2347+
#' @returns `id_view_col`, invisibly.
2348+
#' @family views
2349+
#' @export
2350+
update_grid_view_col <- function(id_view_col,
2351+
order = NULL,
2352+
origin = funky::config_val("origin"),
2353+
email = funky::config_val("email"),
2354+
password = funky::config_val("password"),
2355+
api_token = funky::config_val("api_token")) {
2356+
2357+
checkmate::assert_number(order,
2358+
null.ok = TRUE)
2359+
2360+
api(path = glue::glue("api/v2/meta/grid-columns/{id_view_col}"),
2361+
method = "PATCH",
2362+
origin = origin,
2363+
email = email,
2364+
password = password,
2365+
api_token = api_token,
2366+
body_json = purrr::compact(list(order = order)))
2367+
2368+
invisible(id_view_col)
2369+
}
2370+
23382371
#' List NocoDB table columns
23392372
#'
23402373
#' Returns a [tibble][tibble::tbl_df] with metadata about the columns of the specified table on a NocoDB server from its

Rmd/nocodb.Rmd

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2754,6 +2754,45 @@ update_tbl_view_col <- function(id_view_col,
27542754
}
27552755
```
27562756

2757+
### Grid views
2758+
2759+
#### `update_grid_view_col`
2760+
2761+
```{r}
2762+
#' Update NocoDB grid view column
2763+
#'
2764+
#' Updates the metadata of the specified grid view column on a NocoDB server via its
2765+
#' [`PATCH /api/v2/meta/grid-columns/{id_view_col}`](https://meta-apis-v2.nocodb.com/#tag/Views/operation/db-view-grid-column-update) API endpoint.
2766+
#'
2767+
#' @inheritParams update_tbl_view_col
2768+
#' @param order `r pkgsnip::type("int", 1L)`
2769+
#' A number to assign as the grid view columns's UI order "weight".
2770+
#'
2771+
#' @returns `id_view_col`, invisibly.
2772+
#' @family views
2773+
#' @export
2774+
update_grid_view_col <- function(id_view_col,
2775+
order = NULL,
2776+
origin = funky::config_val("origin"),
2777+
email = funky::config_val("email"),
2778+
password = funky::config_val("password"),
2779+
api_token = funky::config_val("api_token")) {
2780+
2781+
checkmate::assert_number(order,
2782+
null.ok = TRUE)
2783+
2784+
api(path = glue::glue("api/v2/meta/grid-columns/{id_view_col}"),
2785+
method = "PATCH",
2786+
origin = origin,
2787+
email = email,
2788+
password = password,
2789+
api_token = api_token,
2790+
body_json = purrr::compact(list(order = order)))
2791+
2792+
invisible(id_view_col)
2793+
}
2794+
```
2795+
27572796
### Table columns
27582797

27592798
#### DESCRIPTION

man/base_ui_acl.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/tbl_view_col_id.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/tbl_view_cols.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/tbl_view_id.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/tbl_views.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/update_base_ui_acl.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/update_grid_view_col.Rd

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/update_tbl_col.Rd

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/update_tbl_view_col.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgdown/_pkgdown.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ reference:
6464
- tbl_view_cols
6565
- tbl_view_col_id
6666
- update_tbl_view_col
67+
- subtitle: Grid views
68+
- contents: update_grid_view_col
6769
- subtitle: Table columns
6870
desc: Functions to manage NocoDB table [columns](https://docs.nocodb.com/category/fields)
6971
(aka "fields").

0 commit comments

Comments
 (0)