Skip to content

Commit

Permalink
Merge pull request #356 from TykTechnologies/TUI-44/linting-and-others
Browse files Browse the repository at this point in the history
TUI-44: linting and others
  • Loading branch information
ifrim authored Mar 6, 2024
2 parents 9c7b416 + 1da337c commit 5e926ec
Show file tree
Hide file tree
Showing 132 changed files with 2,472 additions and 5,793 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"jsx-a11y/no-noninteractive-element-interactions": "off",
"jsx-a11y/anchor-is-valid": "off",
"no-console": "off",
"no-restricted-syntax": ["error", "ForInStatement", "LabeledStatement", "WithStatement"],
"no-unused-expressions": "off",
"import/no-extraneous-dependencies": "off",
"import/prefer-default-export": "off",
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,20 @@ jobs:
-Dsonar.organization=tyktechnologies
-Dsonar.projectKey=TykTechnologies_tyk-ui
-Dsonar.sources=./src
-Dsonar.coverage.exclusions=cypress/**/*.js,**/*.test.js,src/form/components/Combobox/*.js,src/form/components/Input/*.js,src/form/redux-form/**/*.js
-Dsonar.cpd.exclusions=**/*.test.js,src/form/redux-form/**/*,src/common/fonts/**/*,src/form/components/Combobox/*.js,src/form/components/Input/*.js
-Dsonar.exclusions=src/common/sass/fontawesome.scss,src/common/sass/tykon.scss
-Dsonar.coverage.exclusions=cypress/**/*.js,**/*.test.js,src/form/components/Combobox/**/*.js,src/form/components/Input/**/*.js,src/form/components/EditableList/**/*.js,src/form/redux-form/**/*.js,src/hooks/**/*,src/utils/**/*
-Dsonar.cpd.exclusions=**/*.test.js,src/form/redux-form/**/*,src/common/fonts/**/*,src/form/components/Combobox/*.js,src/form/components/Input/*.js,src/form/components/EditableList/**/*.js,src/form/redux-form/**/*.js,src/hooks/**/*,src/utils/**/*
-Dsonar.test.inclusions=**/*.test.js
-Dsonar.tests=./src
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.eslint.eslintconfigpath=.eslintrc
-Dsonar.issue.ignore.multicriteria=S6847,S6819,S3358
-Dsonar.issue.ignore.multicriteria.S6847.ruleKey=javascript:S6847
-Dsonar.issue.ignore.multicriteria.S6847.resourceKey=**/*
-Dsonar.issue.ignore.multicriteria.S6819.ruleKey=javascript:S6819
-Dsonar.issue.ignore.multicriteria.S6819.resourceKey=**/*
-Dsonar.issue.ignore.multicriteria.S3358.ruleKey=javascript:S3358
-Dsonar.issue.ignore.multicriteria.S3358.resourceKey=**/*
env:
CI: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@ jobs:
-Dsonar.organization=tyktechnologies
-Dsonar.projectKey=TykTechnologies_tyk-ui
-Dsonar.sources=./src
-Dsonar.coverage.exclusions=cypress/**/*.js,**/*.test.js,src/form/components/Combobox/*.js,src/form/components/Input/*.js,src/form/redux-form/**/*.js
-Dsonar.cpd.exclusions=**/*.test.js,src/form/redux-form/**/*,src/common/fonts/**/*,src/form/components/Combobox/*.js,src/form/components/Input/*.js
-Dsonar.exclusions=src/common/sass/fontawesome.scss,src/common/sass/tykon.scss
-Dsonar.coverage.exclusions=cypress/**/*.js,**/*.test.js,src/form/components/Combobox/**/*.js,src/form/components/Input/**/*.js,src/form/components/EditableList/**/*.js,src/form/redux-form/**/*.js,src/hooks/**/*,src/utils/**/*
-Dsonar.cpd.exclusions=**/*.test.js,src/form/redux-form/**/*,src/common/fonts/**/*,src/form/components/Combobox/*.js,src/form/components/Input/*.js,src/form/components/EditableList/**/*.js,src/form/redux-form/**/*.js,src/hooks/**/*,src/utils/**/*
-Dsonar.test.inclusions=**/*.test.js
-Dsonar.tests=./src
-Dsonar.javascript.lcov.reportPaths=coverage/lcov.info
-Dsonar.eslint.eslintconfigpath=.eslintrc
-Dsonar.issue.ignore.multicriteria=S6847,S6819,S3358
-Dsonar.issue.ignore.multicriteria.S6847.ruleKey=javascript:S6847
-Dsonar.issue.ignore.multicriteria.S6847.resourceKey=**/*
-Dsonar.issue.ignore.multicriteria.S6819.ruleKey=javascript:S6819
-Dsonar.issue.ignore.multicriteria.S6819.resourceKey=**/*
-Dsonar.issue.ignore.multicriteria.S3358.ruleKey=javascript:S3358
-Dsonar.issue.ignore.multicriteria.S3358.resourceKey=**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ coverage
.nyc_output
*DS_Store
cypress/screenshots
.vscode
.scannerwork
4 changes: 2 additions & 2 deletions lib/index.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/sass/common/sass/reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockq
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
font-size: 100%;
vertical-align: baseline;
}

Expand Down
64 changes: 25 additions & 39 deletions lib/sass/common/sass/typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ label {
font-size: text-scale('sm');
line-height: line-height('sm');
font-family: $font-family-regular;

a {
font-size: text-scale('sm');
text-decoration: underline;
}
}

strong {
Expand All @@ -52,7 +57,7 @@ a:not(.tyk-button) {
cursor: pointer;
color: $text-color;
font-family: $font-family-regular;

&.link--bold {
font-family: $font-family-bold;
}
Expand All @@ -66,14 +71,6 @@ a:not(.tyk-button) {
}
}

p,
label {
a {
font-size: text-scale('sm');
text-decoration: underline;
}
}

.font-family-regular {
font-family: $font-family-regular;
}
Expand All @@ -94,18 +91,9 @@ label {
}

.text {
&--primary {
color: theme-color('primary', 'base');
}
&--danger {
color: theme-color('danger', 'base');
}
&--info {
color: theme-color('info', 'base');
}
&-warning {
color: theme-color('warning', 'base');
}
&--medium {
font-family: $font-family-medium;
}
Expand All @@ -123,6 +111,25 @@ label {
&--underline {
text-decoration: underline;
}

&--default-light {
color: theme-color('default', 'light') !important;
}
&--default {
color: theme-color('default', 'base') !important;
}
&--primary {
color: theme-color('primary', 'base') !important;
}
&--danger {
color: theme-color('danger', 'base') !important;
}
&--success {
color: theme-color('success', 'base') !important;
}
&--warning {
color: theme-color('warning', 'base') !important;
}
}

td.text-ellipsis {
Expand Down Expand Up @@ -160,24 +167,3 @@ td.text-ellipsis {
margin-left: 5px;
}
}

.text {
&--default-light {
color: theme-color('default', 'light') !important;
}
&--default {
color: theme-color('default', 'base') !important;
}
&--primary {
color: theme-color('primary', 'base') !important;
}
&--danger {
color: theme-color('danger', 'base') !important;
}
&--success {
color: theme-color('success', 'base') !important;
}
&--warning {
color: theme-color('warning', 'base') !important;
}
}
26 changes: 10 additions & 16 deletions lib/sass/components/Panel/sass/Panel.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@
border: $general-border-width solid theme-color('danger', 'base');
}

&__header {
align-items: center;
border-bottom: 1px solid $panel-default-border-bottom-color;
display: flex;
font-family: $font-family-regular;

> .tyk-icon,
> .tyk-tooltip__wrapper {
margin-left: 5px;
}
}

.tyk-panel {
border: $general-border-width solid theme-color('default', 'light');
box-shadow: none;
Expand Down Expand Up @@ -57,13 +45,11 @@

.tyk-panel__header {
@include panel-variant($panel-primary-header-color, $panel-primary-header-text-color);
border: $panel-primary-border-color;
}

.tyk-panel__body {
@include panel-variant($panel-primary-body-color, $panel-primary-body-text-color);
}
.tyk-panel__header {
border: $panel-primary-border-color;
@include panel-variant($panel-primary-body-color, $panel-primary-body-text-color);
}

& .tyk-form-group {
Expand Down Expand Up @@ -121,6 +107,9 @@
}

.tyk-panel__header {
display: flex;
align-items: center;
border-bottom: 1px solid $panel-default-border-bottom-color;
border-radius: $panel-border-radius;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
Expand All @@ -129,6 +118,11 @@
padding: $padding-y-panel-header $padding-x-panel-header;
position: relative;

> .tyk-icon,
> .tyk-tooltip__wrapper {
margin-left: 5px;
}

.tyk-panel--collapsed & {
border-bottom-left-radius: $panel-border-radius;
border-bottom-right-radius: $panel-border-radius;
Expand Down
9 changes: 3 additions & 6 deletions lib/sass/components/Table/sass/Table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
line-height: line-height('sm');
font-family: $font-family-bold;
text-transform: uppercase;
padding: $table-th-padding;

&:last-child {
border-right: none;
Expand All @@ -49,10 +50,6 @@
}
}

> thead th {
padding: $table-th-padding;
}

> tbody tr:hover {
background: rgba(theme-color('background', 'light'), 0.4);
}
Expand All @@ -67,7 +64,7 @@
&:last-child {
border-right: none;
}

vertical-align: middle;

&.fit {
Expand Down Expand Up @@ -97,7 +94,7 @@
border-top: 1px solid theme-color('default', 'light');
transition: all .4s linear;
border-radius: $general-border-radius;

&.clickable {
cursor: pointer;
}
Expand Down
10 changes: 2 additions & 8 deletions lib/sass/form/components/Combobox2/sass/Combobox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
&__text-value {
font-family: $font-family-medium;
font-size: text-scale('sm');
line-height: line-height('sm');
padding: 9px 5px;
width: 100%;
overflow: hidden;
Expand Down Expand Up @@ -145,6 +144,7 @@
cursor: pointer;
outline: none;
transition: all .2s;
color: $text-color;

&--expanded {
transform: rotate(180deg);
Expand All @@ -168,6 +168,7 @@

&.tyk-form-group--rounded-corners {
border-radius: $general-border-radius;
z-index: 1081;
}

.tyk-combobox2__combobox-search {
Expand Down Expand Up @@ -217,10 +218,3 @@
}
}
}
.tyk-combobox2__values-container-trigger {
color: $text-color;
}

.tyk-combobox2__combobox-dropdown.tyk-form-group--rounded-corners {
z-index: 1081;
}
7 changes: 2 additions & 5 deletions lib/sass/form/components/Dropdown/sass/Dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@

&:hover {
color: $tyk-dropdown-item-hover-text-color;
background-color: $tyk-dropdown-item-background-hover;
text-decoration: none;
}

.badge {
Expand All @@ -117,11 +119,6 @@
margin-top: -4px;
margin-left: 6px;
}

&:hover {
background-color: $tyk-dropdown-item-background-hover;
text-decoration: none;
}
}

.tyk-dropdown--relative.opened {
Expand Down
37 changes: 16 additions & 21 deletions lib/sass/form/components/EditableList/sass/EditableList.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
border-bottom-left-radius: 0px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
padding-bottom: 11px;
padding: map-get($spacing, 'sm') map-get($spacing, 'base') 11px map-get($spacing, 'base');
padding-block: map-get($spacing, 'sm') 11px;
padding-inline: map-get($spacing, 'base');
}
}

Expand All @@ -43,11 +43,23 @@

.tyk-editable-list__header {
padding-top: map-get($spacing, 'base');
border-bottom: 1px solid theme-color('background', 'dark');
color: $text-color;
font-size: 11px;
padding-bottom: map-get($spacing, 'base');
text-transform: uppercase;
background-color: white;
border-top-left-radius: $general-border-radius;
border-top-right-radius: $general-border-radius;
border: $general-border-width solid theme-color('default', 'light');
border-bottom: 1px solid theme-color('default', 'light') !important;
color: $text-color !important;
font-family: $font-family-bold;
margin-top: map-get($spacing, 'sm');

& + .tyk-editable-list-items.table {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
}

.tyk-row {
margin: 0;
Expand Down Expand Up @@ -186,20 +198,3 @@
margin-right: map-get($spacing, 'sm');
}
}

.tyk-editable-list__header {
background-color: white;
border-top-left-radius: $general-border-radius;
border-top-right-radius: $general-border-radius;
border: $general-border-width solid theme-color('default', 'light');
border-bottom: 1px solid theme-color('default', 'light') !important;
color: $text-color !important;
font-family: $font-family-bold;
margin-top: map-get($spacing, 'sm');

& + .tyk-editable-list-items.table {
border-top: none;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
}
Loading

0 comments on commit 5e926ec

Please sign in to comment.