This repository has been archived by the owner on Jan 6, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78d95c7
commit 9a87c49
Showing
35 changed files
with
774 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
public/extensions/core/interfaces/code/node_modules/vue-codemirror/src/codemirror.js
Large diffs are not rendered by default.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
6
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.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
] | ||
]; | ||
|
Oops, something went wrong.