From 23cfe961db0d13bb6dc82d45397629b31f546f47 Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Wed, 18 Jun 2025 19:33:21 -0500
Subject: [PATCH 08/79] feat: WC-219 match test CMS content perfectly
---
.../DataFilesTestStyleConflict.global.css | 4 +
.../DataFiles/DataFilesTestStyleConflict.jsx | 79 ++++++++++++++-----
client/src/index.css | 4 +-
client/src/styles/global.css | 3 +-
client/src/styles/settings/font.css | 12 ---
.../portal/apps/workbench/index.html | 2 +-
.../templates/portal/apps/workbench/index.j2 | 2 +-
7 files changed, 68 insertions(+), 38 deletions(-)
create mode 100644 client/src/components/DataFiles/DataFilesTestStyleConflict.global.css
delete mode 100644 client/src/styles/settings/font.css
diff --git a/client/src/components/DataFiles/DataFilesTestStyleConflict.global.css b/client/src/components/DataFiles/DataFilesTestStyleConflict.global.css
new file mode 100644
index 0000000000..f15f598417
--- /dev/null
+++ b/client/src/components/DataFiles/DataFilesTestStyleConflict.global.css
@@ -0,0 +1,4 @@
+/* HACK: Should use routes to not render sidebar */
+#react-root:has(#mimic-cms) .nav-sidebar {
+ display: none;
+}
diff --git a/client/src/components/DataFiles/DataFilesTestStyleConflict.jsx b/client/src/components/DataFiles/DataFilesTestStyleConflict.jsx
index 22210b9c59..2c4b29fa14 100644
--- a/client/src/components/DataFiles/DataFilesTestStyleConflict.jsx
+++ b/client/src/components/DataFiles/DataFilesTestStyleConflict.jsx
@@ -1,13 +1,10 @@
import { React } from 'react';
-const temporaryCSS = `
- .nav-sidebar {
- display: none;
- }
-`;
+/* HACK: Temporary; see stylesheet for notes */
+import './DataFilesTestStyleConflict.global.css';
const externalCSS = `
- @layer mimic-cms.base, mimic-cms.project, mimic-cms.revert;
+ @layer mimic-cms.base, mimic-cms.project;
@import url(/static/site_cms/css/build/core-styles.base.css) layer(mimic-cms.base);
@import url(/static/site_cms/css/build/core-styles.cms.css) layer(mimic-cms.base);
@@ -18,25 +15,65 @@ const externalCSS = `
`;
const revertCSS = `
- @layer mimic-cms {
- /* To revert Portal styles */
- #react-root, #react-root * {
- all: revert;
- }
+ /* To restore relevant behavior of Bootstrap grid */
+ .workbench-content .container {
+ /* To use padding from Bootstrap 4 (which CMS still uses) */
+ --bs-gutter-x: 15px;
+
+ /* To undo Workbench.scss */
+ margin-left: revert-layer;
+ max-width: revert-layer;
+ }
- /* To re-apply CMS styles */
- #mimic-cms, #mimic-cms * {
- all: revert-layer;
- }
+ /* To undo generic Portal styles that do not match CMS */
+ body {
+ -webkit-font-smoothing: revert;
+ }
+
+ /* To adjust Portal styles that mimic old Core Styles */
+ .c-button {
+ --max-width: auto;
+ }
+`;
+
+const breadcrumbCSS = `
+ .s-breadcrumbs a:not([href]) {
+ opacity: 1;
+ color: unset;
}
`;
function DataGallery() {
- return (<>
-
-
-
-
+ return (
+
+
+
+
+
+
Browse Datasets
@@ -313,7 +350,7 @@ function DataGallery() {
- >);
+ );
}
export default DataGallery;
diff --git a/client/src/index.css b/client/src/index.css
index 151967fb0f..4902d17c03 100644
--- a/client/src/index.css
+++ b/client/src/index.css
@@ -1,6 +1,6 @@
-@import url('./styles/global.css') layer(project);
+@import url('./styles/global.css') layer(portal);
-@layer project {
+@layer portal {
/*
Sectioning Root
diff --git a/client/src/styles/global.css b/client/src/styles/global.css
index ed2296938b..98f19ba8a2 100644
--- a/client/src/styles/global.css
+++ b/client/src/styles/global.css
@@ -4,7 +4,8 @@
/* SETTINGS */
@import url('@tacc/core-styles/src/lib/_imports/settings/border.css');
@import url('./settings/color.css');
-@import url('./settings/font.css');
+@import url('@tacc/core-styles/dist/settings/font.css');
+@import url('@tacc/core-styles/dist/settings/font--portal.css');
@import url('./settings/space.css');
/* TOOLS */
diff --git a/client/src/styles/settings/font.css b/client/src/styles/settings/font.css
deleted file mode 100644
index ec3f60ae2b..0000000000
--- a/client/src/styles/settings/font.css
+++ /dev/null
@@ -1,12 +0,0 @@
-@import url('@tacc/core-styles/src/lib/_imports/settings/font.css');
-
-:root {
- /* stylelint-disable value-keyword-case */
- --global-font-family--sans: 'Roboto', sans-serif;
- --global-font-family--serif: Times, sans-serif;
- --global-font-family--mono: source-code-pro, Menlo, Monaco, Consolas,
- 'Courier New', monospace;
- /* stylelint-enable value-keyword-case */
-
- --global-line-height: 1.4; /* From Bootstrap */
-}
diff --git a/server/portal/apps/workbench/templates/portal/apps/workbench/index.html b/server/portal/apps/workbench/templates/portal/apps/workbench/index.html
index 4e81c34bf4..bf599ca24f 100644
--- a/server/portal/apps/workbench/templates/portal/apps/workbench/index.html
+++ b/server/portal/apps/workbench/templates/portal/apps/workbench/index.html
@@ -9,7 +9,7 @@
{% endblock %}
{% block content %}
-
+
{% endblock %}
{% block scripts %}
diff --git a/server/portal/apps/workbench/templates/portal/apps/workbench/index.j2 b/server/portal/apps/workbench/templates/portal/apps/workbench/index.j2
index df67ff2acc..c325fdd851 100644
--- a/server/portal/apps/workbench/templates/portal/apps/workbench/index.j2
+++ b/server/portal/apps/workbench/templates/portal/apps/workbench/index.j2
@@ -9,7 +9,7 @@
{% endblock %}
{% block content %}
-
+
{% endblock %}
{% block scripts %}
From 2c9c90bf454827999a203cb626da1586107cffa0 Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Wed, 18 Jun 2025 19:51:51 -0500
Subject: [PATCH 09/79] chore: WC-219 delete shadow dom attempt
---
.../DataFiles/DataFilesTestShadowRoot.jsx | 34 ---
.../src/hooks/datafiles/useExternalStyles.js | 140 -------------
.../datafiles/useExternalStyles.test.jsx | 194 ------------------
3 files changed, 368 deletions(-)
delete mode 100644 client/src/components/DataFiles/DataFilesTestShadowRoot.jsx
delete mode 100644 client/src/hooks/datafiles/useExternalStyles.js
delete mode 100644 client/src/hooks/datafiles/useExternalStyles.test.jsx
diff --git a/client/src/components/DataFiles/DataFilesTestShadowRoot.jsx b/client/src/components/DataFiles/DataFilesTestShadowRoot.jsx
deleted file mode 100644
index edc089cdcf..0000000000
--- a/client/src/components/DataFiles/DataFilesTestShadowRoot.jsx
+++ /dev/null
@@ -1,34 +0,0 @@
-import { React, useEffect } from 'react';
-
-import { LoadingSpinner, InlineMessage } from '_common';
-import { useExternalStyles } from 'hooks/datafiles';
-
-function DataGallery() {
- const { hostRef, styleStatus, renderWithStyles } = useExternalStyles();
-
- useEffect(() => {
- // IDEA: How about change these to single value like `isReadyToRenderWithStyles`?
- if (hostRef.current && styleStatus.completed) {
- renderWithStyles(
-
-
Browse Datasets
- {styleStatus.failed.length > 0 && (
-
- Some styles failed to load. UI may look incorrect.
-
- )}
-
Sample content.
-
- );
- }
- }, [hostRef.current, styleStatus, renderWithStyles]);
-
-
- if (!styleStatus.completed) {
- return
;
- }
-
- return
;
-}
-
-export default DataGallery;
diff --git a/client/src/hooks/datafiles/useExternalStyles.js b/client/src/hooks/datafiles/useExternalStyles.js
deleted file mode 100644
index 4015509afd..0000000000
--- a/client/src/hooks/datafiles/useExternalStyles.js
+++ /dev/null
@@ -1,140 +0,0 @@
-import { useEffect, useRef, useState, useLayoutEffect } from 'react';
-import { createRoot } from 'react-dom/client';
-
-const DEFAULT_STYLESHEETS = [
- 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600',
- 'https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.0/font/bootstrap-icons.css',
-];
-
-function useExternalStyles(externalStylesheets = DEFAULT_STYLESHEETS) {
- const hostRef = useRef();
- const shadowRootRef = useRef();
- const reactRootRef = useRef();
- const [styleStatus, setStyleStatus] = useState({
- loaded: [],
- failed: [],
- completed: false
- });
-
- function initializeShadowRoot() {
- if (!hostRef.current) {
- console.warn('No hostRef.current found');
- return null;
- }
-
- if (!shadowRootRef.current) {
- try {
- shadowRootRef.current = hostRef.current.shadowRoot ||
- hostRef.current.attachShadow({ mode: 'open' });
- } catch (error) {
- console.error('Failed to create shadow root:', error);
- return null;
- }
- }
-
- return shadowRootRef.current;
- }
-
- function cleanupDOM() {
- if (shadowRootRef.current) {
- const container = shadowRootRef.current.querySelector('div');
- if (container) container.remove();
- const links = shadowRootRef.current.querySelectorAll('link');
- links.forEach(link => link.remove());
- }
- }
-
- function cleanupReact() {
- if (reactRootRef.current) {
- reactRootRef.current.unmount();
- reactRootRef.current = null;
- }
-
- setStyleStatus({
- loaded: [],
- failed: [],
- completed: false
- });
- }
-
- useLayoutEffect(() => {
- return cleanupDOM;
- }, []);
-
- useEffect(() => {
- const shadowRoot = initializeShadowRoot();
- if (!shadowRoot) return;
-
- loadStylesheets(shadowRoot);
-
- return cleanupReact;
- }, [externalStylesheets]);
-
- function loadStylesheets(shadowRoot) {
- const totalStylesheets = externalStylesheets.length;
- if (totalStylesheets === 0) {
- setStyleStatus({ loaded: [], failed: [], completed: true });
- return;
- }
-
- const existingLinks = shadowRoot.querySelectorAll('link');
- existingLinks.forEach(link => link.remove());
-
- const loaded = [];
- const failed = [];
-
- function checkAllComplete() {
- if (loaded.length + failed.length === totalStylesheets) {
- setStyleStatus({
- loaded,
- failed,
- completed: true
- });
- if (failed.length > 0) {
- console.warn('Some stylesheets failed to load:', failed);
- }
- }
- }
-
- externalStylesheets.forEach(url => {
- const link = document.createElement('link');
- link.rel = 'stylesheet';
- link.href = url;
- link.onload = () => {
- loaded.push(url);
- checkAllComplete();
- };
- link.onerror = () => {
- failed.push(url);
- checkAllComplete();
- };
- shadowRoot.appendChild(link);
- });
- }
-
- function renderWithStyles(children) {
- const shadowRoot = shadowRootRef.current;
- if (!shadowRoot) {
- console.warn('Cannot render: no shadow root');
- return;
- }
-
- if (!reactRootRef.current) {
- const container = document.createElement('div');
- shadowRoot.appendChild(container);
- reactRootRef.current = createRoot(container);
- }
-
- reactRootRef.current.render(children);
- }
-
-
- return {
- hostRef,
- areStylesLoaded: styleStatus.completed,
- styleStatus,
- renderWithStyles,
- };
-}
-
-export default useExternalStyles;
\ No newline at end of file
diff --git a/client/src/hooks/datafiles/useExternalStyles.test.jsx b/client/src/hooks/datafiles/useExternalStyles.test.jsx
deleted file mode 100644
index 98cda5c831..0000000000
--- a/client/src/hooks/datafiles/useExternalStyles.test.jsx
+++ /dev/null
@@ -1,194 +0,0 @@
-import React from 'react';
-import { render, act, cleanup } from '@testing-library/react';
-import { vi } from 'vitest';
-import useExternalStyles from './useExternalStyles';
-
-const TEST_STYLESHEETS = [
- 'test://style1.css',
- 'test://style2.css'
-];
-
-describe('useExternalStyles', () => {
- beforeEach(() => {
- // Mock the link.onload event to fire immediately
- const originalCreateElement = document.createElement;
- vi.spyOn(document, 'createElement').mockImplementation((tagName) => {
- const element = originalCreateElement.call(document, tagName);
- if (tagName === 'link') {
- // Simulate successful load immediately
- setTimeout(() => element.onload(), 0);
- }
- return element;
- });
- });
-
- afterEach(() => {
- cleanup();
- vi.clearAllMocks();
- vi.restoreAllMocks();
- });
-
- test('useExternalStyles hook initializes correctly', () => {
- let hookResult;
- const TestComponent = () => {
- hookResult = useExternalStyles(TEST_STYLESHEETS);
- return
Test Content
;
- };
-
- act(() => {
- render(
);
- });
-
- expect(hookResult).toBeDefined();
- expect(hookResult.hostRef).toBeDefined();
- expect(hookResult.areStylesLoaded).toBeDefined();
- expect(hookResult.styleStatus).toBeDefined();
- expect(hookResult.renderWithStyles).toBeDefined();
- });
-
- test('handles rapid unmount and remount during hot reload', async () => {
- let hookResult;
- const TestComponent = () => {
- hookResult = useExternalStyles(TEST_STYLESHEETS);
- return
Test Content
;
- };
-
- // Initial render
- const { unmount } = render(
);
-
- // Wait for initial style loading
- await act(async () => {
- await new Promise(resolve => setTimeout(resolve, 0));
- });
-
- // Unmount
- act(() => {
- unmount();
- });
-
- // Remount immediately
- act(() => {
- render(
);
- });
-
- // Wait for style loading after remount
- await act(async () => {
- await new Promise(resolve => setTimeout(resolve, 0));
- });
-
- expect(hookResult.styleStatus.completed).toBe(true);
- expect(hookResult.styleStatus.loaded).toEqual(TEST_STYLESHEETS);
- });
-
- test('cleanup happens properly during unmount', () => {
- let hookResult;
- const unmountSpy = vi.fn();
-
- const TestComponent = () => {
- hookResult = useExternalStyles(TEST_STYLESHEETS);
- React.useEffect(() => {
- return () => unmountSpy();
- }, []);
- return
Test Content
;
- };
-
- const { unmount } = render(
);
-
- act(() => {
- hookResult.renderWithStyles(
Test
);
- });
-
- act(() => {
- unmount();
- });
-
- expect(unmountSpy).toHaveBeenCalled();
- });
-
- test('handles style loading errors gracefully', async () => {
- // Mock createElement to simulate a failed load
- const originalCreateElement = document.createElement;
- vi.spyOn(document, 'createElement').mockImplementation((tagName) => {
- const element = originalCreateElement.call(document, tagName);
- if (tagName === 'link') {
- // Simulate failed load immediately
- setTimeout(() => element.onerror(new Error('Failed to load')), 0);
- }
- return element;
- });
-
- let hookResult;
- const errorSpy = vi.spyOn(console, 'error').mockImplementation(() => {});
-
- const TestComponent = () => {
- hookResult = useExternalStyles(TEST_STYLESHEETS);
- return
Test Content
;
- };
-
- render(
);
-
- // Wait for error handling
- await act(async () => {
- await new Promise(resolve => setTimeout(resolve, 0));
- });
-
- expect(hookResult.styleStatus.completed).toBe(true);
- expect(hookResult.styleStatus.failed).toEqual(TEST_STYLESHEETS);
- errorSpy.mockRestore();
- });
-
- test('handles concurrent renders during hot reload', async () => {
- let hookResult;
- const TestComponent = () => {
- hookResult = useExternalStyles(TEST_STYLESHEETS);
- return
Test Content
;
- };
-
- const { rerender } = render(
);
-
- // Wait for initial style loading
- await act(async () => {
- await new Promise(resolve => setTimeout(resolve, 0));
- });
-
- // Trigger multiple rerenders
- for (let i = 0; i < 3; i++) {
- act(() => {
- rerender(
);
- });
- }
-
- // Wait for final style loading
- await act(async () => {
- await new Promise(resolve => setTimeout(resolve, 0));
- });
-
- expect(hookResult.styleStatus.completed).toBe(true);
- expect(hookResult.styleStatus.loaded).toEqual(TEST_STYLESHEETS);
- });
-
- test('handles unmount during style loading', async () => {
- let hookResult;
- const TestComponent = () => {
- hookResult = useExternalStyles(TEST_STYLESHEETS);
- return
Test Content
;
- };
-
- const { unmount } = render(
);
-
- // Start style loading
- act(() => {
- hookResult.renderWithStyles(
Test
);
- });
-
- // Unmount during loading
- act(() => {
- unmount();
- });
-
- // Should be able to remount without errors
- act(() => {
- render(
);
- });
- });
-});
\ No newline at end of file
From 83b0cbd1065b12193f0119cac2bcdd5e3647d782 Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Wed, 18 Jun 2025 19:52:52 -0500
Subject: [PATCH 10/79] refactor: WC-219 rename files
---
...flict.global.css => DataFilesForDPMWithCMSStyles.global.css} | 0
...esTestStyleConflict.jsx => DataFilesForDPMWithCMSStyles.jsx} | 2 +-
2 files changed, 1 insertion(+), 1 deletion(-)
rename client/src/components/DataFiles/{DataFilesTestStyleConflict.global.css => DataFilesForDPMWithCMSStyles.global.css} (100%)
rename client/src/components/DataFiles/{DataFilesTestStyleConflict.jsx => DataFilesForDPMWithCMSStyles.jsx} (99%)
diff --git a/client/src/components/DataFiles/DataFilesTestStyleConflict.global.css b/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.global.css
similarity index 100%
rename from client/src/components/DataFiles/DataFilesTestStyleConflict.global.css
rename to client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.global.css
diff --git a/client/src/components/DataFiles/DataFilesTestStyleConflict.jsx b/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx
similarity index 99%
rename from client/src/components/DataFiles/DataFilesTestStyleConflict.jsx
rename to client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx
index 2c4b29fa14..4c33ece158 100644
--- a/client/src/components/DataFiles/DataFilesTestStyleConflict.jsx
+++ b/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx
@@ -1,7 +1,7 @@
import { React } from 'react';
/* HACK: Temporary; see stylesheet for notes */
-import './DataFilesTestStyleConflict.global.css';
+import './DataFilesForDPMWithCMSStyles.global.css';
const externalCSS = `
@layer mimic-cms.base, mimic-cms.project;
From 097032b3bce3c29cedd65bd00dd3a5f28eed0749 Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Fri, 20 Jun 2025 11:03:47 -0500
Subject: [PATCH 11/79] fix: WC-219 missing part of "rename files" commit
---
client/src/components/DataFiles/index.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client/src/components/DataFiles/index.js b/client/src/components/DataFiles/index.js
index 5373df8413..00b733dff6 100644
--- a/client/src/components/DataFiles/index.js
+++ b/client/src/components/DataFiles/index.js
@@ -1 +1 @@
-export { default } from './DataFilesTestStyleConflict';
+export { default } from './DataFilesForDPMWithCMSStyles';
From 0d8f5276ab2dc7eba628c5aaa9a87a88531af7c8 Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Fri, 20 Jun 2025 11:04:17 -0500
Subject: [PATCH 12/79] chore: WC-219 delete outdated import
---
client/src/hooks/datafiles/index.js | 6 ------
1 file changed, 6 deletions(-)
delete mode 100644 client/src/hooks/datafiles/index.js
diff --git a/client/src/hooks/datafiles/index.js b/client/src/hooks/datafiles/index.js
deleted file mode 100644
index 92a9494d73..0000000000
--- a/client/src/hooks/datafiles/index.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export { default as useSystemDisplayName } from './useSystemDisplayName';
-export { default as useSelectedFiles } from './useSelectedFiles';
-export { default as useExternalStyles } from './useExternalStyles';
-export { default as useFileListing } from './useFileListing';
-export { default as useSystems } from './useSystems';
-export { default as useModal } from './useModal';
From 5acc2621df09fe2bacc1e5130d34b81aeb0d5dc7 Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Fri, 20 Jun 2025 11:13:20 -0500
Subject: [PATCH 13/79] fix: WC-219 attrname vs attrName in JSX
---
.../DataFilesForDPMWithCMSStyles.jsx | 28 +++++++++----------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx b/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx
index 4c33ece158..ee72357a40 100644
--- a/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx
+++ b/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx
@@ -45,25 +45,25 @@ const breadcrumbCSS = `
function DataGallery() {
return (
-
+
-
From 7743de98011587bdf06b922c9f9bffd34221aa2e Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Fri, 20 Jun 2025 12:17:54 -0500
Subject: [PATCH 14/79] fix: WC-219 file accidentally deleted
---
client/src/hooks/datafiles/index.js | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 client/src/hooks/datafiles/index.js
diff --git a/client/src/hooks/datafiles/index.js b/client/src/hooks/datafiles/index.js
new file mode 100644
index 0000000000..397a86b69c
--- /dev/null
+++ b/client/src/hooks/datafiles/index.js
@@ -0,0 +1,5 @@
+export { default as useSystemDisplayName } from './useSystemDisplayName';
+export { default as useSelectedFiles } from './useSelectedFiles';
+export { default as useFileListing } from './useFileListing';
+export { default as useSystems } from './useSystems';
+export { default as useModal } from './useModal';
\ No newline at end of file
From 14e0846bc87b738d75c3572c175e4c481619c6fd Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Fri, 20 Jun 2025 12:18:21 -0500
Subject: [PATCH 15/79] refactor: WC-219 extract breadcrumbs
---
.../DataFilesForDPMWithCMSStyles.jsx | 36 ++-----------
...ataFilesForDPMWithCMSStylesBreadcrumbs.jsx | 52 +++++++++++++++++++
2 files changed, 55 insertions(+), 33 deletions(-)
create mode 100644 client/src/components/DataFiles/DataFilesForDPMWithCMSStylesBreadcrumbs.jsx
diff --git a/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx b/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx
index ee72357a40..6fdb65ca1d 100644
--- a/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx
+++ b/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx
@@ -1,5 +1,7 @@
import { React } from 'react';
+import DataFilesForDPMWithCMSStylesBreadcrumbs from './DataFilesForDPMWithCMSStylesBreadcrumbs';
+
/* HACK: Temporary; see stylesheet for notes */
import './DataFilesForDPMWithCMSStyles.global.css';
@@ -36,42 +38,10 @@ const revertCSS = `
}
`;
-const breadcrumbCSS = `
- .s-breadcrumbs a:not([href]) {
- opacity: 1;
- color: unset;
- }
-`;
-
function DataGallery() {
return (
-
-
-
+
diff --git a/client/src/components/DataFiles/DataFilesForDPMWithCMSStylesBreadcrumbs.jsx b/client/src/components/DataFiles/DataFilesForDPMWithCMSStylesBreadcrumbs.jsx
new file mode 100644
index 0000000000..923552af16
--- /dev/null
+++ b/client/src/components/DataFiles/DataFilesForDPMWithCMSStylesBreadcrumbs.jsx
@@ -0,0 +1,52 @@
+import React from 'react';
+
+/**
+ * Display CMS-styled breadcrumbs for the Digital Rocks Portal
+ * XXX: This is static content specific to the Digital Rocks Portal interface.
+ * @see https://pprd.digitalrocks.tacc.utexas.edu/datasets/
+ * @see https://github.com/TACC/Core-CMS/blob/v4.30.0/taccsite_cms/templates/nav_cms_breadcrumbs.html
+ * @returns {JSX.Element} - breadcrumbs
+ */
+const DataFilesForDPMWithCMSStylesBreadcrumbs = () => {
+ const breadcrumbCSS = `
+ .s-breadcrumbs a:not([href]) {
+ opacity: 1;
+ color: unset;
+ }
+ `;
+
+ React.useEffect(() => {
+ // Disable href for the current page breadcrumb
+ const crumbs = document.getElementById('cms-breadcrumbs');
+ const secondLink = crumbs && crumbs.querySelector('li:nth-of-type(2) > a');
+ if (secondLink) secondLink.removeAttribute('href');
+ }, []);
+
+ return (
+ <>
+
+
+ >
+ );
+};
+
+export default DataFilesForDPMWithCMSStylesBreadcrumbs;
From 149a2eaa18dbf8523fe4b5b33fe1d53dc8dd9f9e Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Fri, 20 Jun 2025 17:04:32 -0500
Subject: [PATCH 16/79] fix: header styles overwritten by mimic-cms styles
---
server/portal/templates/base.html | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/server/portal/templates/base.html b/server/portal/templates/base.html
index cd737fc81e..674b8c36f1 100644
--- a/server/portal/templates/base.html
+++ b/server/portal/templates/base.html
@@ -17,10 +17,10 @@
{% block head_extra %}{% endblock %}
{% if settings.PORTAL_CSS_FILENAMES|length %}
From 4d035eae97afed273d229e659130f2e5c9ecb4be Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Fri, 20 Jun 2025 17:07:42 -0500
Subject: [PATCH 17/79] fix: basic text color too dark
cuz it is using portal basic text color instead of cms basic text color
---
.../components/DataFiles/DataFilesForDPMWithCMSStyles.jsx | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx b/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx
index 6fdb65ca1d..81ebcd5a03 100644
--- a/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx
+++ b/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.jsx
@@ -17,6 +17,11 @@ const externalCSS = `
`;
const revertCSS = `
+ /* To restore CMS body color */
+ .workbench-wrapper {
+ color: var(--global-color-primary--x-dark);
+ }
+
/* To restore relevant behavior of Bootstrap grid */
.workbench-content .container {
/* To use padding from Bootstrap 4 (which CMS still uses) */
From 54c6376d04f7c61b5f4ded1dcd28efc1611f00fa Mon Sep 17 00:00:00 2001
From: Wesley B <62723358+wesleyboar@users.noreply.github.com>
Date: Fri, 20 Jun 2025 18:02:47 -0500
Subject: [PATCH 18/79] feat!: footer from CMS
TO DO:
- Make footer conditional.
- Fix footer position.
BREAKING CHANGE: Footer always shown. Footer position is wrong.
---
.../DataFiles/DataFilesForDPMWithCMSStyles.module.css | 1 +
server/conf/docker/docker-compose-dev.all.debug.yml | 2 +-
server/portal/templates/includes/footer.html | 10 +++++++++-
3 files changed, 11 insertions(+), 2 deletions(-)
create mode 100644 client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.module.css
diff --git a/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.module.css b/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.module.css
new file mode 100644
index 0000000000..d7c678f672
--- /dev/null
+++ b/client/src/components/DataFiles/DataFilesForDPMWithCMSStyles.module.css
@@ -0,0 +1 @@
+@import ('@tacc/core-styles/dist/trumps/s-footer.css') layer(mimic-cms.project);
diff --git a/server/conf/docker/docker-compose-dev.all.debug.yml b/server/conf/docker/docker-compose-dev.all.debug.yml
index fc239ce4ac..2f7c8339e1 100644
--- a/server/conf/docker/docker-compose-dev.all.debug.yml
+++ b/server/conf/docker/docker-compose-dev.all.debug.yml
@@ -3,7 +3,7 @@
---
services:
cms:
- image: taccwma/core-cms:latest
+ image: taccwma/core-cms:feat-WC-274-serve-footer-markup # e46d45d5
volumes:
- ../cms/secrets.py:/code/taccsite_cms/secrets.py
- ../cms/uwsgi/uwsgi.ini:/code/uwsgi.ini
diff --git a/server/portal/templates/includes/footer.html b/server/portal/templates/includes/footer.html
index 479c01109c..30f3107eb2 100644
--- a/server/portal/templates/includes/footer.html
+++ b/server/portal/templates/includes/footer.html
@@ -1,3 +1,11 @@
{% load static %}
-