Commit Graph

58 Commits

Author SHA1 Message Date
Neil MacDougall 1e18d03f4c
Add support for modifying doc links and add support for different links for Rancher Prime (#13020)
* Add support for different doc links

* Adding missing e2e test tags

* Auth page not accessible to standard user (admin tests seem sufficient)

* Ensure types are generated for version file

* Update doc links

* Update to remove plugin remove for builtin extensions

* Change the plugin load status back to how it was

* Fix i18n issue

* Fix translation load for built-in extensions
2025-02-07 10:38:41 +00:00
Phillip Rak f8ee34426c Clean up `appConfig` param in `vue.config`
The prefix `_` is a convention to indicate that a parameter is expected, but unused within a function. We make use of `appConfig` in the default export, so we can remove the `_` and supply a default value for `appConfig` if nothing is passed.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-01-10 10:59:55 -07:00
Phillip Rak 36e7f23102 Allow HMR in Rancher Components and Harvester
This allows HMR to trigger when changes are made to Rancher Components and Harvester by omitting the `excludes` argument from `getWatcherIgnored()`. Watch and WatchOptions work to allow Webpack to watch files and recompile whenever they change - I don't see any benefit in excluding Rancher Components and Harvester from this process by default.

As I understand, the `excludes` variable exists to control production builds; this change will only affect development.

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2025-01-10 10:59:55 -07:00
Francesco Torchia 5fa5abfd07
Merge pull request #12716 from torchiaf/fix-hot-reload
Include `harvester-manager` in hot-reload watchOptions
2024-11-29 10:47:19 +01:00
Francesco Torchia 81e04190ed
Fix package exclude Regex
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2024-11-29 10:19:21 +01:00
Giuseppe Leo a822b7a5bf
Some Storybook components do not render correctly after migration (#12594)
* Remove install as storybook start script

* Install Storybook8 with Webpack5

* Correct issue in importing a node style within the SCSS instead of vue config

* Add existing configuration for Webpack

* Convert first component to SFC/MDX new model

* Add remaining plugins, directives and components

* Correct store import in the Rancher Dashboard way

* Complete input migration

* Add buttons

* Correct assets import

* Move foundation

* Fix path for assets import

* Move example assets within the folder

* Migrate Form

* Move first components

* Migrate to proper file naming

* Remove visual tests

* Migrate components

* Remove title for Labeled Select

* Add welcome page

* Bump Storybook to 8.4.2 with auto migration script

* Add MDX support for tables

* Add iframe for rancher icons

* Rename component as modal to avoid confusion

* Enable themes and custom Rancher theme

* Correct  MDX markdown errors

* Correct i18n import

* ESLint fiuxes

* Change import of debounce from lodash

* Code cleanup

* Remove unnecessary import about Code Mirror

* Replace old storybook

* Add decorator for Vue routing and fix hash issues for the tabs

* Change Webpack configuration to declarative format

* Add ToC to the documentation

* Fix linting issue
2024-11-29 09:46:58 +01:00
Silvio Moioli b06d3a909f
Avoid embedding web-worker polyfill
The BLOB code from web-worker is minified, and contains source maps that are then
passed over by webpack - that creates a situation of minified code inside BLOB
inside minified code which confuses some tools, eg.

https://github.com/jantimon/chrome-profile-sourcemap-resolver/pull/4

That could be fixed, but the only reason to do so would be supporting very old
(pre-2013) browsers, so we are better off removing the polyfill altogether.

Signed-off-by: Silvio Moioli <silvio@moioli.net>
2024-11-15 10:31:34 +01:00
Phillip Rak a70299555b Remove tests from build artifacts
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-10-11 13:53:40 -07:00
Alexandre Alves 1b7fb19e1e address pr comments 2024-10-01 15:55:05 +01:00
Alexandre Alves bc51a79005 apply some fixes for extensions logic in light of Vue3 migration 2024-09-30 18:11:13 +01:00
Giuseppe Leo 3fae34cc92
Restore vueconfig cleanup with Vue3 migration fixes (#11774)
* Restore vueconfig cleanup with Vue3 migration fixes

* Fix aliases for vue

* Destructure helper import to avoid duplication

* Fix linting issues
2024-09-05 18:03:19 +02:00
Cody Jackson d47ce13f28 Fixed the remaining lint warnings and errors
The chart.test.ts is likely more broken now than it was. This can be fixed later.
2024-08-22 16:07:04 -07:00
Cody Jackson 1c67ceb6da Fixing a couple conflicts after rebasing from master 2024-08-22 16:07:04 -07:00
Cody Jackson 8aca7ed4fa Adding a fix to HMR/live reload 2024-08-22 16:07:04 -07:00
Phillip Rak aed3f3589c Resolve WS connection issues
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-08-22 16:07:03 -07:00
Phillip Rak 5df18d70f8 Resolve webpack deprecation warnings in `vue.config`
Resolves the following warnings

```
(node:212316) [DEP_WEBPACK_DEV_SERVER_HTTPS] DeprecationWarning: 'https' option is deprecated. Please use the 'server' option.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:212316) [DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning: 'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
```

Webpack documentation provides enough information for refactoring to use `setupMiddlewares`

https://webpack.js.org/configuration/dev-server/#devserversetupmiddlewares

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-08-22 16:07:03 -07:00
Cody Jackson adf49ed167 Fixing a vue cli warning where we were setting process.env.NODE_ENV more than once with DefinePlugin()
It appears to be an update in webpack 4 which we can disable with config.optimization.nodeEnv
2024-08-22 16:05:36 -07:00
Cody Jackson 50f117f25a Fixing issues around referencing server and app
This was noticed in the CLI when running Ctrl + C to exit the server process
2024-08-22 16:05:36 -07:00
Phillip Rak 3f4a360dcb Revert `./shell/vue.config.js`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-08-22 16:05:36 -07:00
Giuseppe Leo a2304f462e
Remove or replace all the @nuxt libraries (#11302)
* Update checkout to v4 and bump Node to 16

* Update GHA workflow migration paths

* Removed named exports from Vue files

* Move code outside of the Vue app element

* Remove @nuxtjs/eslint-config-typescript

* Remove @nuxt/types and @nuxt/typescript-build

* Fix import issue with http-proxy-middleware

* Replace @nuxtjs/axios with axios and axios-retry

* Remove @nuxtjs/webpack-profile

* Fix linting issues after Nuxt webpack removal

* Pin resolution for glob after rebase

* Update yarn.lock after rebase

* Fix issue with rancher-components

* Bump rancher-component GHA config to match rebase changes

* Generate yarn file

* Add dependency

* Remove nuxt global var in app template

* Pin version for babel/plugin-proposal-private-methods
2024-08-08 15:31:44 +02:00
Giuseppe Leo d98ca6bd85
Remove Nuxt reference in extensions and creator (#11420)
* Remove nuxt commands

* Remove vsconfig nuxt mention

* Remove Nuxt path as unused

* Remove Nuxt

* Remove creator scripts

* Remove all the nuxt and nuxt.config references

* Restore existing comment about Nuxt

* Add dependency for check-plugin

* Add more missing dependencies

* Update to comments

* Correct comment based on PR review
2024-08-07 18:42:08 +02:00
Phillip Rak d4e89c2bdd Remove @nuxt/babel-preset-app
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-07-12 09:55:54 -07:00
Alexandre Alves 0092617300
improve shell api gating (#11164)
* improve shell api gating

* update logic

* minor update

* populate extensions API version as latest shell version

* remove semver dependency on creators/pkg

* update script

* change

* change

* add default shell API version if there is no annotation in the metadata for gating it

* remove default for shell API in uiplugins + fix creators/pkg init script to read shell version from node_modules

* add mechanism to prevent shell pkg folder check for creators/pkg in our pipelines

* cleanup comment

* bump shell version on master
2024-07-01 13:58:08 +01:00
Giuseppe Leo 43ef5fc390
Clean up entry logic for vue.config (#11048)
* Cleanup entry for vue configuration

Rename reserved function terms

Correct extendApp initialization by passing Vue attribute

Avoid reserved name Vue

Set more unique and meaningful file names

Remove deprecated code added with rebase

Add vue instance to mountApp

Add comments and references to TODO issue

Restore function declaration over binding issue

Rename apps and correct issue with the render

Rebase residual cleanup

Remove unnecessary env var related to Nuxt

Remove deprecated confit assignment

Revert render function refactoring

* Fix Dashboard version issue
2024-05-29 11:09:43 +02:00
Giuseppe Leo 6bc0fb5b25
Vue config cleanup (#11005)
* Split vue config and replace simpler code parts

* Correct typos, comments and imports

* linting fixes

* Correct suggestions
2024-05-14 19:03:41 +02:00
Phillip Rak 30179c2f57 Remove `babelPlugins`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-03-20 14:48:37 -07:00
Phillip Rak 28bd7b5ae6 Remove `SHELL`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-03-20 14:48:37 -07:00
Phillip Rak 583e267fea Remove `server-middleware` variable from `vue.config`
Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-03-20 14:48:37 -07:00
Phillip Rak 81f1fbc6c7 Target UMD runtime for extensions
This explicitly targets `node_modules/vue/dist/vue.js` to ensure that Dashboard is always exposing the UMD builds of Vue to the `window` object (`shell/core/plugins-loader.js`). For more information on different builds that are available to us, see the vue documentation for explanation of different builds [^1]

[^1]: https://v2.vuejs.org/v2/guide/installation#Explanation-of-Different-Builds

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
2024-03-04 12:25:24 -07:00
Neil MacDougall c5f5c9b0cf
Add support for replaying network requests from a captured HAR file (#10149)
* Add support for replaying from har file

* Fix merge

* Improvements

* Add export and folder support

* Minor tidy ups

* Fix lint

* Add doc

* Update doc with correct fallback HTTP status code

* Fix typo
2023-12-20 16:39:00 +00:00
Alexandre Alves 6637583874
remove "process." mentions from Dashboard and adjust code (#10119)
* remove process.client and process.server mentions and adjust code

* fix a couple of missing conditions for process.server

* remove commented line

* remove process.static

* fix lint errors

* uncomment code

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MacBook-Pro.local>
2023-12-13 08:41:26 +00:00
Evgeniya Vashkevich e2149a4798
[INT] Removed vue-meta library (#9952)
* [INT] Removed vue-meta library
2023-12-05 09:42:23 -08:00
Richard Cox 68930d7820
Merge pull request #9543 from richard-cox/fix-error-in-prod
Fix white page errors in prod
2023-09-06 11:28:00 +01:00
Giuseppe Leo 479125264f
Vue files are not correctly instrumented by the tests (#7166)
* Remove merge to master on PR tests due coverage issue

* Update GI action versions from 2 to 3

* Re-enable HTMl coverage for tests

* Remove deprecated nyc in package configuration from merge conflict; Ignore further folders from coverage

* Change tests checkout and print changed files on test during coverage job

* Add codecov configuration

* Add coverage if instrumented

* Remove changed files steps

* Increase memory for unit test

* Add .vue extension to unit test instrumentation

Add .vue extension to unit test instrumentation

* Remove HTML coverage due 'file:' issue

* Remove HTML report and add .vue files

* Restore GHA fetch to 1 for last commit
2023-09-01 10:02:51 +02:00
Alexandre Alves a79cf12157
Recover proxy config mechanism (#9616)
* recover proxy config mechanism

* remove unwanted proxy config

---------

Co-authored-by: Alexandre Alves <aalves@Alexandres-MBP.lan>
2023-08-31 12:20:08 +01:00
Richard Cox 8aef0252fe Remove process.x webpack config, add comments 2023-08-31 11:11:11 +01:00
Richard Cox 7ec8626ee6 Fix white page errors in prod
- white page errors should not be visible in prod
- these were were enabled in all envs via the port of shell/initialize/client.js after nuxt
- that came from the output of a template
- the template has some features on via debug state when built
- we now disable these features in prod
- Additionally..
  - set some process values that were being skipped but still used
  - always log uncaught errors in `fetch`s. in theory we should be monitoring $fetchState.error but we never do. this has led to some painful debugging with customers
2023-08-15 16:08:51 +01:00
richa 141d277e71
Added router to rediect github auth (#9262)
* Added router to rediect github auth

* Added env variables for client id

* Fixed broken server Middleware

* Removed e2e changes

* Fixed lint

* Removed code for test

* Clean code
2023-07-14 16:35:51 +02:00
Richard Cox 0245a8cb93 Merge remote-tracking branch 'upstream/master' into epinio/resolve-conflicts-with-master 2023-06-23 18:00:14 +01:00
Giuseppe Leo 01eeb0548f
Add recommended lint rules globally (#8997)
* Update configuration

* Create default config for eslint

* Restore plugin:vue/recommended

* Add exceptions and overrides

* Correct manually remaining issues

* Adding further picked exceptions groupped up

* Fix or disable specific cases manually and singularly

* Add naming linting exception

* Remove unused variable in component

* Move rules to default

* Autocorrect rancher/components linting issues

* Configure VSCode to use multiple files, to display linting for rancher components

* Disable jest lint hook restriction for string list component

* Autofix
2023-06-23 17:02:55 +02:00
Richard Cox 0709d3fbee Fix issue where multiple instances of vue were imported
- caused by yarn link to dashboard
2023-06-21 18:37:09 +01:00
Richard Cox ed9ee99980 Fix failing e2e test
- caused by EXCLUDE_OPERATOR_PKG defaulting to truthy
- which meant no plugins were loaded by the ui
- which meant button to reload ui given changes to plugins was always shown
- when meant extension e2e test that removed plugin immediately used it to reload without waiting for remove to finish
2023-06-09 15:40:06 +01:00
Richard Cox bfa27646aa operator pkgs --> pkg 2023-06-01 18:24:04 +01:00
Richard Cox 8a05df2d31 Merge remote-tracking branch 'upstream/master' into merge-master-2 2023-06-01 17:37:47 +01:00
Richard Cox 859c157962 Two Build Related Tweaks
- Fix chunking for `pages/c/_cluster/settings/DefaultLinksEditor.vue`
- bundle css with pages, instead of as prefetched links in index.html
2023-06-01 14:22:08 +01:00
Richard Cox 1e8c6cb13d remove EXCLUDES_NUXT_PLUGINS, replace with EXCLUDE_OPERATOR_PKGS (to avoid loading operator plugins) 2023-05-26 16:17:28 +01:00
Richard Cox 21e2267bd2 Fixes following merge 2023-05-25 17:00:16 +01:00
Richard Cox 747a36f526 Fix 'What's New' page
- Fixes #8979
- Remove clash of `test: /\.md$/,` entries
- The removed entry might be a copy and paste error. Going back to pre-nuxt removeal the `url-loader` was associated with loading images
  - https://github.com/rancher/dashboard/blob/v2.7.2/shell/nuxt.config.js#L492
  - i'm not sure if we don't need the custom loader now, images do seem to work
2023-05-25 14:12:21 +01:00
Richard Cox 541be75918 Fix router base
- build time env var was not passed through to where it was used in runtime
- resulted in RC builds looking for resources in `/` instead of `/dashboard`
2023-05-25 12:58:52 +01:00
codyrancher f6ed581a54 Changing how we serve the favicon
The release version of rancher appears to expect the favicon at the root directory. Dev expected it to be under the public directory. I changed dev to use the root directory as well

https://github.com/rancher/dashboard/issues/8794
2023-05-05 15:35:24 +02:00