Commit Graph

21 Commits

Author SHA1 Message Date
Nancy 371524f732
Reduce performance impact of LabeledSelect getOptionLabel (#9689)
* imrpove labeledSelect getOptionLabel performance when options are strings

* refactor labeledselect getOptionLabel and write test

* remove redundant if block in ls getOPtionLabel

* refactor getUpdatedOption
2023-09-12 12:58:02 -07: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
Nancy 21167e1dc9
fix labeledselect getOptionLabel to use reduce prop when labels change (#8176)
* fix labeledselect getOptionLabel to use reduce prop when labels change

* Add unit tests

---------

Co-authored-by: cnotv <giuseppe.leo@suse.com>
2023-02-15 09:19:48 -07:00
Giuseppe Leo f3f7a2a022
PSA: Update PSA default (#8133)
* Change inputs order for PSP/PSA/CIS; Code cleanup

* Add CIS override input; add and correct i18n for CIS

* Change label and input status, based on criteria

* Prevent issues for missing CIS profile args

* Disable logs to avoid code pollution

* Fix test issue

* Update PSA template default label

* Change PSACT on CIS changes if above 1.25

* Add banner for CIS cases

* Remove duplicated logic

* Correct issue after rebase
2023-02-14 18:03:38 +01:00
Giuseppe Leo fb590d2539
LabeledSelect: Displayed label does not update with options (#8154)
* Update displayed value in labeled select inputs if option labe changes but not the value

* Replace generic label and key with props

* Add i18n
2023-02-14 10:42:30 +01:00
Francesco Torchia 93aafffe88
Select Member, add tooltip
Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
2022-12-15 17:15:33 +01:00
richa c792d21dd9
Fixed icon size (#7557)
* Fixed icon size

* Add node inactive warning indicator (#7548)

* StringList, delete item on editing

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Bump @rancher/components version

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Add manage button to home page (#7546)

* Add manage button to home page

* Fix button spacing

* Make buttons smaller - looks better with extra button

* Fixed icon size in simplebox

* icon fix in GrowlManager.vue

* Add node inactive warning indicator (#7548)

* StringList, delete item on editing

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Bump @rancher/components version

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>

* Add manage button to home page (#7546)

* Add manage button to home page

* Fix button spacing

* Make buttons smaller - looks better with extra button

* Fixed close icon size

* Fixed more icons sizes

* Fixed icon size in namespaces filter

* Reverd css changes in LabeledSelect component

* Fix on Header

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
Co-authored-by: Neil MacDougall <nwmac@users.noreply.github.com>
Co-authored-by: Francesco Torchia <francesco.torchia@suse.com>
Co-authored-by: Richa Bisht <RBISHT@Richas-MacBook-Pro.local>
2022-12-08 16:52:53 +01:00
richa f2e1ae8ac8
Added blue color only to creation action (#7118)
* Added blue color only to creation action

* Removed test code

* Revert some changes without dummy text

* Fixed names for attribute, color variables for dark and light theme, removed a tag

* Allow /rancherversion endpoint override (#7088)

* Fix KeyValue Component. (#7093)

* Fix KeyValue Component.

* Refactor solution.

* Fix PR comment.

* Adds new logos without Manager to bettr represent all sub-brands and improve readability

* Updates error of HSB colour to HSL

* Remove uneeded check - add custom check for old endpoints (#7058) (#7074)

* Allow to reset ui-brand global setting (#7110)

* Remove negative margin for Tabbed component, causing issues in Network policies (#7108)

* Update script to use newer version of Rancher Docker (#7114)

* Removed files from featured-carousel PR that should not be there at top-level (#7092)

* Allow wildcards in ingress hostnames (#7025)

Wildcards are allowed in ingress hostnames since Kubernetes 1.18: https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#support-for-hostname-wildcards

Fixes https://github.com/rancher/dashboard/issues/6957

Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>

Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>

* Improve PSP deprecated banner
Fixes #7096

Previously...
- a new request for PSPs was made on each page visit
- the request would fail for users without access to the PSP
- failed requests equated to white page dev error (fine in prod)

Now...
- use the `counts` resource to determine if the user can see any PSPs
- move logic to a computed property

* Hide experimental charts from Cluster Tools

Signed-off-by: Bastian Hofmann <mail@bastianhofmann.de>
Co-authored-by: Neil MacDougall <nwmac@users.noreply.github.com>
Co-authored-by: Shavindra <Shavindra@users.noreply.github.com>
Co-authored-by: Kenneth Wimer <wimer@suse.com>
Co-authored-by: Jordon Leach <40806497+jordojordo@users.noreply.github.com>
Co-authored-by: Giuseppe Leo <giuseppe.leo@suse.com>
Co-authored-by: Bastian Hofmann <bashofmann@gmail.com>
Co-authored-by: Richard Cox <richard.cox@suse.com>
2022-11-15 14:31:08 +01:00
Giuseppe Leo d2d4122bc0
Review HTML formatting rules (#6805)
* Prevent ESLint to format generated paths

* Add HTML ESLint Rules

* Format all the Vue HTML templates except Harvester

* Exclude Harvester package from linting HTML, keeping old formatting rules
2022-11-11 17:04:22 +01:00
Nancy 29e666c7a7
Revert "HARVESTER: fix select style (#7055)" (#7064)
This reverts commit 8909903e44.
2022-10-03 15:58:03 +01:00
wujun 8909903e44
HARVESTER: fix select style (#7055) 2022-09-30 14:09:19 -07:00
Sean 41ba49b6c2 Adds in UI-side validation for Ingress Form plus additional fixes.
Fixes #4575 Add in validator injection to form-validation mixin, add in "allTabsExtraContent" slot to "tabbed" for messaging that should span all tabs, Error component optionally displays as banner, InputWithSelect can now show validationMessage on text-box without a label, LabeledSelect can now show tooltip and validationMessage at the same time, Select component can now show validation message, adding and removing rules and rulepaths displays correct content, removing does not reload page (fixes #6319), ingress form shows proper validation messages for the following states: invalid "name" field, invalid request host, invalid rule path, invalid rule target service, invalid rule port, invalid default backend target service, invalid default backend port, either rules or default backend must be present. Ingress form is validated and "Create" button is disabled if payload is not validated as correct.
2022-07-21 13:55:38 -04:00
Catherine Luse 89a55389ed
Merge pull request #6302 from catherineluse/amc
Can select secrets for receivers in AlertmanagerConfig
2022-07-10 06:39:01 -07:00
Catherine Luse f81d0d9876 Can select secrets for receivers in AlertmanagerConfig 2022-07-07 20:35:57 -07:00
Sean ddab180ecc Adds in form validation mixin, error reporting on inputs, a few examples 2022-07-07 13:18:43 -04:00
Catherine Luse b0abe0761a
Merge branch 'master' into create-edit-namespace 2022-06-10 13:41:53 -07:00
Phillip Rak 3c23d90b0d
Port rancher components to TypeScript (#6073)
Summary

This ports the components under pkg/rancher-components to TypeScript. Take note that this change also touches some areas outside of pkg/rancher-components, including

    shell/mixins/labeled-form-element.ts
    shell/mixins/compact-input.ts
    shell/components/form/LabeledSelect.vue
    shell/components/form/Select.vue

Making changes to these components was required to properly work with the mixins used for pkg/rancher-components/src/components/Form/LabeledInput/LabeledInput.vue. Perhaps these would be good candidates to port to Rancher Components next..

Fixes #5932
Areas or cases that should be tested

We'll need to review a good range of usages for the modified components to check for regressions. I'm mostly concerned about type errors or warnings that might be raised during runtime.
2022-06-07 10:36:37 -07:00
Catherine Luse 8709f99ba7 Can select or create a namespace in create resource forms 2022-06-02 19:49:16 -07:00
Phillip Rak 72b36cb360
Create Rancher Component Library (#5504)
This adds a new project for Rancher Components under `pkg/rancher-components` and replaces components used throughout dashboard with the versions used here. All imports for the following components have been updated:

```
  |- BadgeState.vue
  |- Banner.vue
  |- Card.vue
  |- Form
    |- Checkbox.vue
    |- LabeledInput.vue
    |- LabeledTooltip.vue
    |- RadioButton.vue
    |- RadioGroup.vue
    |- TextAreaAutoGrow.vue
```
2022-05-24 15:09:53 -07:00
Catherine Luse 3a8be3a1d1 Change name of event emitted for secret selector 2022-05-19 22:57:29 -07:00
Richard Cox 25acc1f8eb Plugins: Rejig files to new shell locations (#5623)
* Doc

* v0.7.0

* v0.7.1

* v0.7.2

* Add creators

* v0.1.14

* v0.1.17

* Add Yarn link

* Tidy ups and typos

* Allow models to be loaded from plugins

* v0.1.15

* v0.1.18

* v0.6.6

* Improve readme, fix cyperss log msg

* v0.1.17

* v0.1.19

* v0.6.7

* v0.6.8

* Fix logo ref when in shell

* Fix lint issues

* Fix error in example

* Fix script to work on linux

* Add ability to revert moves without losing changes

* Fix bug with custom models in a plugin

* Fix build of UI packages

* Add dist-pkg to .eslintignore

* Pull out util from extend-router to prevent router being pulled in UI packages

* Update PLUGINS.md

* Remove duplicate dependency

* Reduce size of built UI packages

* Share codemirror. Other tidy ups

* Further improvements

* Tidy ups to support i18n in plugins

* Clen up add comments

* More clean-ups and comments added

* Rename from extension to plugin

* Missed file in rename

* v0.6.9

* TIdy ups following rename

* v0.1.20

* v0.1.21

* More refactor and tidy up

* v0.1.22

* v0.1.18

* v0.1.19

* v0.1.23

* v0.6.10

* Version Packages. Improve naming. Unload.

* v0.6.11

* v0.1.20

* v0.1.21

* v0.1.24

* v0.6.12

* v0.1.25

* v0.1.22

* v0.6.13

* Fix issues when plugin is builtin

* Add missing files

* Fix lint issues and watcher ignores

* Fixes following review

* v0.1.28

* v0.1.31

* v0.6.20

* Fix coer.js version

* Fix bug where plugins included via npm don't work

* Changes post merge

* Move plugins doc to dev guide, add note at top of README

* Update cypress version

* Add note about the reset --hard in rejig -d

* Fixes post merge

* Rename @ranch to @rancher and ad plugins

* Improve routes support, add package assets support

* Add uninstall hooks and pass interal opts

* Fix rejig script

* Minor fixes

* Routing tweaks
- attempted to improve `addRoutes` typing, failed a lot
- improved typings in plugins.ts
- added "@pkg/*" entry and vue-shim (for importing components) to the pkg creator
- fixed some linting
- safely fail when Verdaccio isn't running
- fixed some typos

* Remove frontmatter-markdown-loader reference from nuxt-config

* Revert "Remove frontmatter-markdown-loader reference from nuxt-config"

This reverts commit 29ef6f2f7b.

* Exclude creators from dashboard build

* Revert "Exclude creators from dashboard build"

This reverts commit 8ede93ee7c.

* Ingore creators via tsconfig
- We're still susceptible with vue shims in multiple packages
- Need to determine why packages can't use shim from route
- Probably need to move `./vue-shim.d.ts` in to `./shell`. Needs testing with a pkg that imports a component

* After rejig

Co-authored-by: Neil MacDougall <nmacdougall@suse.com>
Co-authored-by: Neil MacDougall <nwmac@users.noreply.github.com>
2022-05-10 10:04:02 +01:00