From 5bc54796a19fa616d6e8a15b6c90450fd3065168 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 5 Jun 2024 16:35:45 +1200 Subject: [PATCH 1/3] ENH Use class name instead of self --- src/TagField.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TagField.php b/src/TagField.php index 3ae22a6..1e85f12 100644 --- a/src/TagField.php +++ b/src/TagField.php @@ -195,7 +195,7 @@ class TagField extends MultiSelectField * Set the model class name for tags * * @param DataList $sourceList - * @return self + * @return TagField */ public function setSourceList($sourceList) { @@ -210,7 +210,7 @@ class TagField extends MultiSelectField { $this->addExtraClass('entwine'); - return $this->customise($properties)->renderWith(self::class); + return $this->customise($properties)->renderWith(TagField::class); } /** @@ -618,9 +618,9 @@ class TagField extends MultiSelectField public function getSchemaDataType(): string { if ($this->getIsMultiple()) { - return self::SCHEMA_DATA_TYPE_MULTISELECT; + return TagField::SCHEMA_DATA_TYPE_MULTISELECT; } - return self::SCHEMA_DATA_TYPE_SINGLESELECT; + return TagField::SCHEMA_DATA_TYPE_SINGLESELECT; } } From de3f9bce7400ba9f79cfa9a2a7d9723889f25ae4 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:40:32 +1200 Subject: [PATCH 2/3] MNT Fix scss lint warnings (#292) --- .stylelintignore | 1 - client/dist/styles/bundle.css | 2 +- client/src/components/TagField.scss | 39 +++++++++++++---------------- package.json | 4 +-- yarn.lock | 8 +++--- 5 files changed, 25 insertions(+), 29 deletions(-) delete mode 100644 .stylelintignore diff --git a/.stylelintignore b/.stylelintignore deleted file mode 100644 index 8688292..0000000 --- a/.stylelintignore +++ /dev/null @@ -1 +0,0 @@ -client/src/**/*.js diff --git a/client/dist/styles/bundle.css b/client/dist/styles/bundle.css index 5ca2b64..826a55f 100644 --- a/client/dist/styles/bundle.css +++ b/client/dist/styles/bundle.css @@ -1 +1 @@ -.ss-tag-field__multi-value{margin-top:3px}.ss-tag-field__control{border-color:#ced5e1;box-shadow:none}.ss-tag-field__control--is-focused{border-color:#29abe2;box-shadow:none}.ss-tag-field__option+.ss-tag-field__option{border-top:1px solid #dbe0e9}.ss-tag-field__option-button{border:1px solid #dbe0e9;border-radius:.23rem;background:#fff;width:auto !important;max-width:25%;margin:-4px -5px -4px 5px;padding:4px 5px 4px 4px;cursor:pointer}.ss-tag-field__option-button:hover{background:#ced5e1}.ss-tag-field__option-button .font-icon-right-open-big{margin:2px 0 0 -1px;width:24px}.ss-tag-field__option-count-icon{padding:0 .6154rem;line-height:.8}.ss-tag-field__option-context{color:#566b8d;font-size:.923rem}.ss-tag-field__option--is-focused{background-color:#f5f5f5}.ss-tag-field__option--is-selected{background:#0071c4;color:#fff}.ss-tag-field__option--is-selected .ss-tag-field__option-button{border-color:#29abe2;background:none;color:#fff}.ss-tag-field__option--is-selected .ss-tag-field__option-button:hover{background:rgba(0,0,0,.2)}.ss-tag-field__option-title--highlighted{font-weight:bold}.ss-tag-field__indicator{cursor:pointer}.ss-tag-field__clear-indicator:hover,.ss-tag-field__clear-indicator:focus{color:#d40404}.ss-tag-field__dropdown-indicator:hover,.ss-tag-field__dropdown-indicator:focus{color:#303b4d}.ss-tag-field__multi-value{color:#43536d;background-color:#fff;border:1px solid #66afe9;border-radius:.23rem}.ss-tag-field__multi-value__remove{font-size:1.231rem;padding:0 5px 2px;border-left:1px solid #66afe9;border-radius:0}.ss-tag-field__multi-value__remove:focus,.ss-tag-field__multi-value__remove:hover{background-color:rgba(0,113,230,.08);color:#0071e6}.ss-tag-field__menu{z-index:10} +.ss-tag-field__multi-value{margin-top:3px;color:#43536d;background-color:#fff;border:1px solid #66afe9;border-radius:.23rem}.ss-tag-field__multi-value__remove{font-size:1.231rem;padding:0 5px 2px;border-left:1px solid #66afe9;border-radius:0}.ss-tag-field__multi-value__remove:focus,.ss-tag-field__multi-value__remove:hover{background-color:rgba(0,113,230,.08);color:#0071e6}.ss-tag-field__control{border-color:#ced5e1;box-shadow:none}.ss-tag-field__control--is-focused{border-color:#29abe2;box-shadow:none}.ss-tag-field__option+.ss-tag-field__option{border-top:1px solid #dbe0e9}.ss-tag-field__option-button{border:1px solid #dbe0e9;border-radius:.23rem;background:#fff;width:auto !important;max-width:25%;margin:-4px -5px -4px 5px;padding:4px 5px 4px 4px;cursor:pointer}.ss-tag-field__option-button:hover{background:#ced5e1}.ss-tag-field__option-button .font-icon-right-open-big{margin:2px 0 0 -1px;width:24px}.ss-tag-field__option-count-icon{padding:0 .6154rem;line-height:.8}.ss-tag-field__option-context{color:#566b8d;font-size:.923rem}.ss-tag-field__option--is-focused{background-color:#f5f5f5}.ss-tag-field__option--is-selected{background:#0071c4;color:#fff}.ss-tag-field__option--is-selected .ss-tag-field__option-button{border-color:#29abe2;background:none;color:#fff}.ss-tag-field__option--is-selected .ss-tag-field__option-button:hover{background:rgba(0,0,0,.2)}.ss-tag-field__option-title--highlighted{font-weight:bold}.ss-tag-field__indicator{cursor:pointer}.ss-tag-field__clear-indicator:hover,.ss-tag-field__clear-indicator:focus{color:#d40404}.ss-tag-field__dropdown-indicator:hover,.ss-tag-field__dropdown-indicator:focus{color:#303b4d}.ss-tag-field__menu{z-index:10} diff --git a/client/src/components/TagField.scss b/client/src/components/TagField.scss index 1decd34..598afc0 100644 --- a/client/src/components/TagField.scss +++ b/client/src/components/TagField.scss @@ -1,5 +1,22 @@ .ss-tag-field__multi-value { margin-top: 3px; + color: $body-color; + background-color: $white; + border: 1px solid $input-focus-border-color; + border-radius: $border-radius; +} + +.ss-tag-field__multi-value__remove { + font-size: $font-size-lg; + padding: 0 5px 2px; + border-left: 1px solid $input-focus-border-color; + border-radius: 0; + + &:focus, + &:hover { + background-color: rgba(0, 113, 230, .08); + color: #0071e6; + } } /* Styles below here are duplicates of the treedropdownfield styles in silverstripe/admin, but with the appropriate classnames for tagfield. */ @@ -22,7 +39,7 @@ border-radius: $border-radius; background: $white; // needed to override the width rule in .fill-width - width: auto !important; // sass-lint:disable-line no-important + width: auto !important; max-width: 25%; margin: -4px -5px -4px 5px; padding: 4px 5px 4px 4px; @@ -89,26 +106,6 @@ } } -.ss-tag-field__multi-value { - color: $body-color; - background-color: $white; - border: 1px solid $input-focus-border-color; - border-radius: $border-radius; -} - -.ss-tag-field__multi-value__remove { - font-size: $font-size-lg; - padding: 0 5px 2px; - border-left: 1px solid $input-focus-border-color; - border-radius: 0; - - &:focus, - &:hover { - background-color: rgba(0, 113, 230, .08); - color: #0071e6; - } -} - .ss-tag-field__menu { z-index: 10; } diff --git a/package.json b/package.json index bf6ea51..7a9c792 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "test": "jest", "coverage": "jest --coverage", "lock": "npm-shrinkwrap --dev", - "lint": "eslint client/src && yarn lint-sass", + "lint": "yarn lint-js && yarn lint-sass", "lint-js": "eslint client/src", "lint-js-fix": "eslint client/src --fix", "lint-sass": "stylelint client/src" @@ -38,7 +38,7 @@ "url": "^0.11.0" }, "devDependencies": { - "@silverstripe/eslint-config": "^1.2.1", + "@silverstripe/eslint-config": "^1.3.0", "@silverstripe/webpack-config": "^2.1.0", "@testing-library/react": "^14.0.0", "babel-jest": "^29.2.2", diff --git a/yarn.lock b/yarn.lock index 066adf2..4a4220e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1674,10 +1674,10 @@ resolved "https://registry.yarnpkg.com/@sect/modernizr-loader/-/modernizr-loader-1.0.5.tgz#512afc60c715cd658fdffab244123661e1339083" integrity sha512-L8y2BTVeLtdSe1XzBcD2DOlc+7fR7Z/uNdhsKvf3d3x3gmEKz9sfl2wJ3VzFhEd+a/O6qgacuhbziphG2p4s8g== -"@silverstripe/eslint-config@^1.2.1": - version "1.2.1" - resolved "https://registry.yarnpkg.com/@silverstripe/eslint-config/-/eslint-config-1.2.1.tgz#17ed5e955308a4a89e87f5090df66ca1e8ea462d" - integrity sha512-T4Lz1aZEDLxRpSNe4EgEmLKPfofxba0p0+YkL/AOD8VM/sng7VM9vKwMoqICbsUGvNoymHfeWtARlCa575O4PA== +"@silverstripe/eslint-config@^1.3.0": + version "1.3.0" + resolved "https://registry.yarnpkg.com/@silverstripe/eslint-config/-/eslint-config-1.3.0.tgz#fa88f47cacd6103f6b759d81e1d86f9e93799413" + integrity sha512-Q3+sQKO1ysyMLhJ91kOl2LqJhQICfHFeqMx09EH0xx3dRHgjsQvqHIzVWEzPkM/l7D79m+Ma/WBnon30S7TVlA== dependencies: eslint "^8.26.0" eslint-config-airbnb "^19.0.4" From ac614dff1fbccaa7c1598807a503099c398ff30f Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Thu, 20 Jun 2024 12:23:00 +1200 Subject: [PATCH 3/3] MNT Run module-standardiser (#296) --- .github/workflows/add-prs-to-project.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/add-prs-to-project.yml diff --git a/.github/workflows/add-prs-to-project.yml b/.github/workflows/add-prs-to-project.yml new file mode 100644 index 0000000..2d3f41a --- /dev/null +++ b/.github/workflows/add-prs-to-project.yml @@ -0,0 +1,22 @@ +name: Add new PRs to github project + +on: + pull_request_target: + types: + - opened + - ready_for_review + +permissions: {} + +jobs: + addprtoproject: + name: Add PR to GitHub Project + # Only run on the silverstripe account + if: github.repository_owner == 'silverstripe' + runs-on: ubuntu-latest + steps: + - name: Add PR to github project + uses: silverstripe/gha-add-pr-to-project@v1 + with: + app_id: ${{ vars.PROJECT_PERMISSIONS_APP_ID }} + private_key: ${{ secrets.PROJECT_PERMISSIONS_APP_PRIVATE_KEY }}