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
16 changes: 8 additions & 8 deletions src/CourseAuthoringContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ export const CourseAuthoringProvider = ({
closePublishModal,
] = useToggleWithValue<ModalState>();
/**
* This will hold the state of current item that is being operated on,
* For example:
* - the details of container that is being edited.
* - the details of container of which see more dropdown is open.
* It is mostly used in modals which should be soon be replaced with its equivalent in sidebar.
*/
* This will hold the state of current item that is being operated on,
* For example:
* - the details of container that is being edited.
* - the details of container of which see more dropdown is open.
* It is mostly used in modals which should be soon be replaced with its equivalent in sidebar.
*/
const [currentSelection, setCurrentSelection] = useState<SelectionState | undefined>();

const getUnitUrl = (locator: string) => {
Expand All @@ -108,8 +108,8 @@ export const CourseAuthoringProvider = ({
}
};
/**
* import a unit block from library and redirect user to this unit page.
*/
* import a unit block from library and redirect user to this unit page.
*/
const handleAddAndOpenUnit = useCreateCourseBlock(courseId, openUnitPage);
const handleAddBlock = useCreateCourseBlock(courseId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const AccessibilityBody = ({
communityAccessibilityLink,
email,
}: {
communityAccessibilityLink: string,
email: string,
communityAccessibilityLink: string;
email: string;
}) => (
<div className="mt-5">
<header>
Expand Down
18 changes: 9 additions & 9 deletions src/content-tags-drawer/ContentTagsCollapsible.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ export interface TaxonomySelectProps {
appliedContentTagsTree: Record<string, TagTreeEntry>;
stagedContentTagsTree: Record<string, TagTreeEntry>;
checkedTags: string[];
selectCancelRef: Ref,
selectAddRef: Ref,
selectInlineAddRef: Ref,
selectCancelRef: Ref;
selectAddRef: Ref;
selectInlineAddRef: Ref;
handleCommitStagedTags: () => void;
handleCancelStagedTags: () => void;
handleSelectableBoxChange: React.ChangeEventHandler;
Expand All @@ -40,12 +40,12 @@ declare module 'react-select/base' {

export type TagTree = {
[key: string]: {
children: TagTree,
canChangeObjecttag: boolean,
canDeleteObjecttag: boolean,
explicit: boolean,
isCopied: boolean,
}
children: TagTree;
canChangeObjecttag: boolean;
canDeleteObjecttag: boolean;
explicit: boolean;
isCopied: boolean;
};
};

export default ContentTagsCollapsible;
2 changes: 1 addition & 1 deletion src/content-tags-drawer/tags-sidebar-controls/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import TagsSidebarHeader from './TagsSidebarHeader';
import TagsSidebarBody from './TagsSidebarBody';

interface TagsSidebarControlsProps {
readOnly: boolean,
readOnly: boolean;
}

const TagsSidebarControls = ({ readOnly }: TagsSidebarControlsProps) => (
Expand Down
26 changes: 13 additions & 13 deletions src/course-libraries/OutOfSyncAlert.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ import { useEntityLinksSummaryByDownstreamContext } from './data/apiHooks';
import messages from './messages';

interface OutOfSyncAlertProps {
showAlert: boolean,
setShowAlert: React.Dispatch<React.SetStateAction<boolean>>,
courseId: string,
showAlert: boolean;
setShowAlert: React.Dispatch<React.SetStateAction<boolean>>;
courseId: string;
onDismiss?: () => void;
onReview: () => void;
}
/**
* Shows an alert when library components used in the current course were updated and the blocks
* in course can be updated. Following are the conditions for displaying the alert.
*
* * The alert is displayed if components are out of sync.
* * If the user clicks on dismiss button, the state of dismiss is stored in localstorage of user
* in this format: outOfSyncCountAlert-${courseId} = <datetime value in milliseconds>.
* * If there are not new published components for the course and the user opens outline
* in the same browser, they don't see the alert again.
* * If there is a new published component upstream, the alert is displayed again.
*/
* Shows an alert when library components used in the current course were updated and the blocks
* in course can be updated. Following are the conditions for displaying the alert.
*
* * The alert is displayed if components are out of sync.
* * If the user clicks on dismiss button, the state of dismiss is stored in localstorage of user
* in this format: outOfSyncCountAlert-${courseId} = <datetime value in milliseconds>.
* * If there are not new published components for the course and the user opens outline
* in the same browser, they don't see the alert again.
* * If there is a new published component upstream, the alert is displayed again.
*/
export const OutOfSyncAlert: React.FC<OutOfSyncAlertProps> = ({
showAlert,
setShowAlert,
Expand Down
2 changes: 1 addition & 1 deletion src/course-libraries/__mocks__/publishableEntityLinks.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"created": "2025-02-08T14:07:05.588484Z",
"updated": "2025-02-08T14:07:05.588484Z"
},
{
{
"id": 891,
"upstreamContextTitle": "CS problems 3",
"upstreamVersion": 17,
Expand Down
6 changes: 3 additions & 3 deletions src/course-libraries/data/api.mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ mockUseLibBlockMetadata.applyMock = () => {

/**
* Mock getCourseReadyToMigrateLegacyLibContentBlocks
*/
*/
export async function mockGetReadyToUpdateReferences(
courseId?: string,
): ReturnType<typeof api.getCourseReadyToMigrateLegacyLibContentBlocks> {
Expand Down Expand Up @@ -139,7 +139,7 @@ mockGetReadyToUpdateReferences.applyMock = () => {

/**
* Mock getCourseLegacyLibRefUpdateTaskStatus
*/
*/
export async function mockGetCourseLegacyLibRefUpdateTaskStatus(
_courseId?: string,
taskId?: string,
Expand Down Expand Up @@ -176,7 +176,7 @@ mockGetCourseLegacyLibRefUpdateTaskStatus.applyMock = () => {

/**
* Mock getCourseReadyToMigrateLegacyLibContentBlocks
*/
*/
export async function mockMigrateCourseReadyToMigrateLegacyLibContentBlocks(
courseId?: string,
): ReturnType<typeof api.migrateCourseReadyToMigrateLegacyLibContentBlocks> {
Expand Down
2 changes: 1 addition & 1 deletion src/course-libraries/data/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface PaginatedData<T> {
count: number;
numPages: number;
currentPage: number;
results: T,
results: T;
}

export interface BasePublishableEntityLink {
Expand Down
10 changes: 5 additions & 5 deletions src/course-libraries/data/apiHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ export const courseLibrariesQueryKeys = {
export const useEntityLinks = ({
courseId, readyToSync, useTopLevelParents, upstreamKey, contentType,
}: {
courseId?: string,
readyToSync?: boolean,
useTopLevelParents?: boolean,
upstreamKey?: string,
contentType?: 'all' | 'components' | 'containers',
courseId?: string;
readyToSync?: boolean;
useTopLevelParents?: boolean;
upstreamKey?: string;
contentType?: 'all' | 'components' | 'containers';
}) => (
useQuery({
queryKey: courseLibrariesQueryKeys.courseReadyToSyncLibraries({
Expand Down
4 changes: 2 additions & 2 deletions src/course-outline/OutlineAddChildButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ const NewOutlineAddChildButtons = ({
}

/**
* Starts add flow in sidebar when `Use content from library` button is clicked.
*/
* Starts add flow in sidebar when `Use content from library` button is clicked.
*/
const onUseLibraryContent = useCallback(async () => {
startCurrentFlow({
flowType,
Expand Down
18 changes: 9 additions & 9 deletions src/course-outline/card-header/CardHeader.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
background: transparent;
color: var(--pgn-color-black);

.truncate-1-line {
-webkit-line-clamp: 1; /* stylelint-disable-line value-no-vendor-prefix */
line-clamp: 1;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */
min-width: 100px;
-webkit-box-orient: vertical; /* stylelint-disable-line value-no-vendor-prefix */
}
.truncate-1-line {
-webkit-line-clamp: 1; /* stylelint-disable-line value-no-vendor-prefix */
line-clamp: 1;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */
min-width: 100px;
-webkit-box-orient: vertical; /* stylelint-disable-line value-no-vendor-prefix */
}
}

.item-card-button-icon {
Expand Down
10 changes: 5 additions & 5 deletions src/course-outline/card-header/CardHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { useOutlineSidebarContext } from '../outline-sidebar/OutlineSidebarConte
interface CardHeaderProps {
title: string;
status: string;
cardId: string,
cardId: string;
hasChanges: boolean;
onClickPublish: () => void;
onClickConfigure: () => void;
Expand All @@ -51,8 +51,8 @@ interface CardHeaderProps {
onClickManageTags?: () => void;
titleComponent: ReactNode;
namePrefix: string;
proctoringExamConfigurationLink?: string,
actions: XBlockActions,
proctoringExamConfigurationLink?: string;
actions: XBlockActions;
enableCopyPasteUnits?: boolean;
isVertical?: boolean;
isSequential?: boolean;
Expand All @@ -64,10 +64,10 @@ interface CardHeaderProps {
parentInfo?: {
graded: boolean;
isTimeLimited?: boolean;
},
};
// An optional component that is rendered before the dropdown. This is used by the Subsection
// and Unit card components to render their plugin slots.
extraActionsComponent?: ReactNode,
extraActionsComponent?: ReactNode;
onClickSync?: () => void;
readyToSync?: boolean;
}
Expand Down
38 changes: 19 additions & 19 deletions src/course-outline/data/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ export const getCourseBestPracticesApiUrl = ({
excludeGraded,
all,
}: {
courseId: string,
excludeGraded: boolean,
all: boolean,
courseId: string;
excludeGraded: boolean;
all: boolean;
}) => `${getApiBaseUrl()}/api/courses/v1/quality/${courseId}/?exclude_graded=${excludeGraded}&all=${all}`;

export const getCourseLaunchApiUrl = ({
courseId,
gradedOnly,
validateOras,
all,
}:{
courseId: string,
gradedOnly: boolean,
validateOras: boolean,
}: {
courseId: string;
gradedOnly: boolean;
validateOras: boolean;
all: boolean,
}) => `${getApiBaseUrl()}/api/courses/v1/validation/${courseId}/?graded_only=${gradedOnly}&validate_oras=${validateOras}&all=${all}`;

Expand Down Expand Up @@ -329,15 +329,15 @@ export async function duplicateCourseItem(itemId: string, parentId: string): Pro
}

export type CreateCourseXBlockType = {
type: string,
type: string;
/** The category of the XBlock. Defaults to the type if not provided. */
category?: string,
parentLocator: string,
displayName?: string,
boilerplate?: string,
stagedContent?: string,
category?: string;
parentLocator: string;
displayName?: string;
boilerplate?: string;
stagedContent?: string;
/** component key from library if being imported. */
libraryContentKey?: string,
libraryContentKey?: string;
};

/**
Expand Down Expand Up @@ -374,7 +374,7 @@ export async function createCourseXblock({
* @param {string} courseId
* @param {Array<string>} children list of sections id's
* @returns {Promise<Object>}
*/
*/
export async function setSectionOrderList(courseId: string, children: Array<string>): Promise<object> {
const { data } = await getAuthenticatedHttpClient()
.put(getCourseBlockApiUrl(courseId), {
Expand All @@ -389,7 +389,7 @@ export async function setSectionOrderList(courseId: string, children: Array<stri
* @param {string} itemId Subsection or unit ID
* @param {Array<string>} children list of sections id's
* @returns {Promise<Object>}
*/
*/
export async function setCourseItemOrderList(itemId: string, children: Array<string>): Promise<object> {
const { data } = await getAuthenticatedHttpClient()
.put(getCourseItemApiUrl(itemId), {
Expand All @@ -404,7 +404,7 @@ export async function setCourseItemOrderList(itemId: string, children: Array<str
* @param {string} courseId
* @param {string} videoSharingOption
* @returns {Promise<Object>}
*/
*/
export async function setVideoSharingOption(
courseId: string,
videoSharingOption: string,
Expand All @@ -423,7 +423,7 @@ export async function setVideoSharingOption(
* Paste block to clipboard
* @param {string} parentLocator
* @returns {Promise<Object>}
*/
*/
export async function pasteBlock(parentLocator: string): Promise<{
locator: string;
courseKey: string;
Expand All @@ -443,7 +443,7 @@ export async function pasteBlock(parentLocator: string): Promise<{
* Dismiss notification
* @param {string} url
* @returns void
*/
*/
export async function dismissNotification(url: string) {
await getAuthenticatedHttpClient()
.delete(url);
Expand Down
Loading