Skip to content

Commit 1660ad8

Browse files
committed
feat: add support for origin server and user info
1 parent 54cfbeb commit 1660ad8

2 files changed

Lines changed: 26 additions & 4 deletions

File tree

src/library-authoring/create-library/CreateLibrary.tsx

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {
1515
import {
1616
AccessTime,
1717
Widgets,
18+
PersonOutline,
1819
} from '@openedx/paragon/icons';
1920
import AlertError from '@src/generic/alert-error';
2021
import classNames from 'classnames';
@@ -203,20 +204,36 @@ export const CreateLibrary = ({
203204
<Card.Body>
204205
<div className="d-flex flex-column flex-md-row justify-content-between align-items-start p-4 text-primary-700">
205206
<div className="flex-grow-1 mb-4 mb-md-0">
206-
<span className="mb-2">{restoreStatus.result.title}</span>
207+
<span className="mb-4">{restoreStatus.result.title}</span>
207208
<p className="small mb-0">
208209
{restoreStatus.result.org} / {restoreStatus.result.slug}
209210
</p>
210211
</div>
211-
<div className="d-flex flex-column gap-2 align-items-md-end">
212+
<div className="d-flex flex-column gap-2 align-items-md-start">
212213
<div className="d-flex align-items-md-center gap-2">
213214
<Icon src={Widgets} style={{ width: '20px', height: '20px', marginRight: '8px' }} />
214215
<span className="x-small">
215216
{intl.formatMessage(messages.archiveComponentsCount, {
216-
count: restoreStatus.result.components,
217+
countSections: restoreStatus.result.sections,
218+
countSubsections: restoreStatus.result.subsections,
219+
countUnits: restoreStatus.result.units,
220+
countComponents: restoreStatus.result.components,
217221
})}
218222
</span>
219223
</div>
224+
{
225+
(restoreStatus.result.createdBy?.email && restoreStatus.result.createdOnServer) && (
226+
<div className="d-flex align-items-md-center gap-2">
227+
<Icon src={PersonOutline} style={{ width: '20px', height: '20px', marginRight: '8px' }} />
228+
<span className="x-small">
229+
{intl.formatMessage(messages.archiveRestoredCreatedBy, {
230+
createdBy: restoreStatus.result.createdBy?.email,
231+
server: restoreStatus.result.createdOnServer,
232+
})}
233+
</span>
234+
</div>
235+
)
236+
}
220237
<div className="d-flex align-items-md-center gap-2">
221238
<Icon src={AccessTime} style={{ width: '20px', height: '20px', marginRight: '8px' }} />
222239
<span className="x-small">

src/library-authoring/create-library/messages.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,14 @@ const messages = defineMessages({
120120
},
121121
archiveComponentsCount: {
122122
id: 'course-authoring.library-authoring.create-library.form.archive.components-count',
123-
defaultMessage: 'Contains {count} Components',
123+
defaultMessage: 'Contains {countSections} sections, {countSubsections} subsections, {countUnits} units, {countComponents} components',
124124
description: 'Text showing the number of components in the restored archive.',
125125
},
126+
archiveRestoredCreatedBy: {
127+
id: 'course-authoring.library-authoring.create-library.form.archive.restored-created-by',
128+
defaultMessage: 'Created on instance {server}, by user {createdBy}',
129+
description: 'Text showing who restored the archive.',
130+
},
126131
archiveBackupDate: {
127132
id: 'course-authoring.library-authoring.create-library.form.archive.backup-date',
128133
defaultMessage: 'Backed up {date} at {time}',

0 commit comments

Comments
 (0)