@local-civics/mgmt-ui 0.1.227 → 0.1.228

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
@@ -1,4 +1,4 @@
1
- export { showNotification, updateNotification } from '@mantine/notifications';
1
+ export { hideNotification, showNotification, updateNotification } from '@mantine/notifications';
2
2
  import * as React from 'react';
3
3
 
4
4
  /**
package/dist/index.js CHANGED
@@ -1174,7 +1174,15 @@ const DropzoneButton$1 = (props) => {
1174
1174
  worker: true,
1175
1175
  complete: function(results) {
1176
1176
  const data = results.data.filter((v) => /^\S+@\S+$/.test(v.email) && props.members.filter((u) => u.email === v.email).length === 0);
1177
- data.length > 0 && props.onCreateMembers && props.onCreateMembers(data);
1177
+ if (data.length > 0) {
1178
+ props.onCreateMembers && props.onCreateMembers(data);
1179
+ } else {
1180
+ notifications.showNotification({
1181
+ title: "No new members found.",
1182
+ message: "Every row in that file was either invalid or already on this class's roster.",
1183
+ autoClose: 5e3
1184
+ });
1185
+ }
1178
1186
  setLoading(false);
1179
1187
  props.close();
1180
1188
  }
@@ -1525,6 +1533,11 @@ const Home = (props) => {
1525
1533
  });
1526
1534
  } catch (err) {
1527
1535
  console.error("Failed to copy code", err);
1536
+ notifications.showNotification({
1537
+ title: "Unable to copy code.",
1538
+ message: `Your browser blocked the copy - the community code is: ${accessCode}`,
1539
+ autoClose: false
1540
+ });
1528
1541
  }
1529
1542
  };
1530
1543
  return /* @__PURE__ */ React__namespace.createElement("div", { className: "flex w-full flex-col gap-5" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-stretch gap-5" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "flex-1" }, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-[28px] font-extrabold text-dark-blue-400" }, props.name), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-1.5 text-[12.5px] text-slate-400" }, props.impactStatement)), /* @__PURE__ */ React__namespace.createElement("div", { className: "flex w-[440px] shrink-0 flex-col justify-between gap-3 rounded-2xl bg-gradient-to-br from-dark-blue-600 via-dark-blue-400 to-sky-blue-400 p-5" }, /* @__PURE__ */ React__namespace.createElement("div", null, /* @__PURE__ */ React__namespace.createElement("div", { className: "text-base font-extrabold text-white" }, props.organization.name), /* @__PURE__ */ React__namespace.createElement("div", { className: "mt-1.5 text-[11.5px] leading-relaxed text-white/70" }, props.organization.description)), accessCode && /* @__PURE__ */ React__namespace.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React__namespace.createElement("span", { className: "text-[11px] text-white/70" }, "Community code: ", accessCode), /* @__PURE__ */ React__namespace.createElement(
@@ -2143,7 +2156,15 @@ const DropzoneButton = (props) => {
2143
2156
  worker: true,
2144
2157
  complete: function(results) {
2145
2158
  const data = results.data.filter((v) => /^\S+@\S+$/.test(v.email) && props.users.filter((u) => u.email === v.email).length === 0);
2146
- data.length > 0 && props.onCreateUsers && props.onCreateUsers(data);
2159
+ if (data.length > 0) {
2160
+ props.onCreateUsers && props.onCreateUsers(data);
2161
+ } else {
2162
+ notifications.showNotification({
2163
+ title: "No new members found.",
2164
+ message: "Every row in that file was either invalid or already on this organization's roster.",
2165
+ autoClose: 5e3
2166
+ });
2167
+ }
2147
2168
  setLoading(false);
2148
2169
  props.close();
2149
2170
  }
@@ -2400,6 +2421,11 @@ const TenantBanner = (_a) => {
2400
2421
  });
2401
2422
  } catch (err) {
2402
2423
  console.error("Failed to copy code", err);
2424
+ notifications.showNotification({
2425
+ title: "Unable to copy code.",
2426
+ message: `Your browser blocked the copy - the community code is: ${code}`,
2427
+ autoClose: false
2428
+ });
2403
2429
  }
2404
2430
  };
2405
2431
  return /* @__PURE__ */ React__namespace.createElement(
@@ -3667,6 +3693,10 @@ const FileLocker = (props) => {
3667
3693
  ))), !props.trial && tab === "students" && /* @__PURE__ */ React__namespace.createElement(Table, { loading: props.loading, items: enrichedStudents, onReview: (item) => onReview(item, enrichedStudents) }), !props.trial && tab === "pathways" && /* @__PURE__ */ React__namespace.createElement(PathwayGroups, { students: enrichedStudents, loading: props.loading, pathways: props.pathways || [], badges: props.badges || [], onReview }), !props.trial && tab === "badges" && /* @__PURE__ */ React__namespace.createElement(BadgeGroups, { students: enrichedStudents, loading: props.loading, badges: props.badges || [], pathwayNameForBadge, onReview }), !props.trial && tab === "lessons" && /* @__PURE__ */ React__namespace.createElement(LessonGroups, { students: enrichedStudents, loading: props.loading, lessons: props.lessons, badgeForLesson, pathwayNameForBadge, onReview }));
3668
3694
  };
3669
3695
 
3696
+ Object.defineProperty(exports, 'hideNotification', {
3697
+ enumerable: true,
3698
+ get: function () { return notifications.hideNotification; }
3699
+ });
3670
3700
  Object.defineProperty(exports, 'showNotification', {
3671
3701
  enumerable: true,
3672
3702
  get: function () { return notifications.showNotification; }