-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10654 from codyrancher/plugin-simplification
Factoring plugin installation out of index.js.
- Loading branch information
Showing
3 changed files
with
55 additions
and
96 deletions.
There are no files selected for viewing
This file contains 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 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,39 @@ | ||
import '@shell/plugins/extend-router'; | ||
import '@shell/plugins/formatters'; | ||
import '@shell/plugins/global-formatters'; | ||
import '@shell/plugins/i18n'; | ||
import '@shell/plugins/js-yaml'; | ||
import '@shell/plugins/portal-vue.js'; | ||
import '@shell/plugins/resize'; | ||
import '@shell/plugins/shortkey'; | ||
import '@shell/plugins/tooltip'; | ||
import '@shell/plugins/trim-whitespace'; | ||
import '@shell/plugins/v-select'; | ||
|
||
import axios from '../utils/axios.js'; | ||
import axiosShell from '@shell/plugins/axios'; | ||
import backButton from '@shell/plugins/back-button'; | ||
import codeMirror from '@shell/plugins/codemirror-loader'; | ||
import cookieUniversalNuxt from '../utils/cookie-universal-nuxt.js'; | ||
import * as intNumber from '@shell/plugins/int-number'; | ||
import nuxtClientInit from '@shell/plugins/nuxt-client-init'; | ||
import plugin from '@shell/plugins/plugin'; | ||
import plugins from '@shell/core/plugins.js'; | ||
import pluginsLoader from '../core/plugins-loader.js'; | ||
import * as positiveIntNumber from '@shell/plugins/positive-int-number.js'; | ||
import replaceAll from '@shell/plugins/replaceall'; | ||
import steveCreateWorker from '@shell/plugins/steve-create-worker'; | ||
import version from '@shell/plugins/version'; | ||
import emberCookie from '@shell/plugins/ember-cookie'; | ||
|
||
export async function installPlugins(app, inject) { | ||
const pluginDefinitions = [cookieUniversalNuxt, axios, plugins, pluginsLoader, axiosShell, intNumber, positiveIntNumber, nuxtClientInit, replaceAll, backButton, plugin, codeMirror, version, steveCreateWorker, emberCookie]; | ||
|
||
const installations = pluginDefinitions.map(async(pluginDefinition) => { | ||
if (typeof pluginDefinition === 'function') { | ||
await pluginDefinition(app.context, inject); | ||
} | ||
}); | ||
|
||
await Promise.all(installations); | ||
} |
This file contains 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,13 @@ | ||
import { REDIRECTED } from '@shell/config/cookies'; | ||
|
||
export default function({ $cookies }) { | ||
// This tells Ember not to redirect back to us once you've already been to dashboard once. | ||
// TODO: Remove this once the ember portion of the app is no longer needed | ||
if ( !$cookies.get(REDIRECTED) ) { | ||
$cookies.set(REDIRECTED, 'true', { | ||
path: '/', | ||
sameSite: true, | ||
secure: true, | ||
}); | ||
} | ||
} |