Skip to content

Commit

Permalink
190627A
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkvanzanten committed Jun 27, 2019
1 parent ecd452b commit 5f0b8e5
Show file tree
Hide file tree
Showing 422 changed files with 1,130 additions and 757 deletions.
102 changes: 59 additions & 43 deletions migrations/db/seeds/FieldsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ public function run()
'interface' => 'many-to-many',
'locked' => 1,
'options' => json_encode([
'fields' => "first_name,last_name"
'fields' => "first_name,last_name"
])
],
[
Expand Down Expand Up @@ -1123,6 +1123,22 @@ public function run()
'note' => 'This image will be used when trying to generate a thumbnail with invalid options or an error happens on the server when creating the image.',
'sort' => 13
],
[
'collection' => 'directus_settings',
'field' => 'file_naming',
'type' => \Directus\Database\Schema\DataTypes::TYPE_STRING,
'interface' => 'dropdown',
'locked' => 1,
'width' => 'full',
'note' => 'The file-system naming convention for uploads.',
'sort' => 14,
'options' => json_encode([
'choices' => [
'uuid' => 'File Hash (Obfuscated)',
'file_name' => 'File Name (Readable)'
]
])
],


// Users
Expand All @@ -1143,48 +1159,48 @@ public function run()
'type' => \Directus\Database\Schema\DataTypes::TYPE_STATUS,
'interface' => 'status',
'options' => json_encode([
'status_mapping' => [
'draft' => [
'name' => 'Draft',
'text_color' => 'white',
'background_color' => 'light-gray',
'listing_subdued' => false,
'listing_badge' => true,
'soft_delete' => false,
],
'invited' => [
'name' => 'Invited',
'text_color' => 'white',
'background_color' => 'light-gray',
'listing_subdued' => false,
'listing_badge' => true,
'soft_delete' => false,
],
'active' => [
'name' => 'Active',
'text_color' => 'white',
'background_color' => 'success',
'listing_subdued' => false,
'listing_badge' => false,
'soft_delete' => false,
],
'suspended' => [
'name' => 'Suspended',
'text_color' => 'white',
'background_color' => 'light-gray',
'listing_subdued' => false,
'listing_badge' => true,
'soft_delete' => false,
],
'deleted' => [
'name' => 'Deleted',
'text_color' => 'white',
'background_color' => 'danger',
'listing_subdued' => false,
'listing_badge' => true,
'soft_delete' => true,
]
]
'status_mapping' => [
'draft' => [
'name' => 'Draft',
'text_color' => 'white',
'background_color' => 'light-gray',
'listing_subdued' => false,
'listing_badge' => true,
'soft_delete' => false,
],
'invited' => [
'name' => 'Invited',
'text_color' => 'white',
'background_color' => 'light-gray',
'listing_subdued' => false,
'listing_badge' => true,
'soft_delete' => false,
],
'active' => [
'name' => 'Active',
'text_color' => 'white',
'background_color' => 'success',
'listing_subdued' => false,
'listing_badge' => false,
'soft_delete' => false,
],
'suspended' => [
'name' => 'Suspended',
'text_color' => 'white',
'background_color' => 'light-gray',
'listing_subdued' => false,
'listing_badge' => true,
'soft_delete' => false,
],
'deleted' => [
'name' => 'Deleted',
'text_color' => 'white',
'background_color' => 'danger',
'listing_subdued' => false,
'listing_badge' => true,
'soft_delete' => true,
]
]
]),
'locked' => 1,
'sort' => 2,
Expand Down
130 changes: 67 additions & 63 deletions migrations/db/seeds/SettingsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,68 +4,72 @@

class SettingsSeeder extends AbstractSeed
{
/**
* Run Method.
*
* Write your database seeder using this method.
*
* More information on writing seeders is available here:
* http://docs.phinx.org/en/latest/seeding.html
*/
public function run()
{
$data = [
[
'key' => 'logo',
'value' => ''
],
[
'key' => 'color',
'value' => 'darkest-gray',
],
[
'key' => 'default_limit',
'value' => '200'
],
[
'key' => 'sort_null_last',
'value' => '1'
],
[
'key' => 'auto_sign_out',
'value' => '60'
],
[
'key' => 'youtube_api_key',
'value' => ''
],
[
'key' => 'trusted_proxies',
'value' => ''
],
[
'key' => 'thumbnail_dimensions',
'value' => '200x200'
],
[
'key' => 'thumbnail_quality_tags',
'value' => '{"poor": 25, "good": 50, "better": 75, "best": 100}'
],
[
'key' => 'thumbnail_actions',
'value' => '{"contain":{"options":{"resizeCanvas":false,"position":"center","resizeRelative":false,"canvasBackground":"ccc"}},"crop":{"options":{"position":"center"}}}'
],
[
'key' => 'thumbnail_cache_ttl',
'value' => '86400'
],
[
'key' => 'thumbnail_not_found_location',
'value' => ''
]
];
/**
* Run Method.
*
* Write your database seeder using this method.
*
* More information on writing seeders is available here:
* http://docs.phinx.org/en/latest/seeding.html
*/
public function run()
{
$data = [
[
'key' => 'logo',
'value' => ''
],
[
'key' => 'color',
'value' => 'darkest-gray',
],
[
'key' => 'default_limit',
'value' => '200'
],
[
'key' => 'sort_null_last',
'value' => '1'
],
[
'key' => 'auto_sign_out',
'value' => '60'
],
[
'key' => 'youtube_api_key',
'value' => ''
],
[
'key' => 'trusted_proxies',
'value' => ''
],
[
'key' => 'thumbnail_dimensions',
'value' => '200x200'
],
[
'key' => 'thumbnail_quality_tags',
'value' => '{"poor": 25, "good": 50, "better": 75, "best": 100}'
],
[
'key' => 'thumbnail_actions',
'value' => '{"contain":{"options":{"resizeCanvas":false,"position":"center","resizeRelative":false,"canvasBackground":"ccc"}},"crop":{"options":{"position":"center"}}}'
],
[
'key' => 'thumbnail_cache_ttl',
'value' => '86400'
],
[
'key' => 'thumbnail_not_found_location',
'value' => ''
],
[
'key' => 'file_naming',
'value' => 'uuid'
]
];

$groups = $this->table('directus_settings');
$groups->insert($data)->save();
}
$groups = $this->table('directus_settings');
$groups->insert($data)->save();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
use Phinx\Migration\AbstractMigration;
use function GuzzleHttp\json_encode;

class AddFileNamingInSetting extends AbstractMigration
{
public function up()
{
$fieldObject = [
'field' => 'file_naming',
'type' => 'string',
'interface' => 'dropdown',
'options' => ['choices' => ['uuid' => 'File Hash (Obfuscated)', 'file_name' => 'File Name (Readable)']]
];
$collection = 'directus_settings';
$checkSql = sprintf('SELECT 1 FROM `directus_fields` WHERE `collection` = "%s" AND `field` = "%s";', $collection, $fieldObject['field']);
$result = $this->query($checkSql)->fetch();
if (!$result) {
$insertSqlFormat = "INSERT INTO `directus_fields` (`collection`, `field`, `type`, `interface`, `options`) VALUES ('%s', '%s', '%s', '%s' , '%s');";
$insertSql = sprintf($insertSqlFormat, $collection, $fieldObject['field'], $fieldObject['type'], $fieldObject['interface'], json_encode($fieldObject['options']));
$this->execute($insertSql);
}
}
}
2 changes: 1 addition & 1 deletion public/admin/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// Object values are used as project name in the app
// Don't forget to add the API environment!
api: {
"../_/": "Directus API"
"../_/": "Directus Demo API"
},

// Allow the user to connect to any API by entering a URL in a text field
Expand Down
1 change: 0 additions & 1 deletion public/admin/css/app.1ff092ee.css

This file was deleted.

1 change: 1 addition & 0 deletions public/admin/css/app.fc38fa21.css

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/admin/css/chunk-05b93777.a4bd64f1.css

This file was deleted.

Loading

0 comments on commit 5f0b8e5

Please sign in to comment.