Skip to content

Commit

Permalink
Merge branch '2' into 3
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Jun 20, 2024
2 parents 638edb1 + 9f84f95 commit 5b7b848
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 22 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/add-prs-to-project.yml
Original file line number Diff line number Diff line change
@@ -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 }}
1 change: 0 additions & 1 deletion .stylelintignore

This file was deleted.

4 changes: 2 additions & 2 deletions client/src/bundles/bundle.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
@import "variables";

// Import all of your SCSS stylesheets using relative paths from "components"
@import "../components/LoginSession/LoginSession.scss";
@import "../components/SessionManagerField/SessionManagerField.scss";
@import "../components/LoginSession/LoginSession";
@import "../components/SessionManagerField/SessionManagerField";

// Import any legacy SCSS stylesheets
// e.g. @import '../styles/MyComponent-ModelAdmin-legacy.scss
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"css": "WEBPACK_CHILD=css npm run build",
"test": "jest",
"coverage": "jest --coverage",
"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"
Expand All @@ -32,7 +32,7 @@
},
"devDependencies": {
"@babel/runtime": "^7.20.1",
"@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.3.0",
Expand Down
2 changes: 1 addition & 1 deletion src/FormFields/SessionManagerField.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function setTitleLinkHref(string $titleLinkHref)

public function Field($properties = array())
{
return $this->renderWith(self::class);
return $this->renderWith(SessionManagerField::class);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Jobs/GarbageCollectionJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public function requireDefaultJob(): void

private function queueNextJob(): void
{
$timestamp = time() + self::config()->get('seconds_between_jobs');
$timestamp = time() + static::config()->get('seconds_between_jobs');
QueuedJobService::singleton()->queueJob(
Injector::inst()->create(self::class),
Injector::inst()->create(GarbageCollectionJob::class),
DBDatetime::create()->setValue($timestamp)->Rfc2822()
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Models/LoginSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ public function getFriendlyUserAgent(): string
* @param HTTPRequest|null $request
* @return LoginSession|null
*/
public static function getCurrentLoginSession(?HTTPRequest $request = null): ?self
public static function getCurrentLoginSession(?HTTPRequest $request = null): ?LoginSession
{
// Fall back to retrieving request from current Controller if available
if ($request === null) {
Expand Down
2 changes: 1 addition & 1 deletion src/Services/GarbageCollectionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function collect(): void

private function batchRemoveAll($datalist)
{
$limit = self::config()->get('batch_remove_limit');
$limit = static::config()->get('batch_remove_limit');
$limitedList = $datalist->limit($limit);
DB::get_conn()->transactionStart();
foreach ($limitedList as $record) {
Expand Down
16 changes: 8 additions & 8 deletions tests/php/Extensions/ForcePermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ class ForcePermission extends DataExtension implements TestOnly

public static function forceCanView($val)
{
self::$canView = $val;
ForcePermission::$canView = $val;
}

public static function forceCanDelete($val)
{
self::$canDelete = $val;
ForcePermission::$canDelete = $val;
}

public static function reset()
{
self::$canView = null;
self::$canDelete = null;
ForcePermission::$canView = null;
ForcePermission::$canDelete = null;
}

public function canView($member)
{
if (self::$canView !== null) {
return self::$canView;
if (ForcePermission::$canView !== null) {
return ForcePermission::$canView;
}
}

public function canDelete($member)
{
if (self::$canDelete !== null) {
return self::$canDelete;
if (ForcePermission::$canDelete !== null) {
return ForcePermission::$canDelete;
}
}
}
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1573,10 +1573,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"
Expand Down

0 comments on commit 5b7b848

Please sign in to comment.