@local-civics/mgmt-ui 0.1.141 → 0.1.143

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -717,7 +717,7 @@ declare const Pathways: (props: PathwaysProps) => JSX.Element;
717
717
  * Item
718
718
  */
719
719
  interface Item$2 {
720
- lessonName: string;
720
+ badgeName: string;
721
721
  completion: number;
722
722
  isStarted?: boolean;
723
723
  href: string;
@@ -732,15 +732,15 @@ interface Item$1 {
732
732
  name: string;
733
733
  email: string;
734
734
  isComplete?: boolean;
735
- lessons: Item$2[];
735
+ badges: Item$2[];
736
736
  }
737
737
 
738
738
  /**
739
739
  * Item
740
740
  */
741
741
  interface Item {
742
- lessonId: string;
743
- lessonName: string;
742
+ badgeId: string;
743
+ badgeName: string;
744
744
  percentageCompletion: number;
745
745
  href: string;
746
746
  }
@@ -765,12 +765,12 @@ type PathwayProps = {
765
765
  title: string;
766
766
  description: string;
767
767
  classes: PathwayClass[];
768
- lessons: Item[];
768
+ badges: Item[];
769
769
  classId: string;
770
770
  students: PathwayUserItem[];
771
771
  href: string;
772
772
  trial?: boolean;
773
- lessonsCompleted?: number;
773
+ badgesCompleted?: number;
774
774
  onBackClick: () => void;
775
775
  onClassChange: (classId: string) => void;
776
776
  onCopyLinkClick: () => void;
package/dist/index.js CHANGED
@@ -3249,7 +3249,7 @@ function Stack(props) {
3249
3249
  if (props.items.length === 0) {
3250
3250
  return null;
3251
3251
  }
3252
- const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 6 }, /* @__PURE__ */ React__namespace.createElement(core.Text, { component: reactRouterDom.Link, to: row.href, color: "dark.4", weight: "bold", size: "md" }, row.lessonName)), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 6 }, row.completion >= 1 && /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled" }, "Complete"), row.completion === 0 && !row.isStarted && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "red", variant: "filled" }, "Not started"), row.completion > 0 && row.completion < 1 && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "violet", variant: "filled" }, Math.round((row.completion + Number.EPSILON) * 100), "% Complete"))));
3252
+ const rows = props.items.map((row) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 6 }, /* @__PURE__ */ React__namespace.createElement(core.Text, { component: reactRouterDom.Link, to: row.href, color: "dark.4", weight: "bold", size: "md" }, row.badgeName)), /* @__PURE__ */ React__namespace.createElement(core.Grid.Col, { span: 6 }, row.completion >= 1 && /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled" }, "Complete"), row.completion === 0 && !row.isStarted && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "red", variant: "filled" }, "Not started"), row.completion > 0 && row.completion < 1 && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "violet", variant: "filled" }, Math.round((row.completion + Number.EPSILON) * 100), "% Complete"))));
3253
3253
  return /* @__PURE__ */ React__namespace.createElement(core.Grid, { grow: true, gutter: "lg", sx: { padding: 20, minWidth: 700 } }, rows);
3254
3254
  }
3255
3255
 
@@ -3286,7 +3286,7 @@ function Table$1(props) {
3286
3286
  render: (row) => /* @__PURE__ */ React__namespace.createElement(React__namespace.Fragment, null, !!row.isComplete && /* @__PURE__ */ React__namespace.createElement(core.Badge, { variant: "filled" }, "Complete"), !row.isComplete && /* @__PURE__ */ React__namespace.createElement(core.Badge, { color: "red", variant: "filled" }, "Incomplete"))
3287
3287
  }],
3288
3288
  rowExpansion: {
3289
- content: ({ record }) => /* @__PURE__ */ React__namespace.createElement(Stack, { items: record.lessons })
3289
+ content: ({ record }) => /* @__PURE__ */ React__namespace.createElement(Stack, { items: record.badges })
3290
3290
  }
3291
3291
  }
3292
3292
  ));
@@ -3306,7 +3306,7 @@ function Table(props) {
3306
3306
  }
3307
3307
  const rows = props.items.map((row) => {
3308
3308
  const percentageCompletion = Math.round((row.percentageCompletion + Number.EPSILON) * 100);
3309
- return /* @__PURE__ */ React__namespace.createElement("tr", { key: row.lessonName }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { component: reactRouterDom.Link, to: row.href }, row.lessonName)), /* @__PURE__ */ React__namespace.createElement("td", null, percentageCompletion, "%"));
3309
+ return /* @__PURE__ */ React__namespace.createElement("tr", { key: row.badgeName }, /* @__PURE__ */ React__namespace.createElement("td", null, /* @__PURE__ */ React__namespace.createElement(core.Text, { component: reactRouterDom.Link, to: row.href }, row.badgeName)), /* @__PURE__ */ React__namespace.createElement("td", null, percentageCompletion, "%"));
3310
3310
  });
3311
3311
  return /* @__PURE__ */ React__namespace.createElement(core.ScrollArea.Autosize, { maxHeight: 600 }, /* @__PURE__ */ React__namespace.createElement(core.Table, { verticalSpacing: "sm", sx: { minWidth: 700 }, highlightOnHover: true, striped: true }, /* @__PURE__ */ React__namespace.createElement("thead", null, /* @__PURE__ */ React__namespace.createElement("tr", null, /* @__PURE__ */ React__namespace.createElement("th", null, "Badge Name"), /* @__PURE__ */ React__namespace.createElement("th", null, "Badge Completion"))), /* @__PURE__ */ React__namespace.createElement("tbody", null, rows)));
3312
3312
  }
@@ -3325,7 +3325,7 @@ const useStyles = core.createStyles((theme) => ({
3325
3325
  }));
3326
3326
  const Pathway = (props) => {
3327
3327
  const { classes } = useStyles();
3328
- const [tab, setTab] = React.useState("lessons");
3328
+ const [tab, setTab] = React.useState("badges");
3329
3329
  const numberOfStudents = props.students.length;
3330
3330
  numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length / numberOfStudents : 0;
3331
3331
  const numberOfBadgesEarned = numberOfStudents > 0 ? props.students.filter((u) => u.isComplete).length : 0;
@@ -3370,16 +3370,16 @@ const Pathway = (props) => {
3370
3370
  {
3371
3371
  value: tab,
3372
3372
  data: [
3373
- { label: "By Badge", value: "lessons" },
3373
+ { label: "By Badge", value: "badges" },
3374
3374
  { label: "By student", value: "students" }
3375
3375
  ],
3376
3376
  onChange: setTab
3377
3377
  }
3378
- ), (!!props.trial || tab === "lessons") && /* @__PURE__ */ React__namespace.createElement(
3378
+ ), (!!props.trial || tab === "badges") && /* @__PURE__ */ React__namespace.createElement(
3379
3379
  Table,
3380
3380
  {
3381
3381
  loading: props.loading,
3382
- items: props.lessons
3382
+ items: props.badges
3383
3383
  }
3384
3384
  ), !props.trial && tab === "students" && /* @__PURE__ */ React__namespace.createElement(
3385
3385
  Table$1,