Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhiltri committed Aug 28, 2020
2 parents b33f32c + ddd2e78 commit fa13b0b
Show file tree
Hide file tree
Showing 134 changed files with 16,913 additions and 12,667 deletions.
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ SENTRY_LARAVEL_DSN=
# Prototype search algorithm:
SEARCH_BOOST_ARTIST_TITLES=

# Docs passthrough to GitHub Pages:
DOCS_URL=

# Feature flags:
IMPORT_ASSET_RELATIONSHIPS_FROM_CITI=

# Unused Laravel default configs:
CACHE_DRIVER='file'
SESSION_DRIVER='file'
Expand Down
5 changes: 3 additions & 2 deletions .env.travis
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost

DB_CONNECTION=sqlite
DB_DATABASE=:memory:
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=

SCOUT_DRIVER=null
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,15 @@ Envoy.blade.php

/public/js
/public/css

pids
logs
coverage/
run
dist
.DS_Store
.nyc_output
.basement
config.local.js
basement_dist
/public/docs
50 changes: 36 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
language: php

php:
- 7.1

before_script:
- cp .env.travis .env
- composer self-update
- composer install --no-interaction
- php artisan key:generate
- php artisan migrate

script:
- vendor/bin/phpunit
matrix:
include:
- language: php

php:
- 7.2

services:
- mysql

before_script:
- cp .env.travis .env
- sudo mysql -e 'create database testing;'
- composer self-update
- composer install --no-interaction
- php artisan key:generate
- php artisan migrate

script:
- vendor/bin/phpunit

- language: node_js
node_js:
- lts/*
install:
- yarn install # npm ci
script:
- yarn docs-build # npm run docs:build
deploy:
provider: pages
skip_cleanup: true
local_dir: docs/.vuepress/dist
github_token: $GITHUB_TOKEN # A token generated on GitHub allowing Travis to push code on you repository. Set in the Travis settings page of your repository, as a secure variable
keep_history: false
on:
branch: develop
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ To import all data from all systems, run:
php artisan import:all
```

### Compiling documentation

```bash
npm run docs-dev
npm run docs-build
```

## Contributing

Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0-rc16
8 changes: 8 additions & 0 deletions app/Console/Commands/BaseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ protected function getModelsForNamespace($desiredNamespace)
->filter(function ($modelNamespace, $model) use ($desiredNamespace) {
return $modelNamespace === $desiredNamespace;
})
->filter(function ($modelNamespace, $model) {
// Filter out classes that extend CategoryTerm
return get_parent_class($model) !== 'App\Models\Collections\CategoryTerm';
})
->keys();
}

Expand All @@ -52,6 +56,10 @@ protected function getModels()
})
->pluck('model')
->unique()
->filter(function ($model) {
// Filter out classes that extend CategoryTerm
return get_parent_class($model) !== 'App\Models\Collections\CategoryTerm';
})
->filter()
->values()
->map(function ($model) {
Expand Down
21 changes: 7 additions & 14 deletions app/Console/Commands/Docs/CreateEndpointDocs.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,35 +8,28 @@
class CreateEndpointDocs extends AbstractDocCommand
{

protected $signature = 'docs:endpoints
{appUrl? : The root URL to use for the documentation. Defaults to APP_URL}';
protected $signature = 'docs:endpoints';

protected $description = 'Generate documentation for API endpoints';

protected $appUrl;

public function handle()
{
if ($this->argument('appUrl'))
{
$this->appUrl = $this->argument('appUrl');
}

$doc = '';
$doc = "## Endpoints\n\n";

foreach ($this->getCategories() as $namespace => $heading)
{
$doc .= "## ${heading}\n\n";
$doc .= "### ${heading}\n\n";

foreach ($this->getModelsForNamespace($namespace) as $model)
{
$doc .= $model::instance()->docEndpoints($this->appUrl);
$doc .= $model::instance()->docEndpoints();
}
}

$doc .= '_Generated by `php artisan docs:endpoints` on ' . Carbon::now() . "_\n";

Storage::disk('local')->put('ENDPOINTS.md', $doc);

copy(storage_path('app/ENDPOINTS.md'),
base_path('docs/.sections/endpoints.md'));
}

}
10 changes: 6 additions & 4 deletions app/Console/Commands/Docs/CreateFieldsDocs.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,23 @@ class CreateFieldsDocs extends AbstractDocCommand

public function handle()
{
$doc = '';
$doc = "## Fields\n\n";

foreach ($this->getCategories() as $namespace => $heading)
{
$doc .= "## ${heading}\n\n";
$doc .= "### ${heading}\n\n";

foreach ($this->getModelsForNamespace($namespace) as $model)
{
$doc .= $model::instance()->docFields();
}
}

$doc .= '_Generated by `php artisan docs:fields` on ' . Carbon::now() . "_\n";

Storage::disk('local')->put('FIELDS.md', $doc);

copy(storage_path('app/FIELDS.md'),
base_path('docs/.sections/fields.md'));

}

}
18 changes: 17 additions & 1 deletion app/Console/Commands/Docs/DownloadCssJs.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,28 @@ public function handle()
'fonts/3545D5_2_0.woff' => 'fonts/3545D5_2_0.woff',
'fonts/3545D5_2_0.woff2' => 'fonts/3545D5_2_0.woff2',
'fonts/3545D5_2_0.ttf' => 'fonts/3545D5_2_0.ttf',
'images/favicon-16.png' => 'images/favicon-16.png',
'images/favicon-152.png' => 'images/favicon-152.png',
'images/favicon-120.png' => 'images/favicon-120.png',
'images/favicon-76.png' => 'images/favicon-76.png',
]
);

foreach ($files as $vanityName => $fileName) {
$contents = file_get_contents('https://www.artic.edu/dist/' .$fileName);
Storage::disk('public')->put($vanityName, $contents);
Storage::disk('local')->put($vanityName, $contents);

$dest = base_path('docs/.vuepress/public/assets/' . $vanityName);

$path = pathinfo($dest);
if (!file_exists($path['dirname'])) {
mkdir($path['dirname'], 0777, true);
}

copy(storage_path('app/' . $vanityName),
$dest);
}

// @TODO: once the website is public, pull the logo SVG from the GitHub repo
}
}
68 changes: 1 addition & 67 deletions app/Console/Commands/Dump/AbstractDumpCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,72 +10,6 @@

abstract class AbstractDumpCommand extends BaseCommand
{
/**
* In the interest of defensive coding, you must explicitly whitelist
* which tables should be exported and imported. Use `dump:audit` to
* see a list of which tables will be excluded.
*/
protected $whitelistedTables = [
'agent_roles',
'agent_site',
'agent_types',
'agents',
'archival_images',
'articles',
'artist_product',
'artwork_artist',
'artwork_asset',
'artwork_catalogue',
'artwork_category',
'artwork_date_qualifiers',
'artwork_dates',
'artwork_exhibition',
'artwork_place',
'artwork_place_qualifiers',
'artwork_site',
'artwork_term',
'artwork_types',
'artworks',
'assets',
'catalogues',
'category_terms',
'closures',
// 'commands',
'digital_catalogs',
'educator_resources',
'event_occurrences',
'event_programs',
'events',
'exhibition_asset',
'exhibition_site',
'exhibitions',
'galleries',
'generic_pages',
'library_material_creator',
'library_material_subject',
'library_materials',
'library_terms',
// 'migrations',
'mobile_artwork_mobile_sound',
'mobile_artworks',
'mobile_sounds',
'places',
'press_releases',
'printed_catalogs',
'products',
'publications',
'sections',
'selections',
'shop_categories',
'sites',
'static_pages',
// 'ticketed_event_types',
// 'ticketed_events',
'tour_stops',
'tours',
'web_artists',
'web_exhibitions',
];

protected $shell;

Expand Down Expand Up @@ -116,7 +50,7 @@ protected function getDumpPathOption(): string
$subdirPath = $dumpPath . '/' . $subdir;

if (!file_exists($subdirPath)) {
mkdir($subdirPath, 0755);
mkdir($subdirPath, 755);
}
}

Expand Down
33 changes: 0 additions & 33 deletions app/Console/Commands/Dump/DumpAudit.php

This file was deleted.

Loading

0 comments on commit fa13b0b

Please sign in to comment.