Skip to content

Commit

Permalink
github flows
Browse files Browse the repository at this point in the history
  • Loading branch information
sigere committed Aug 11, 2024
1 parent fb0ec61 commit ebe956f
Show file tree
Hide file tree
Showing 58 changed files with 7,206 additions and 2,497 deletions.
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
KERNEL_CLASS='App\Kernel'
APP_SECRET='$ecretf0rt3st'
APP_DEBUG=false
APP_ENV=test
SYMFONY_DEPRECATIONS_HELPER=999999
PANTHER_APP_ENV=panther
PANTHER_ERROR_SCREENSHOT_DIR=./var/error-screenshots
47 changes: 20 additions & 27 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on: pull_request

env:
DATABASE_URL: "sqlite:///%kernel.project_dir%/var/data.db"
APP_ENV: test

jobs:
php-cs-fixer:
Expand All @@ -11,12 +12,8 @@ jobs:
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'

- name: Checkout Repository
uses: actions/checkout@v1

- name: Check
run: |
- uses: actions/checkout@v1
- run: |
composer install
./vendor/bin/php-cs-fixer fix --dry-run --diff
Expand All @@ -26,24 +23,20 @@ jobs:
- uses: shivammathur/setup-php@v2
with:
php-version: '8.3'

- name: Checkout Repository
uses: actions/checkout@v1

- name: Install Dependencies
run: composer install --no-interaction

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.16
cache: 'npm'

- run: npm install

- run: npm run build

- run: npm ci

- name: PHPUnit
run: ./vendor/bin/phpunit
- uses: actions/checkout@v1
- run: composer install --no-interaction
- run: |
./bin/console doctrine:database:create
./bin/console doctrine:schema:create
- run: ./vendor/bin/phpunit

# standard-js:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/setup-node@v4
# with:
# node-version: 20.16
# cache: 'npm'
# - run: npm install
# - run: npm run build
# - run: npm ci
2 changes: 2 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
'no_whitespace_in_blank_line' => false,
])
->setFinder($finder)
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
->setCacheFile('./var/cache/php-cs-fixer.cache')
;
25 changes: 12 additions & 13 deletions assets/Evenets/controller-connected_event.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import {Controller} from "@hotwired/stimulus";
import { Controller } from '@hotwired/stimulus'

export default class ControllerConnectedEvent extends CustomEvent
{
constructor(controller) {
if (!(controller instanceof Controller)) {
throw new Error('Controller must be instance of stimulus controller.');
}

super(controller.identifier + ':connected', {
controller: controller,
bubbles: true
});
export default class ControllerConnectedEvent extends CustomEvent {
constructor (controller) {
if (!(controller instanceof Controller)) {
throw new Error('Controller must be instance of stimulus controller.')
}
}

super(controller.identifier + ':connected', {
controller,
bubbles: true
})
}
}
41 changes: 20 additions & 21 deletions assets/app.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
import 'bootstrap';
import './bootstrap.js';
import './styles/app.css';
import $ from "jquery";
import "tablesorter"
import 'bootstrap'
import './bootstrap.js'
import './styles/app.css'
import $ from 'jquery'
import 'tablesorter'

export const ajaxDelay = 300;
export function executeAfter(executable, stamp) {
if (stamp === undefined) {
stamp = Date.now() + ajaxDelay;
}
setTimeout(
executable,
(stamp - Date.now()) > 0 ? (stamp - Date.now()) : 0
);
export const ajaxDelay = 300
export function executeAfter (executable, stamp) {
if (stamp === undefined) {
stamp = Date.now() + ajaxDelay
}
setTimeout(
executable,
(stamp - Date.now()) > 0 ? (stamp - Date.now()) : 0
)
}

$.tablesorter.defaults.dateFormat = 'ddmmyyyy';
$.tablesorter.defaults.dateFormat = 'ddmmyyyy'

let sidebar = $("#sidebar");
const sidebar = $('#sidebar')
sidebar.mouseover(function () {
sidebar.toggleClass("active", false);
});
sidebar.toggleClass('active', false)
})
sidebar.mouseout(function () {
sidebar.toggleClass("active", true);

});
sidebar.toggleClass('active', true)
})
10 changes: 5 additions & 5 deletions assets/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { startStimulusApp } from '@symfony/stimulus-bridge';
import { startStimulusApp } from '@symfony/stimulus-bridge'

// Registers Stimulus controllers from controllers.json and in the controllers/ directory
export const app = startStimulusApp(require.context(
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
true,
/\.[jt]sx?$/
));
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
true,
/\.[jt]sx?$/
))
// register any custom, 3rd party controllers here
// app.register('some_controller_name', SomeImportedController);
130 changes: 65 additions & 65 deletions assets/components/custom_select.js
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
import $ from "jquery";
import $ from 'jquery'

$(".filters-form select").each(function () {
if ($(this).hasClass("js-no-transformation")) {
return;
}
$('.filters-form select').each(function () {
if ($(this).hasClass('js-no-transformation')) {
return
}

let self = this;
let boundListener = scrollToElement.bind(self);
$.extend(self, {
removeListener: function () {
document.body.removeEventListener("keypress", boundListener);
}
});
const self = this
const boundListener = scrollToElement.bind(self)
$.extend(self, {
removeListener: function () {
document.body.removeEventListener('keypress', boundListener)
}
})

let $this = $(this);
let numberOfOptions = $(this).children("option").length;
let currentText = $(this).find(":selected").text();
const $this = $(this)
const numberOfOptions = $(this).children('option').length
const currentText = $(this).find(':selected').text()

$this.addClass("hidden");
$this.wrap("<div class=\"select\"></div>");
$this.after("<div class=\"select-styled\"></div>");
$this.addClass('hidden')
$this.wrap('<div class="select"></div>')
$this.after('<div class="select-styled"></div>')

let $styledSelect = $this.next("div.select-styled");
$styledSelect.text($this.children("option").eq(0).text());
const $styledSelect = $this.next('div.select-styled')
$styledSelect.text($this.children('option').eq(0).text())

let $list = $("<ul />", {
"class": "select-options"
}).insertAfter($styledSelect);
const $list = $('<ul />', {
class: 'select-options'
}).insertAfter($styledSelect)

for (let i = 0; i < numberOfOptions; i++) {
$("<li />", {
text: $this.children("option").eq(i).text(),
rel: $this.children("option").eq(i).val()
}).appendTo($list);
}
for (let i = 0; i < numberOfOptions; i++) {
$('<li />', {
text: $this.children('option').eq(i).text(),
rel: $this.children('option').eq(i).val()
}).appendTo($list)
}

let $listItems = $list.children("li");
const $listItems = $list.children('li')

$styledSelect.click(function (e) {
e.stopPropagation();
document.body.addEventListener("keypress", boundListener);
$("div.select-styled.active").not(this).each(function () {
$(this).removeClass("active").next("ul.select-options").hide();
let listenerHolder = $(this).prev("select")[0];
listenerHolder.removeListener();
});
$(this).toggleClass("active").next("ul.select-options").toggle();
});
$styledSelect.click(function (e) {
e.stopPropagation()
document.body.addEventListener('keypress', boundListener)
$('div.select-styled.active').not(this).each(function () {
$(this).removeClass('active').next('ul.select-options').hide()
const listenerHolder = $(this).prev('select')[0]
listenerHolder.removeListener()
})
$(this).toggleClass('active').next('ul.select-options').toggle()
})

$listItems.click(function (e) {
e.stopPropagation();
$styledSelect.text($(this).text()).removeClass("active");
$this.val($(this).attr("rel"));
$list.hide();
$this.trigger("change");
});
$listItems.click(function (e) {
e.stopPropagation()
$styledSelect.text($(this).text()).removeClass('active')
$this.val($(this).attr('rel'))
$list.hide()
$this.trigger('change')
})

$(document).click(function () {
document.body.removeEventListener("keypress", boundListener);
$styledSelect.removeClass("active");
$list.hide();
});
$styledSelect.text(currentText);
});
$(document).click(function () {
document.body.removeEventListener('keypress', boundListener)
$styledSelect.removeClass('active')
$list.hide()
})
$styledSelect.text(currentText)
})

function scrollToElement(e) {
let letter = e.key.toUpperCase();
let $div = $(this).next().next();
let $children = $div.children();
for (let i = 0; i < $children.length; i++) {
let currentFirstLetter = Array.from($children[i].innerHTML)[0].toUpperCase();
if (currentFirstLetter === letter) {
$div[0].scrollTop = $children[i].offsetTop - 20;
return;
}
function scrollToElement (e) {
const letter = e.key.toUpperCase()
const $div = $(this).next().next()
const $children = $div.children()
for (let i = 0; i < $children.length; i++) {
const currentFirstLetter = Array.from($children[i].innerHTML)[0].toUpperCase()
if (currentFirstLetter === letter) {
$div[0].scrollTop = $children[i].offsetTop - 20
return
}
}
}
}
Loading

0 comments on commit ebe956f

Please sign in to comment.