Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
v2.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkvanzanten committed Nov 14, 2018
1 parent 78d95c7 commit 9a87c49
Show file tree
Hide file tree
Showing 35 changed files with 774 additions and 24 deletions.
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ package-lock.json
# Don't track composer phar/vendors
composer.phar
composer.lock
/vendor

# Ignore configuration files
/config/*
Expand All @@ -24,11 +23,6 @@ composer.lock
/phpunit.xml
/documents

# Core extensions
/public/extensions/core/interfaces
/public/extensions/core/layouts
/public/extensions/core/pages

# Custom extensions
/public/extensions/custom/*/*

Expand Down
2 changes: 1 addition & 1 deletion public/extensions/core/interfaces/code/input.js

Large diffs are not rendered by default.

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions public/extensions/core/interfaces/datetime-created/display.js

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

3 changes: 3 additions & 0 deletions public/extensions/core/interfaces/datetime-created/input.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

.gray[data-v-5a5a25]{color:var(--light-gray);text-transform:capitalize
}
6 changes: 6 additions & 0 deletions public/extensions/core/interfaces/datetime-created/input.js

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

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"$t:datetime_created","version":"1.0.0","types":["datetime_created"],"icon":"access_time","options":{"showRelative":{"name":"$t:relative","interface":"toggle","comment":"$t:relative_comment","value":false}},"translation":{"en-US":{"datetime_created":"Datetime Created","relative":"Show relative time","relative_comment":"Show the time relatively (eg 50 minutes ago)","now":"You are creating this now","unknown":"Unknown"}}}
6 changes: 6 additions & 0 deletions public/extensions/core/interfaces/datetime-updated/display.js

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

3 changes: 3 additions & 0 deletions public/extensions/core/interfaces/datetime-updated/input.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

.gray[data-v-b9555a]{color:var(--light-gray);text-transform:capitalize
}
6 changes: 6 additions & 0 deletions public/extensions/core/interfaces/datetime-updated/input.js

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

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"$t:datetime_updated","version":"1.0.0","types":["datetime_updated"],"icon":"access_time","options":{"showRelative":{"name":"$t:relative","interface":"toggle","comment":"$t:relative_comment","value":false}},"translation":{"en-US":{"datetime_updated":"Datetime Updated","relative":"Show relative time","relative_comment":"Show the time relatively (eg 50 minutes ago)","now":"You are creating this now","unknown":"Unknown"}}}
7 changes: 7 additions & 0 deletions public/extensions/core/interfaces/one-to-many/display.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

.list[data-v-674fcc]{max-height:200px;overflow-y:scroll;list-style:none;padding:0
}
.list li[data-v-674fcc]{color:var(--dark-gray);padding:8px 0
}
.list li[data-v-674fcc]:not(:last-of-type){border-bottom:1px solid var(--lightest-gray)
}
34 changes: 34 additions & 0 deletions public/extensions/core/interfaces/password/hooks.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

use Directus\Hook\Payload;
use Directus\Application\Application;

$hashValue = function (Payload $payload) {
$data = $payload->getData();
$container = Application::getInstance()->getContainer();
$schemaManager = $container->get('schema_manager');
$hashManager = $container->get('hash_manager');

$collection = $schemaManager->getCollection($payload->attribute('collection_name'));
$interfaceName = basename(__DIR__);

foreach ($data as $fieldName => $value) {
$field = $collection->getField($fieldName);
if ($field && $field->getInterface() === $interfaceName) {
$options = $field->getOptions() ?: ['hasher' => 'core'];

$hashedString = $hashManager->hash($value, $options);
$payload->set($fieldName, $hashedString);
}
}

return $payload;
};

return [
'filters' => [
'item.create:before' => $hashValue,
'item.update:before' => $hashValue,
]
];

Loading

0 comments on commit 9a87c49

Please sign in to comment.