Skip to content

Commit

Permalink
Merge branch 'Islandora:2.x' into 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ajstanley authored Apr 27, 2024
2 parents f3b5211 + c807695 commit c8827f6
Show file tree
Hide file tree
Showing 90 changed files with 434 additions and 325 deletions.
50 changes: 26 additions & 24 deletions .github/workflows/build-2.x.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the 2.x branch
push:
branches: [ 2.x ]
pull_request:
branches: [ 2.x ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
env:
DRUPAL_VERSION: ${{ matrix.drupal-version }}
SCRIPT_DIR: ${{ github.workspace }}/islandora_ci
DRUPAL_DIR: /opt/drupal
PHPUNIT_FILE: ${{ github.workspace }}/build_dir/phpunit.xml

runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allowed_failure }}
strategy:
fail-fast: false
matrix:
php-versions: ["8.1", "8.2"]
# test-suite functional-javascript will appear to pass but will skip tests; missing chromedriver.
php-versions: ["8.1", "8.2", "8.3"]
test-suite: ["kernel", "functional", "functional-javascript"]
drupal-version: ["10.0.x", "10.1.x", "10.2.x-dev"]
drupal-version: ["10.1.x", "10.2.x", "10.3.x-dev"]
mysql: ["8.0"]
allowed_failure: [false]
exclude:
- php-versions: "8.3"
drupal-version: "10.1.x"


name: PHP ${{ matrix.php-versions }} | drupal ${{ matrix.drupal-version }} | mysql ${{ matrix.mysql }} | test-suite ${{ matrix.test-suite }}
Expand All @@ -48,17 +47,15 @@ jobs:
- 61616:61616
- 61613:61613

# Steps represent a sequence of tasks that will be executed as part of the job
steps:

# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: build_dir

- name: Checkout islandora_ci
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: islandora/islandora_ci
ref: github-actions
Expand All @@ -76,13 +73,6 @@ jobs:
sudo apt-get remove -y mysql-client mysql-common
sudo apt-get install -y mysql-client
- name: Set environment variables
run: |
echo "DRUPAL_VERSION=${{ matrix.drupal-version }}" >> $GITHUB_ENV
echo "SCRIPT_DIR=$GITHUB_WORKSPACE/islandora_ci" >> $GITHUB_ENV
echo "DRUPAL_DIR=/opt/drupal" >> $GITHUB_ENV
echo "PHPUNIT_FILE=$GITHUB_WORKSPACE/build_dir/phpunit.xml" >> $GITHUB_ENV
- name: Cache Composer dependencies
uses: actions/cache@v3
with:
Expand All @@ -109,15 +99,27 @@ jobs:
run: |
cd $DRUPAL_DIR/web
drush --uri=127.0.0.1:8282 en -y islandora_audio islandora_breadcrumbs islandora_iiif islandora_image islandora_video islandora_text_extraction_defaults
drush --uri=127.0.0.1:8282 fim -y islandora_core_feature,islandora_text_extraction_defaults
- name: Copy PHPunit file
run: cp $PHPUNIT_FILE $DRUPAL_DIR/web/core/phpunit.xml

- name: Test scripts
run: $SCRIPT_DIR/travis_scripts.sh

- name: Start chromedriver
if: matrix.test-suite == 'functional-javascript'
run: |-
/usr/local/share/chromedriver-linux64/chromedriver \
--log-path=/tmp/chromedriver.log \
--verbose \
--allowed-ips= \
--allowed-origins=* &
- name: PHPUNIT tests
run: |
cd $DRUPAL_DIR/web/core
$DRUPAL_DIR/vendor/bin/phpunit --verbose --testsuite "${{ matrix.test-suite }}"
- name: Print chromedriver logs
if: matrix.test-suite == 'functional-javascript'
run: cat /tmp/chromedriver.log
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"drupal/context": "^4 || ^5@RC",
"drupal/ctools": "^3.8 || ^4",
"drupal/eva" : "^3.0",
"drupal/features" : "^3.13",
"drupal/file_replace": "^1.1",
"drupal/filehash": "^2",
"drupal/flysystem" : "^2.0@alpha",
Expand Down
1 change: 0 additions & 1 deletion islandora.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ dependencies:
- drupal:text
- drupal:views_ui
- eva:eva
- features:features_ui
- file_replace:file_replace
- filehash:filehash
- flysystem:flysystem
Expand Down
1 change: 1 addition & 0 deletions islandora.module
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,7 @@ function islandora_form_block_form_alter(&$form, FormStateInterface $form_state,
unset($form['visibility']['media_is_islandora_media']);
unset($form['visibility']['media_uses_filesystem']);
unset($form['visibility']['node_had_namespace']);
unset($form['visibility']['node_has_ancestor']);
unset($form['visibility']['node_has_parent']);
unset($form['visibility']['node_has_term']);
unset($form['visibility']['node_is_islandora_object']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function testGenerateAudioDerivativeFromScratch() {
// Create an action to generate a audio derivative.
$this->drupalGet('admin/config/system/actions');
$this->getSession()->getPage()->findById("edit-action")->selectOption("Generate a audio derivative");
$this->getSession()->getPage()->pressButton($this->t('Create'));
$this->getSession()->getPage()->pressButton('Create');
$this->assertSession()->statusCodeEquals(200);

$this->getSession()->getPage()->fillField('edit-label', "Generate audio test derivative");
Expand All @@ -53,7 +53,7 @@ public function testGenerateAudioDerivativeFromScratch() {
$this->getSession()->getPage()->fillField('edit-args', "-f mp3");
$this->getSession()->getPage()->fillField('edit-scheme', "public");
$this->getSession()->getPage()->fillField('edit-path', "derp.mov");
$this->getSession()->getPage()->pressButton($this->t('Save'));
$this->getSession()->getPage()->pressButton('Save');
$this->assertSession()->statusCodeEquals(200);

// Create a context and add the action as a derivative reaction.
Expand All @@ -69,7 +69,7 @@ public function testGenerateAudioDerivativeFromScratch() {
'field_media_use[0][target_id]' => $this->preservationMasterTerm->label(),
];
$this->drupalGet('media/add/' . $this->testMediaType->id());
$this->submitForm($values, $this->t('Save'));
$this->submitForm($values, 'Save');

$expected = [
'source_uri' => 'test_file.txt',
Expand Down

This file was deleted.

16 changes: 0 additions & 16 deletions modules/islandora_core_feature/islandora_core_feature.features.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ dependencies:
- drupal:basic_auth
- drupal:content_translation
- drupal:eva
- drupal:features
- drupal:field
- drupal:file
- drupal:filehash
Expand Down
19 changes: 17 additions & 2 deletions modules/islandora_iiif/config/schema/islandora_iiif.schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,28 @@ islandora_iiif.settings:
type: string
label: 'IIIF Server Url'
use_relative_paths:
type: boolean
label: 'Use relative paths in manifest.'
type: boolean
label: 'Use relative paths in manifest.'
show_title:
type: string
label: 'Show title in view'

views.style.iiif_manifest:
type: views_style
mapping:
iiif_tile_field:
type: sequence
label: "Tile source field(s)"
sequence:
type: string
iiif_ocr_file_field:
type: sequence
label: "Structured OCR data file field"
sequence:
type: string
structured_text_term_uri:
type: string
label: "Structured text term"
search_endpoint:
type: string
label: "Search endpoint path"
14 changes: 14 additions & 0 deletions modules/islandora_iiif/src/Form/IslandoraIIIFConfigForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public function getFormId() {
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$options = [
'none' => $this->t('None'),
'view' => $this->t("From view title"),
'node' => $this->t("From node title"),
];
$config = $this->config('islandora_iiif.settings');
$form['iiif_server'] = [
'#type' => 'url',
Expand All @@ -84,6 +89,14 @@ public function buildForm(array $form, FormStateInterface $form_state) {
'#default_value' => $config->get('use_relative_paths'),
];

$form['show_title'] = [
'#type' => 'select',
'#options' => $options,
'#title' => $this->t("Show title in viewer."),
'#description' => $this->t("Show title on your viewer, if viewer allows"),
'#default_value' => $config->get('show_title'),
];

return parent::buildForm($form, $form_state);
}

Expand Down Expand Up @@ -111,6 +124,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
$this->config('islandora_iiif.settings')
->set('iiif_server', $form_state->getValue('iiif_server'))
->set('use_relative_paths', $form_state->getValue('use_relative_paths'))
->set('show_title', $form_state->getValue('show_title'))
->save();
}

Expand Down
Loading

0 comments on commit c8827f6

Please sign in to comment.