Skip to content

Commit

Permalink
Merge pull request #72 from Exabyte-io/feat/SOF-7276
Browse files Browse the repository at this point in the history
SOF-7276: fix brillouin zone image rendering
  • Loading branch information
pranabdas authored Apr 9, 2024
2 parents 3e6629c + 84e75e7 commit cfb372b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/context/providers/PointsPathFormDataProvider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable max-classes-per-file */
/* eslint react/prop-types: 0 */
import { Application } from "@exabyte-io/ade.js";
import {
ApplicationContextMixin,
Expand Down Expand Up @@ -81,20 +82,21 @@ export class PointsPathFormDataProvider extends mix(JSONSchemaFormDataProvider).
};
}

// eslint-disable-next-line class-methods-use-this
get templates() {
return {};
}

getBrillouinZoneImageComponent(title) {
const hasRequiredFn = typeof this.material.getBrillouinZoneImageComponent === "function";
if (!hasRequiredFn) {
console.log(
"PointsPathFormDataProvider: Material class has no function" +
" 'getBrillouinZoneImageComponent'! Returning empty Object instead.",
);
return {};
return null;
}
return {
// eslint-disable-next-line no-unused-vars
TitleFieldTemplate: ({ title, required }) =>
this.material.getBrillouinZoneImageComponent(title),
};
return this.material.getBrillouinZoneImageComponent(title);
}

get useExplicitPath() {
Expand Down

0 comments on commit cfb372b

Please sign in to comment.