Skip to content

Commit

Permalink
Merge branch '10.0/bugfixes'
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Jun 27, 2024
2 parents e9001a9 + 79ae6e2 commit ba4a78d
Show file tree
Hide file tree
Showing 11 changed files with 274 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"label": "GLPI"
},
"8090": {
"label": "Adminer"
"label": "DBGate"
},
"8025": {
"label": "Mailpit"
Expand Down
19 changes: 13 additions & 6 deletions .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,22 @@ services:
ports:
- "8025:8025"

adminer:
container_name: "glpi-adminer"
image: "adminer:latest"
dbgate:
container_name: "glpi-dbgate"
image: "dbgate/dbgate:latest"
restart: "unless-stopped"
ports:
- "8090:8080"
- "8090:3000"
environment:
- "ADMINER_DEFAULT_SERVER=db"
command: ["php", "-S", "0.0.0.0:8080", "-t", "/var/www/html"]
CONNECTIONS: con_glpi

LABEL_con_glpi: GLPI Mysql Server
SERVER_con_glpi: db
USER_con_glpi: root
PASSWORD_con_glpi: glpi
PORT_con_glpi: 3306
ENGINE_con_glpi: mysql@dbgate-plugin-mysql


volumes:
db:
12 changes: 12 additions & 0 deletions .github/workflows/coverage-schedule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Code coverage schedule"

on:
schedule:
- cron: '0 0 * * *'

jobs:
run-coverage-workflow:
name: "Run coverage workflow"
uses: "glpi-project/glpi/.github/workflows/coverage.yml@main"
with:
branch: "main"
26 changes: 14 additions & 12 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
name: "GLPI test code coverage"

on:
# Runs coverage suite when a pull request updates workflow file
pull_request:
paths:
- ".github/workflows/coverage.yml"
# Runs coverage suite every night
schedule:
- cron: '0 0 * * *'
# Enable execution from the "Code coverage schedule" workflow
workflow_call:
inputs:
branch:
required: true
type: string
# Enable manual run
workflow_dispatch:
inputs:
branch:
description: "Target branch"
required: true
type: string

jobs:
coverage:
# Do not run scheduled coverage on tier repositories
if: github.repository == 'glpi-project/glpi' || github.event_name != 'schedule'
name: "Code coverage"
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
include:
- {branch: "main", php-version: "8.2", db-image: "mariadb:11.0"}
- {php-version: "8.2", db-image: "mariadb:11.0"}
env:
COMPOSE_FILE: ".github/actions/docker-compose-app.yml:.github/actions/docker-compose-services.yml"
APPLICATION_ROOT: "${{ github.workspace }}"
Expand All @@ -36,7 +38,7 @@ jobs:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
ref: ${{ matrix.branch }}
ref: ${{ inputs.branch }}
- name: "Restore dependencies cache"
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -76,4 +78,4 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./tests/coverage-functional/clover.xml,./tests/coverage-ldap/clover.xml,./tests/coverage-imap/clover.xml
override_branch: ${{ matrix.branch }}
override_branch: ${{ inputs.branch }}
4 changes: 2 additions & 2 deletions js/impact.js
Original file line number Diff line number Diff line change
Expand Up @@ -2593,8 +2593,8 @@ var GLPIImpact = {
*/
addCompoundFromSelection: _.debounce(function(){
// Check that there is enough selected nodes
if (GLPIImpact.eventData.boxSelected.length < 2) {
alert(__("You need to select at least 2 assets to make a group"));
if (GLPIImpact.eventData.boxSelected.length < 1) {
alert(__("You need to select at least 1 asset to make a group"));
} else {
// Create the compound
var newCompound = GLPIImpact.cy.add({
Expand Down
5 changes: 5 additions & 0 deletions src/AllAssets.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,9 @@ public static function getTypeName($nb = 0)
{
return _n('Asset', 'Assets', $nb);
}

public static function getIcon()
{
return 'ti ti-packages';
}
}
2 changes: 1 addition & 1 deletion src/Html.php
Original file line number Diff line number Diff line change
Expand Up @@ -1446,7 +1446,7 @@ public static function generateMenuSession($force = false)
$menu['assets']['content']['allassets']['title'] = __('Global');
$menu['assets']['content']['allassets']['shortcut'] = '';
$menu['assets']['content']['allassets']['page'] = '/front/allassets.php';
$menu['assets']['content']['allassets']['icon'] = 'fas fa-list';
$menu['assets']['content']['allassets']['icon'] = AllAssets::getIcon();
$menu['assets']['content']['allassets']['links']['search'] = '/front/allassets.php';
break;
}
Expand Down
Loading

0 comments on commit ba4a78d

Please sign in to comment.