-
Notifications
You must be signed in to change notification settings - Fork 77
Request config rather than importing it #988
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
44e0604
Request config rather than importing it
matthew-white a5c5399
Merge branch 'master' into request-config
matthew-white a3ce15f
Fall back to defaults if client-config.json is invalid
matthew-white 26ca541
Add loaded property to config
matthew-white 6808230
Make small changes
matthew-white 480856f
More small changes
matthew-white File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| <!-- | ||
| Copyright 2024 ODK Central Developers | ||
| See the NOTICE file at the top-level directory of this distribution and at | ||
| https://github.com/getodk/central-frontend/blob/master/NOTICE. | ||
|
|
||
| This file is part of ODK Central. It is subject to the license terms in | ||
| the LICENSE file found in the top-level directory of this distribution and at | ||
| https://www.apache.org/licenses/LICENSE-2.0. No part of ODK Central, | ||
| including this file, may be copied, modified, propagated, or distributed | ||
| except according to the terms contained in the LICENSE file. | ||
| --> | ||
| <template> | ||
| <div id="config-error" class="row"> | ||
| <div class="col-xs-12 col-sm-offset-3 col-sm-6"> | ||
| <div class="panel panel-default panel-main"> | ||
| <div class="panel-heading"> | ||
| <h1 class="panel-title">{{ $t('title') }}</h1> | ||
| </div> | ||
| <div class="panel-body"> | ||
| <p> | ||
| <span>{{ $t('body') }}</span> | ||
| <sentence-separator/> | ||
| <span>{{ loadError }}</span> | ||
| </p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </template> | ||
|
|
||
| <script setup> | ||
| import { F } from 'ramda'; | ||
| import { computed, inject } from 'vue'; | ||
| import { onBeforeRouteLeave } from 'vue-router'; | ||
|
|
||
| import SentenceSeparator from './sentence-separator.vue'; | ||
|
|
||
| import { requestAlertMessage } from '../util/request'; | ||
|
|
||
| defineOptions({ | ||
| name: 'ConfigError' | ||
| }); | ||
|
|
||
| // Since there was an error loading the config, we don't know how to render | ||
| // important parts of the app. For example, we don't know config.oidcEnabled, so | ||
| // we don't know how to render the login page. Here, we prevent the user from | ||
| // navigating to elsewhere in the app. | ||
| onBeforeRouteLeave(F); | ||
|
|
||
| const { i18n, config } = inject('container'); | ||
| const loadError = computed(() => requestAlertMessage(i18n, config.loadError)); | ||
| </script> | ||
|
|
||
| <i18n lang="json5"> | ||
| { | ||
| "en": { | ||
| // This is the title at the top of a panel. | ||
| "title": "Error Loading Central", | ||
| "body": "There was an error loading Central." | ||
| } | ||
| } | ||
| </i18n> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.