-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UNRI2-113, UNRI2-105, and UNRI2-106 PR's combined into one. #6
Conversation
Adding fix that caused a null error on createFileUrl()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
- entity_reference_revisions:entity_reference_revisions | ||
- drupal:field | ||
- field_group:field_group | ||
- drupal:file | ||
- filehash:filehash | ||
- drupal:language | ||
- drupal:media | ||
- paragraphs:paragraphs | ||
- drupal:path | ||
- islandora:islandora | ||
- islandora_defaults:islandora_defaults |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Encountering in the context of D10 stuff, but anything not in core here should be declared in the composer.json
.
... though, I also wonder: How much are we actually dependent on? Grep'ing for entity_reference_revisions
, field_group
, filehash
, islandora
and islandora_defaults
, only finding this info.yml. Only real direct non-core dependency is paragraphs
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Planning to adjust things in #16
/** | ||
* Implements hook_js_settings_alter(). | ||
*/ | ||
function dgi_3d_viewer_js_settings_alter(array &$settings, AttachedAssetsInterface $assets) { | ||
// Check if prod split is enabled. | ||
$settings['isProd'] = \Drupal::config('config_split.config_split.prod')->get('status'); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should really not be binding to some other arbitrary configuration... as in, strictly, this entire module should now be dependent on the config_split.config_split.prod
split existing.
... we should either have a module-specific debug flag, or make use of Drupal core's devel/error reporting stuff, maybe https://github.com/discoverygarden/dgi-starter/blob/43a70275f535b94705b58d3b6997882efcd23892/config/sync/system.logging.yml#L3 ?
/** | ||
* Flatten camera values. | ||
*/ | ||
function dgi_3d_viewer_flatten_camera_values(ParagraphInterface $camera) { | ||
$type = $camera->bundle(); | ||
$camera_settings = [ | ||
'settings' => [ | ||
'near' => $camera->field_near->value, | ||
'far' => $camera->field_far->value, | ||
'position' => [ | ||
'x' => $camera->field_position_x->value, | ||
'y' => $camera->field_position_y->value, | ||
'z' => $camera->field_position_z->value, | ||
], | ||
'rotation' => [ | ||
'x' => $camera->field_rotation_x->value, | ||
'y' => $camera->field_rotation_y->value, | ||
'z' => $camera->field_rotation_z->value, | ||
], | ||
], | ||
]; | ||
switch ($type) { | ||
case 'orthographic_camera_settings': | ||
$camera_settings['type'] = 'OrthographicCamera'; | ||
$camera_settings['settings']['top'] = $camera->field_top->value; | ||
$camera_settings['settings']['bottom'] = $camera->field_bottom->value; | ||
$camera_settings['settings']['left'] = $camera->field_left->value; | ||
$camera_settings['settings']['right'] = $camera->field_right->value; | ||
break; | ||
|
||
case 'perspective_camera_settings': | ||
$camera_settings['type'] = 'PerspectiveCamera'; | ||
$camera_settings['settings']['aspect'] = $camera->field_aspect->value; | ||
$camera_settings['settings']['fov'] = $camera->field_fov->value; | ||
break; | ||
} | ||
|
||
return $camera_settings; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If, instead of rolling paragraphs, we rolled our own field type(s?) explicitly for the purpose, it could have all this (re)structuring built in to it.
Combining the three PR's in the title:
Since they all contain overlapping pieces of code that need to be reviewed together.