Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/6'
Browse files Browse the repository at this point in the history
  • Loading branch information
tractorcow committed Feb 16, 2023
2 parents b3e55b9 + d35e665 commit c042104
Show file tree
Hide file tree
Showing 14 changed files with 238 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('@silverstripe/webpack-config/.eslintrc');
module.exports = require('@silverstripe/eslint-config/.eslintrc');
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Module CI
name: CI

on:
push:
pull_request:
workflow_dispatch:

jobs:
ci:
uses: silverstripe/github-actions-ci-cd/.github/workflows/ci.yml@v0.1
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v6.14.3
10
179 changes: 179 additions & 0 deletions .sass-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# sass-lint config to match the AirBNB style guide
files:
include:
# This covers linting when running locally
- 'client/src/**/*.scss'
# This covers linting when running via Github actions
- '**/silverstripe-fluent/client/src/**/*.scss'
options:
formatter: stylish
merge-default-rules: false
rules:
# Warnings
# Things that require actual refactoring are marked as warnings
class-name-format:
- 1
- convention: hyphenatedbem
placeholder-name-format:
- 1
- convention: hyphenatedlowercase
nesting-depth:
- 1
- max-depth: 3
no-ids: 1
no-important: 1
no-misspelled-properties:
- 1
- extra-properties:
- "-moz-border-radius-topleft"
- "-moz-border-radius-topright"
- "-moz-border-radius-bottomleft"
- "-moz-border-radius-bottomright"
variable-name-format:
- 1
- allow-leading-underscore: true
convention: hyphenatedlowercase
no-extends: 1

# Warnings: these things are preferential rather than mandatory
no-css-comments: 1

# Errors
# Things that can be easily fixed are marked as errors
indentation:
- 2
- size: 2
final-newline:
- 2
- include: true
no-trailing-whitespace: 2
border-zero:
- 2
- convention: '0'
brace-style:
- 2
- allow-single-line: true
clean-import-paths:
- 2
- filename-extension: false
leading-underscore: false
no-debug: 2
no-empty-rulesets: 2
no-invalid-hex: 2
no-mergeable-selectors: 2
# no-qualifying-elements:
# - 1
# - allow-element-with-attribute: false
# allow-element-with-class: false
# allow-element-with-id: false
no-trailing-zero: 2
no-url-protocols: 2
quotes:
- 2
- style: double
space-after-bang:
- 2
- include: false
space-after-colon:
- 2
- include: true
space-after-comma:
- 2
- include: true
space-before-bang:
- 2
- include: true
space-before-brace:
- 2
- include: true
space-before-colon: 2
space-between-parens:
- 2
- include: false
trailing-semicolon: 2
url-quotes: 2
zero-unit: 2
single-line-per-selector: 2
one-declaration-per-line: 2
empty-line-between-blocks:
- 2
- ignore-single-line-rulesets: true


# Missing rules
# There are no sass-lint rules for the following AirBNB style items, but thess
# - Put comments on their own line
# - Put property delcarations before mixins

# Disabled rules

# These are other rules that we may wish to consider using in the future
# They are not part of the AirBNB CSS standard but they would introduce some strictness
# bem-depth: 0
# variable-for-property: 0
# no-transition-all: 0
# hex-length:
# - 1
# - style: short
# hex-notation:
# - 1
# - style: lowercase
# property-units:
# - 1
# - global:
# - ch
# - em
# - ex
# - rem
# - cm
# - in
# - mm
# - pc
# - pt
# - px
# - q
# - vh
# - vw
# - vmin
# - vmax
# - deg
# - grad
# - rad
# - turn
# - ms
# - s
# - Hz
# - kHz
# - dpi
# - dpcm
# - dppx
# - '%'
# per-property: {}
# force-attribute-nesting: 1
# force-element-nesting: 1
# force-pseudo-nesting: 1
# function-name-format:
# - 1
# - allow-leading-underscore: true
# convention: hyphenatedlowercase
# no-color-literals: 1
# no-duplicate-properties: 1
# mixin-name-format:
# - 1
# - allow-leading-underscore: true
# convention: hyphenatedlowercase
# shorthand-values:
# - 1
# - allowed-shorthands:
# - 1
# - 2
# - 3
# leading-zero:
# - 1
# - include: false
# no-vendor-prefixes:
# - 1
# - additional-identifiers: []
# excluded-identifiers: []
# placeholder-in-extend: 1
# no-color-keywords: 2
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

Binary file removed client/dist/images/menu-icon-16.png
Binary file not shown.
1 change: 0 additions & 1 deletion client/dist/js/fluent.js.map

This file was deleted.

1 change: 0 additions & 1 deletion client/dist/styles/fluent.css.map

This file was deleted.

25 changes: 13 additions & 12 deletions client/src/styles/fluent.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ $fluent-color-localised: rgb(102, 15, 242);
.cms-fluent-selector-locales {
background-color: #368b39;
background-image: url("../images/menu-icon-24-white.png");
background-position: 6px center;;
background-position: 6px center;
background-repeat: none;
background-size: 12px;
border-radius: 5px;
Expand All @@ -80,6 +80,7 @@ $fluent-color-localised: rgb(102, 15, 242);
// hide text on main dropdown when collapsed, show icon only
color: transparent;
padding: 2px;

> option {
color: white;
}
Expand Down Expand Up @@ -118,7 +119,7 @@ $fluent-color-localised: rgb(102, 15, 242);

// button
.popover-actions-simulate .ui-tabs-anchor {
font-size: 1.0em;
font-size: 1em;
color: #303b4d;

&:before {
Expand All @@ -130,7 +131,7 @@ $fluent-color-localised: rgb(102, 15, 242);
&:hover,
&:active {
&:after {
display: none !important;
display: none !important;// sass-lint:disable-line no-important
}
}
}
Expand All @@ -143,7 +144,7 @@ $fluent-color-localised: rgb(102, 15, 242);
.action-description {
font-size: 0.9em;
line-height: 1em;
display: block !important;
display: block !important;// sass-lint:disable-line no-important
margin: 0;
padding: 0 11px 8px 11px;
border-bottom: 1px solid #ccc;
Expand All @@ -156,24 +157,24 @@ $fluent-color-localised: rgb(102, 15, 242);
}
}

.action-group-COPY_FROM .action-menu__toggle:before,
.action-group-COPY_TO .action-menu__toggle:before {
font-family: inherit !important;
.action-group-COPY_FROM .action-menu__toggle:before, // sass-lint:disable-line class-name-format
.action-group-COPY_TO .action-menu__toggle:before { // sass-lint:disable-line class-name-format
font-family: inherit !important;// sass-lint:disable-line no-important
line-height: 1em;
font-size: 1.0em;
font-size: 1em;
}

// Gridfield menu items
.action-group-COPY_FROM .action-menu__toggle:before {
.action-group-COPY_FROM .action-menu__toggle:before {// sass-lint:disable-line class-name-format
// force ... to turn into actual title
// @todo i18n this
content: "Copy from" !important;
content: "Copy from" !important;// sass-lint:disable-line no-important
}

.action-group-COPY_TO .action-menu__toggle:before {
.action-group-COPY_TO .action-menu__toggle:before {// sass-lint:disable-line class-name-format
// force ... to turn into actual title
// @todo i18n this
content: "Copy to" !important;
content: "Copy to" !important;// sass-lint:disable-line no-important
}

// gridfield "visible locales" column
Expand Down
13 changes: 10 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"require": {
"php": "^7.1 || ^8",
"silverstripe/vendor-plugin": "^1",
"silverstripe/vendor-plugin": "^1.6",
"silverstripe/framework": "^4.7",
"silverstripe/admin": "^1",
"silverstripe/versioned": "^1.7",
Expand All @@ -42,7 +42,7 @@
"silverstripe/cms": "Localise pages"
},
"require-dev": {
"silverstripe/recipe-testing": "^1 || ^2"
"silverstripe/recipe-testing": "^2"
},
"extra": {
"branch-alias": {
Expand All @@ -63,5 +63,12 @@
"lint-clean": "phpcbf src/ tests/php/"
},
"prefer-stable": true,
"minimum-stability": "dev"
"minimum-stability": "dev",
"config": {
"allow-plugins": {
"composer/installers": true,
"silverstripe/recipe-plugin": true,
"silverstripe/vendor-plugin": true
}
}
}
2 changes: 1 addition & 1 deletion lang/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ en:
LOCALECOPYANDPUBLISH: 'Copy & publish'
LOCALECOPYTODRAFT: 'Copy to draft'
LOCALESTATUSFLUENTDRAFT: 'A draft has been created for this locale, however, published content may still be inherited from another. To publish this content for this locale, use the "Save & publish" action provided.'
LOCALESTATUSFLUENTINHERITED: 'Content for this page may be inherited from another locale. If you wish you make an independent copy of this page, please use one of the "Copy" actions provided.'
LOCALESTATUSFLUENTINHERITED: 'Content for this page may be inherited from another locale. If you wish to make an independent copy of this page, please use one of the "Copy" actions provided.'
LOCALESTATUSFLUENTINVISIBLE: 'This page will not be visible in this locale until it has been published.'
LOCALESTATUSFLUENTUNKNOWN: 'No content is available for this page. Please localise this page or provide a locale fallback.'
TractorCow\Fluent\Extension\FluentVersionedExtension:
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "4.0.0",
"description": "Fluent localisation module for SilverStrip CMS",
"engines": {
"node": "^6.x"
"node": "^10.x"
},
"scripts": {
"build": "NODE_ENV=production webpack -p --bail --progress",
Expand All @@ -27,6 +27,7 @@
},
"homepage": "https://github.com/tractorcow-farm/silverstripe-fluent",
"devDependencies": {
"@silverstripe/eslint-config": "^0.0.5",
"@silverstripe/webpack-config": "^0.4.1"
},
"dependencies": {
Expand Down
26 changes: 15 additions & 11 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
<phpunit bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true">
<testsuite name="Default">
<directory>tests/php/</directory>
</testsuite>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/silverstripe/cms/tests/bootstrap.php"
colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage includeUncoveredFiles="true">
<include>
<directory suffix=".php">src/</directory>
<exclude>
<directory suffix=".php">tests/</directory>
</exclude>
</whitelist>
</filter>
</include>
<exclude>
<directory suffix=".php">tests/</directory>
</exclude>
</coverage>
<testsuites>
<testsuite name="Default">
<directory>tests/</directory>
</testsuite>
</testsuites>
</phpunit>
13 changes: 13 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
# yarn lockfile v1


"@silverstripe/eslint-config@^0.0.5":
version "0.0.5"
resolved "https://registry.yarnpkg.com/@silverstripe/eslint-config/-/eslint-config-0.0.5.tgz#ab94d58e6f328d4efbcc1910572fdff5d85fc4ec"
integrity sha512-3wpbmrK3trKpTaJhEZuh5mEKkP7fBtQ5D61nJ1BvoNUZ2CFM16pXgKHe9NQM+ct/sQxL1Ag7dANq3jjnn6OM+w==
dependencies:
eslint "^4.6.1"
eslint-config-airbnb "^15.1.0"
eslint-config-airbnb-base "^12.0.0"
eslint-loader "^1.7.1"
eslint-plugin-import "^2.7.0"
eslint-plugin-jsx-a11y "^5.1.1"
eslint-plugin-react "^7.3.0"

"@silverstripe/webpack-config@^0.4.1":
version "0.4.1"
resolved "https://registry.yarnpkg.com/@silverstripe/webpack-config/-/webpack-config-0.4.1.tgz#87b5a7fb9b04148316485d850a9a0ef2654f486e"
Expand Down

0 comments on commit c042104

Please sign in to comment.