Skip to content

Commit 24acbb9

Browse files
authored
prefer admin integrations (#143)
1 parent 0c686ab commit 24acbb9

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

extensions/usage-metrics-dashboard/app.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,10 @@ server <- function(input, output, session) {
305305
),
306306
error = function(e) {
307307
eligible_integrations <- get_eligible_integrations(publisher_client)
308-
selected_integration <- slice_head(eligible_integrations, n = 1)
308+
selected_integration <- eligible_integrations |>
309+
# Sort "max_role: Admin" before "max_role: Publisher"
310+
arrange(config) |>
311+
slice_head(n = 1)
309312
selected_integration_guid(selected_integration$guid)
310313

311314
if (nrow(selected_integration) == 1) {

extensions/usage-metrics-dashboard/integrations.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ get_eligible_integrations <- function(client) {
2929
filter(
3030
template == "connect",
3131
config %in% c("max_role: Admin", "max_role: Publisher")
32-
) |>
33-
arrange(desc(config))
32+
)
3433
},
3534
error = function(e) {
3635
data.frame()

extensions/usage-metrics-dashboard/manifest.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3056,13 +3056,13 @@
30563056
},
30573057
"files": {
30583058
"app.R": {
3059-
"checksum": "b081afeb045c9d70aef99391cc909ce4"
3059+
"checksum": "3e1f1e08ecddcac01fd26b112a84dc04"
30603060
},
30613061
"get_usage.R": {
30623062
"checksum": "ac5b526efed72f1c34786620ca2ddacd"
30633063
},
30643064
"integrations.R": {
3065-
"checksum": "069b072123263b40775ab4f819eb26fc"
3065+
"checksum": "2b495c74b5987a2c318bcd80a0c2be8f"
30663066
},
30673067
"www/styles.css": {
30683068
"checksum": "96b6068bd63e5daf1f938bfb854fd849"
@@ -3079,7 +3079,7 @@
30793079
"requiredFeatures": [
30803080
"OAuth Integrations"
30813081
],
3082-
"version": "1.0.0"
3082+
"version": "1.0.1"
30833083
},
30843084
"environment": {
30853085
"r": {

0 commit comments

Comments
 (0)