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

fix: import releaselog without try/catch #398

Draft
wants to merge 1 commit into
base: 11.x.x
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 12 additions & 19 deletions src/components/ReleaseLog/ReleaseLog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,21 @@ import {
} from 'design-react-kit';
import { Helmet } from '@plone/volto/helpers';
import { marked } from 'marked';

import config from '@plone/volto/registry';
import './ReleaseLog.css';

const ReleaseLog = () => {
let ReleaseDCPT = null;
let ReleaseIoCittadino = null;
let ReleaseIoPrenoto = null;
try {
ReleaseDCPT = require('design-comuni-plone-theme/../RELEASE.md');
} catch {
console.log("design-comuni-plone-theme/../RELEASE.md doesn't exists");
}
try {
ReleaseIoCittadino = require('@redturtle/volto-io-cittadino/../RELEASE.md');
} catch {
console.log("@redturtle/volto-io-cittadino/../RELEASE.md doesn't exists");
}
try {
ReleaseIoPrenoto = require('@redturtle/volto-io-prenoto/../RELEASE.md');
} catch {
console.log("@redturtle/volto-io-prenoto/../RELEASE.md doesn't exists");
}
const { addonsInfo } = config.settings;
const addons = addonsInfo.map((addon) => addon.name);
const ReleaseDCPT = addons.includes('design-comuni-plone-theme')
? require('design-comuni-plone-theme/../RELEASE.md')
: null;
mamico marked this conversation as resolved.
Show resolved Hide resolved
const ReleaseIoCittadino = addons.includes('@redturtle/volto-io-cittadino')
? require('@redturtle/volto-io-cittadino/../RELEASE.md')
: null;
const ReleaseIoPrenoto = addons.includes('@redturtle/volto-io-prenoto')
? require('@redturtle/volto-io-prenoto/../RELEASE.md')
: null;

const LOGS_TO_VIEW = [
{ name: 'io-Comune', file: ReleaseDCPT },
Expand Down
Loading