From dd8147497188662355dfa873218506e206a9024e Mon Sep 17 00:00:00 2001 From: Nick Coutsos Date: Sat, 30 Oct 2021 11:09:42 -0400 Subject: Show a message when user has installed app for multiple repos --- application/components/app.vue | 77 +++++++++++++++++++++++---------- application/components/modal.vue | 7 ++- application/components/value-picker.vue | 2 +- application/github.js | 4 +- 4 files changed, 64 insertions(+), 26 deletions(-) diff --git a/application/components/app.vue b/application/components/app.vue index eb0d942..a4573f4 100644 --- a/application/components/app.vue +++ b/application/components/app.vue @@ -3,6 +3,7 @@ import keyBy from 'lodash/keyBy' import Keymap from './keymap.vue' import Loader from './loader.vue' +import Modal from './modal.vue' import * as config from '../config' import * as github from '../github' @@ -15,7 +16,8 @@ import { loadKeycodes } from '../keycodes' export default { components: { keymap: Keymap, - Loader + Loader, + Modal }, provide() { return { @@ -32,6 +34,7 @@ export default { indexedKeycodes: {}, behaviours: [], indexedBehaviours: {}, + tooManyRepos: false, keymap: {}, layout: [], layers: [], @@ -47,6 +50,10 @@ export default { methods: { async loadData() { await github.init() + if (config.enableGitHub && github.isGitHubAuthorized() && github.repositories.length > 1) { + this.tooManyRepos = true + return + } const loadKeyboardData = async () => { if (config.enableGitHub && github.isGitHubAuthorized()) { return github.fetchLayoutAndKeymap() @@ -104,6 +111,10 @@ export default { body: JSON.stringify(this.keymap) }) }, + getInstallationUrl() { + console.log(github.installation, github.repositories, github) + return `https://github.com/settings/installations/${github.installation.id}` + }, async doReadyCheck() { await healthcheck() await this.loadData() @@ -114,28 +125,43 @@ export default { @@ -152,4 +178,11 @@ button { margin: 2px; } +.dialog { + background-color: white; + padding: 40px; + margin: 40px; + max-width: 500px; +} + diff --git a/application/components/modal.vue b/application/components/modal.vue index 2eb5bf3..1f0ca3c 100644 --- a/application/components/modal.vue +++ b/application/components/modal.vue @@ -8,7 +8,9 @@ export default { @@ -24,4 +26,7 @@ export default { justify-content: center; align-items: center; } +.content { + display: block; +} \ No newline at end of file diff --git a/application/components/value-picker.vue b/application/components/value-picker.vue index fca91f7..e4fdf52 100644 --- a/application/components/value-picker.vue +++ b/application/components/value-picker.vue @@ -141,7 +141,7 @@ export default { -