Skip to content

Commit

Permalink
Merge pull request #618 from art-institute-of-chicago/feature/node-up…
Browse files Browse the repository at this point in the history
…date

Node update
  • Loading branch information
nikhiltri authored Nov 22, 2024
2 parents 4cc252d + c519642 commit 837d474
Show file tree
Hide file tree
Showing 87 changed files with 10,886 additions and 14,560 deletions.
6 changes: 6 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ KIOSK_DOMAIN='kiosk.artic.edu'
TWILL_DEV_MODE=''
LOG_LEVEL='debug'

# Needed for twill:build
# See: https://github.com/area17/twill/issues/2329
NODE_OPTIONS='--openssl-legacy-provider'


DB_CONNECTION='mysql'
DB_HOST='127.0.0.1'
DB_PORT=3306
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ on: [push]
jobs:
test:
runs-on: ubuntu-22.04
env:
NODE_OPTIONS: '--openssl-legacy-provider'
CI: 1
steps:
- name: Install PHP
uses: shivammathur/setup-php@v2
Expand All @@ -11,9 +14,7 @@ jobs:
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 8.10.0
- name: Install NPM
run: npm install --global [email protected]
node-version: lts/iron
- name: Install Postgres
id: postgres
uses: ikalnytskyi/action-setup-postgres@v4
Expand Down Expand Up @@ -44,6 +45,6 @@ jobs:
- name: Build Twill assets
run: php artisan twill:build --env=testing
- name: Build Javascript assets
run: npm run build
run: npm run build:dev
- name: Run PHPUnit
run: php artisan test --env=testing
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
.phpunit.result.cache
Homestead.json
Homestead.yaml
bundle-stats.json
auth.json
npm-debug.log
yarn-error.log
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.17.0
lts/iron
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ For continuous work, run the following which runs as a `watch` command on locall
npm run dev
```

These npm scripts are likely to be all you'll need, but they are composite commands and more granular scripts can be found by inspecting the `scripts` section of [package.json](package.json).


We recommend using [nvm](https://github.com/nvm-sh/nvm) or another node version manager to install exactly the node version listed in the requirements.


Expand All @@ -90,15 +93,6 @@ php artisan twill:build
```


### Style guide

Run this command to generate a style guide that will be served from http://{your_dev_domain}/styleguide

```bash
npm run toolkit
```


### Upgrading Twill

Update the version of Twill in `composer.json`. Then to avoid composer running into memory issues, run:
Expand Down
16 changes: 16 additions & 0 deletions app/Helpers/FrontendHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,20 @@ public static function dist_path($file = null)
{
return base_path() . '/public' . config('twill.frontend.dist_assets_path') . (!empty($file) ? '/' . $file : '');
}

public static function ip($array)
{
foreach ($array as $value) {
if (is_array($value)) {
if (isset($value['broadcast']) && isset($value['address'])) {
return $value['address'];
}

$result = static::ip($value);
if ($result !== null) {
return $result;
}
}
}
}
}
10 changes: 1 addition & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"package": {
"type": "metapackage",
"name": "vendor/package-patches",
"version": "1.3.0",
"version": "1.4.0",
"require": {
"netresearch/composer-patches-plugin": "~1.2"
},
Expand All @@ -33,14 +33,6 @@
{
"title": "WEB-2103: Get repository model of API models",
"url": "patches/WEB-2301---get-repository-of-API-models.diff"
},
{
"title": "WEB-2638: Backport Node 14 syntax",
"url": "patches/WEB-2638---backport-node-14-syntax.diff"
},
{
"title": "WEB-2678: Backport Node 10 syntax",
"url": "patches/WEB-2678---backport-node-10-syntax.diff"
}
]
}
Expand Down
12 changes: 2 additions & 10 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

use Illuminate\Support\Facades\Facade;
use Illuminate\Support\ServiceProvider;
use App\Helpers\FrontendHelpers;

$interfaces = net_get_interfaces();
$ip = FrontendHelpers::ip($interfaces);

return [

Expand Down Expand Up @@ -53,7 +57,7 @@
| this list will be redirected to www.
|
*/
'allowed_domains' => array_map('trim', explode(',', env('ALLOWED_DOMAINS', env('APP_URL', 'www.artic.edu')))),
'allowed_domains' => array_merge(array_map('trim', explode(',', env('ALLOWED_DOMAINS', env('APP_URL', 'www.artic.edu')))), [$ip]),

/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion frontend/icons/audio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 6 additions & 8 deletions frontend/icons/proof-of-vaccination.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions frontend/icons/showing-symptoms.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 2 additions & 5 deletions frontend/icons/slideshow--24.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/icons/video.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 9 additions & 12 deletions frontend/icons/view-mirador.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 6 additions & 9 deletions frontend/icons/view360.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion frontend/js/behaviors/interactiveFeature/closerLook.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import ReactDOM from 'react-dom';
import 'intersection-observer';
import React from 'react';
import CloserLook, { Modal } from 'closer-look';
import getAbsoluteHeight from '../../functions/core/getAbsoluteHeight';
Expand Down
2 changes: 1 addition & 1 deletion frontend/js/functions/core/ajaxRequestCustom.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import queryStringHandler from '@area17/a17-helpers';
import { queryStringHandler } from '@area17/a17-helpers';

/**
* This is a modification of A17's `ajaxRequest` that allows us to detect redirects.
Expand Down
12 changes: 9 additions & 3 deletions frontend/scss/atoms/_deflist.scss
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,18 @@ Demonstrated in **statics/article**

.deflist .f-module-title-1 {
@include tucked-margin-top($f-module-title-1, ('xsmall': 28));
display: block;

& {
display: block;
}
}

.deflist .f-secondary {
@include tucked-margin-top($f-secondary, ('xsmall': 24, 'small+': 28));
display: block;

& {
display: block;
}
}


Expand All @@ -181,4 +187,4 @@ Demonstrated in **statics/article**
&:active:hover {
@include text-underline(1.02em, $color__link--active);
}
}
}
Loading

0 comments on commit 837d474

Please sign in to comment.