Skip to content
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

Merged
merged 6 commits into from
Jun 22, 2023

Conversation

nchiasson-dgi
Copy link
Contributor

Combining the three PR's in the title:

Since they all contain overlapping pieces of code that need to be reviewed together.

Copy link
Contributor

@chrismacdonaldw chrismacdonaldw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nchiasson-dgi nchiasson-dgi added the minor Added functionality that is backwards compatible. label Jun 22, 2023
@nchiasson-dgi nchiasson-dgi merged commit 1fa6337 into main Jun 22, 2023
@willtp87 willtp87 deleted the 113-105-106-combined branch September 6, 2023 14:22
Comment on lines +7 to +17
- 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
Copy link
Contributor

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?

Copy link
Contributor

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

Comment on lines +71 to +77
/**
* 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');
}
Copy link
Contributor

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 ?

Comment on lines +31 to +69
/**
* 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;
}
Copy link
Contributor

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.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Added functionality that is backwards compatible.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants