Skip to content

Commit 80a4f1e

Browse files
committed
Fix iframe src
1 parent 27d5df5 commit 80a4f1e

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
type ConstructorProps = {};
2+
3+
export class CmsArchiveBinariesService {
4+
constructor({}: ConstructorProps) {}
5+
}

server/src/cms/CmsArchiveSite.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { HtmlRenderer } from '../site/ssr/htmlRenderer';
77
import { transformQueryToContentSearchParams } from '../opensearch/queries/contentSearch';
88
import { CmsArchiveCategoriesService } from './CmsArchiveCategoriesService';
99
import { cspMiddleware } from '../routing/csp';
10+
import { CmsArchiveBinariesService } from './CmsArchiveBinariesService';
1011

1112
export type CmsArchiveSiteConfig = {
1213
name: string;
@@ -23,8 +24,9 @@ type ContructorProps = {
2324

2425
export class CmsArchiveSite {
2526
private readonly config: CmsArchiveSiteConfig;
26-
private readonly cmsArchiveContentService: CmsArchiveContentService;
2727
private readonly cmsArchiveCategoriesService: CmsArchiveCategoriesService;
28+
private readonly cmsArchiveContentService: CmsArchiveContentService;
29+
private readonly cmsArchiveBinariesService: CmsArchiveBinariesService;
2830

2931
constructor({ config, expressApp, dbClient, htmlRenderer }: ContructorProps) {
3032
this.config = config;
@@ -40,6 +42,8 @@ export class CmsArchiveSite {
4042
categoriesService: this.cmsArchiveCategoriesService,
4143
});
4244

45+
this.cmsArchiveBinariesService = new CmsArchiveBinariesService({});
46+
4347
const siteRouter = express.Router();
4448
const apiRouter = express.Router();
4549

src/components/main-section/content-view/html-view/HtmlView.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ type Props = {
1212
};
1313

1414
export const HtmlView = ({ html, versionKey, hidden }: Props) => {
15-
const { appContext } = useAppState();
1615
const ref = useRef<HTMLIFrameElement>(null);
1716

17+
const { appContext } = useAppState();
1818
const fullscreenPath = `${appContext.basePath}/html/${versionKey}`;
1919

2020
return (
@@ -30,10 +30,10 @@ export const HtmlView = ({ html, versionKey, hidden }: Props) => {
3030
window.open(fullscreenPath, '_blank');
3131
}}
3232
>
33-
{'Åpne i fullskjerm'}
33+
{'Åpne i nytt vindu'}
3434
</Button>
3535
<iframe
36-
src={html}
36+
srcDoc={html}
3737
className={classNames(style.htmlFrame)}
3838
ref={ref}
3939
onLoad={(e) => disableLinksAndEventListeners(e.currentTarget)}

0 commit comments

Comments
 (0)