Skip to content
Open
Show file tree
Hide file tree
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
35 changes: 31 additions & 4 deletions client/src/Conductor.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Suspense } from "react";
import lazyWithRetry from "./utils/lazyWithRetry";
import { Route, Switch, useLocation } from 'react-router-dom';
import { Redirect, Route, Switch, useLocation } from 'react-router-dom';
import { SkipLink } from '@libretexts/davis-react';

import AnonRoute from './components/util/AnonRoute';
Expand Down Expand Up @@ -137,12 +137,39 @@ const Conductor = () => {
<PrivateRoute exact path='/projects/completed' component={ProjectsCompleted} />
<PrivateRoute exact path='/projects/flagged' component={ProjectsFlagged} />
<PrivateRoute exact path='/projects/:id' component={ProjectView} />
<PrivateRoute exact path='/projects/:id/accessibility' component={ProjectAccessibility} />
<PrivateRoute exact path='/projects/:id/accessibility-remediation' component={ProjectAccessibility} />
<Route
exact
path='/projects/:id/accessibility'
render={({ match, location }) => (
<Redirect
to={`/projects/${match.params.id}/accessibility-remediation${location.search}`}
/>
)}
/>
<PrivateRoute exact path='/projects/:id/peerreview' component={ProjectPeerReview} />
<PrivateRoute exact path='/projects/:id/submit-peer-review' component={ProjectPeerReviewSubmit} />
<PrivateRoute exact path='/projects/:id/timeline' component={ProjectTimeline} />
<PrivateRoute exact path='/projects/:id/ai-co-author' component={TextbookCuration} />
<PrivateRoute exact path='/projects/:id/ai-co-author/batch' component={BatchRun} />
<PrivateRoute exact path='/projects/:id/metadata-editor' component={TextbookCuration} />
<PrivateRoute exact path='/projects/:id/metadata-editor/batch' component={BatchRun} />
<Route
exact
path='/projects/:id/ai-co-author'
render={({ match, location }) => (
<Redirect
to={`/projects/${match.params.id}/metadata-editor${location.search}`}
/>
)}
/>
<Route
exact
path='/projects/:id/ai-co-author/batch'
render={({ match, location }) => (
<Redirect
to={`/projects/${match.params.id}/metadata-editor/batch${location.search}`}
/>
)}
/>
<PrivateRoute exact path='/projects/:id/remixer' component={RemixerDashboard} />
<PrivateRoute exact path='/projects/:id/restacker' component={Restacker} />
<PrivateRoute exact path='/projects/:id/references' component={ReferenceManager} />
Expand Down
8 changes: 4 additions & 4 deletions client/src/components/projects/ProjectAccessibility.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const ProjectAccessibility = (props) => {
* Set page title and load Project information on initial load.
*/
useEffect(() => {
document.title = "LibreTexts Conductor | Projects | Project View | Accessibility";
document.title = "LibreTexts Conductor | Projects | Project View | Accessibility Remediation";
date.plugin(ordinal);
date.plugin(day_of_week);
getProject();
Expand All @@ -96,7 +96,7 @@ const ProjectAccessibility = (props) => {
*/
useEffect(() => {
if (project.title && project.title !== '') {
document.title = `LibreTexts Conductor | Projects | ${project.title} | Accessibility`;
document.title = `LibreTexts Conductor | Projects | ${project.title} | Accessibility Remediation`;
}
}, [project]);

Expand Down Expand Up @@ -280,7 +280,7 @@ const ProjectAccessibility = (props) => {
<Grid className='component-container' divided='vertically'>
<Grid.Row>
<Grid.Column width={16}>
<Header className='component-header'>Accessibility: <em>{project.title || 'Loading...'}</em></Header>
<Header className='component-header'>Accessibility Remediation: <em>{project.title || 'Loading...'}</em></Header>
</Grid.Column>
</Grid.Row>
<Grid.Row>
Expand All @@ -297,7 +297,7 @@ const ProjectAccessibility = (props) => {
</Breadcrumb.Section>
<Breadcrumb.Divider icon='right chevron' />
<Breadcrumb.Section active>
Accessibility
Accessibility Remediation
</Breadcrumb.Section>
</Breadcrumb>
</Segment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,10 @@ const ProjectCoAuthoringToolsButtons: React.FC<
/>
<Button
onClick={() =>
window.open(`/projects/${projectID}/accessibility`, "_blank")
window.open(
`/projects/${projectID}/accessibility-remediation`,
"_blank"
)
}
color="blue"
size="small"
Expand Down Expand Up @@ -119,7 +122,10 @@ const ProjectCoAuthoringToolsButtons: React.FC<
)}
<Button
onClick={() =>
window.open(`/projects/${projectID}/ai-co-author`, "_blank")
window.open(
`/projects/${projectID}/metadata-editor`,
"_blank"
)
}
color="blue"
size="small"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const WelcomeToCoAuthorModal: React.FC<WelcomeToCoAuthorModalProps> = ({

return (
<Modal open={true} size="large" onClose={onClose}>
<Modal.Header>Welcome to LibreTexts' AI Co-Author Tools!</Modal.Header>
<Modal.Header>Metadata Editor</Modal.Header>
<Modal.Content>
<div className="flex flex-row justify-between items-start">
<div className="flex flex-col items-start justify-start">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const BatchRun = () => {
<Grid className="component-container">
<Grid.Column>
<Header as="h2" dividing className="component-header">
AI Co-Author: <span className="italic">{project?.title}</span>
Metadata Editor: <span className="italic">{project?.title}</span>
</Header>
<Segment.Group size="large" raised className="mb-4p">
<Segment className="flex flex-row justify-between items-center">
Expand All @@ -166,9 +166,9 @@ const BatchRun = () => {
<Breadcrumb.Divider icon="right chevron" />
<Breadcrumb.Section
as={Link}
to={`/projects/${projectID}/ai-co-author`}
to={`/projects/${projectID}/metadata-editor`}
>
AI Co-Author
Metadata Editor
</Breadcrumb.Section>
<Breadcrumb.Divider icon="right chevron" />
<Breadcrumb.Section active>Batch Run</Breadcrumb.Section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ const TextbookCuration = () => {
<Grid className="component-container">
<Grid.Column>
<Header as="h2" dividing className="component-header">
AI Co-Author: <span className="italic">{projectData?.title}</span>
Metadata Editor: <span className="italic">{projectData?.title}</span>
</Header>
<Segment.Group size="large" raised className="mb-4p">
<Segment className="flex flex-row justify-between items-center">
Expand All @@ -755,7 +755,7 @@ const TextbookCuration = () => {
{projectData?.title || "Loading..."}
</Breadcrumb.Section>
<Breadcrumb.Divider icon="right chevron" />
<Breadcrumb.Section active>AI Co-Author</Breadcrumb.Section>
<Breadcrumb.Section active>Metadata Editor</Breadcrumb.Section>
</Breadcrumb>
{isSuperAdmin && (
<Checkbox
Expand All @@ -768,7 +768,7 @@ const TextbookCuration = () => {
</Segment>
<Segment className="flex flex-row items-center">
<p className="font-semibold">
Welcome to LibreTexts' AI Co-Author tool. Here, you can curate
Welcome to LibreTexts' Metadata Editor. Here, you can curate
AI-generated metadata for your textbook. You can generate and edit
metadata for individual pages below, or use the bulk actions to
generate metadata for all pages at once and return here to refine
Expand Down Expand Up @@ -838,7 +838,7 @@ const TextbookCuration = () => {
content="Generate AI Metadata"
onClick={() =>
history.push(
`/projects/${projectID}/ai-co-author/batch`
`/projects/${projectID}/metadata-editor/batch`
)
}
disabled={!!activeBatchJob}
Expand Down
17 changes: 17 additions & 0 deletions server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,23 @@ app.get("/matomo-init.js", (req, res) => {
const STATIC_FILE_EXT =
/\.(js|mjs|cjs|css|map|json|webmanifest|png|jpe?g|gif|svg|ico|webp|avif|woff2?|ttf|otf|eot|txt|xml)$/i;

// Old project tool paths → renamed URLs (preserve query string).
app.get("/projects/:id/ai-co-author/batch", (req, res) => {
const query = req.url.includes("?") ? req.url.slice(req.url.indexOf("?")) : "";
res.redirect(302, `/projects/${req.params.id}/metadata-editor/batch${query}`);
});
app.get("/projects/:id/ai-co-author", (req, res) => {
const query = req.url.includes("?") ? req.url.slice(req.url.indexOf("?")) : "";
res.redirect(302, `/projects/${req.params.id}/metadata-editor${query}`);
});
app.get("/projects/:id/accessibility", (req, res) => {
const query = req.url.includes("?") ? req.url.slice(req.url.indexOf("?")) : "";
res.redirect(
302,
`/projects/${req.params.id}/accessibility-remediation${query}`
);
});

let cliRouter = express.Router();
cliRouter.route("*").get((req, res) => {
// A static asset request that missed. Answering it with the app shell produces a
Expand Down
Loading