@sparkle-learning/core 0.0.53 → 0.0.55
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/cjs/{PrivateRoute-074c584e.js → PrivateRoute-f97245ce.js} +18 -30
- package/dist/cjs/{feed.service-b4f09441.js → appdata.service-c8d71e05.js} +4 -56
- package/dist/cjs/{assets.service-0c759d51.js → assets.service-bfa75092.js} +1 -1
- package/dist/cjs/assignment.service-690fb59c.js +19 -0
- package/dist/cjs/{environment-config.service-0e02b049.js → environment-config.service-c8ff1f3d.js} +0 -1
- package/dist/cjs/{facilitator.service-9e990274.js → facilitator.service-ff0e1659.js} +1 -1
- package/dist/cjs/feed.service-8eca4de6.js +57 -0
- package/dist/cjs/header-mobile-collapse_61.cjs.entry.js +76 -87
- package/dist/cjs/{httpService-7211d93b.js → httpService-d2e7bf8f.js} +13 -11
- package/dist/cjs/index.cjs.js +5 -4
- package/dist/cjs/{ion-action-sheet_4.cjs.entry.js → ion-action-sheet_7.cjs.entry.js} +728 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/media.service-8a1b9bc5.js +40 -0
- package/dist/cjs/{signalR.service-5672eebc.js → signalR.service-bd6b42f9.js} +18 -20
- package/dist/cjs/sparkle-animation-player.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-assignment.cjs.entry.js +110 -0
- package/dist/cjs/sparkle-character-intro.cjs.entry.js +2 -2
- package/dist/cjs/sparkle-core.cjs.js +1 -1
- package/dist/cjs/sparkle-discussion-questions_2.cjs.entry.js +20 -11
- package/dist/cjs/sparkle-discussion.cjs.entry.js +6 -4
- package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +5 -3
- package/dist/cjs/sparkle-feed-post.cjs.entry.js +116 -0
- package/dist/cjs/sparkle-feedback.cjs.entry.js +5 -3
- package/dist/cjs/sparkle-file-upload.cjs.entry.js +53 -0
- package/dist/cjs/sparkle-goal-form.cjs.entry.js +11 -8
- package/dist/cjs/sparkle-input.cjs.entry.js +56 -0
- package/dist/cjs/sparkle-quiz-container.cjs.entry.js +1 -1
- package/dist/cjs/sparkle-quiz-old.cjs.entry.js +120 -0
- package/dist/cjs/sparkle-quiz.cjs.entry.js +31 -48
- package/dist/cjs/{student.service-2e58f237.js → student.service-7e5385be.js} +1 -1
- package/dist/cjs/token.service-7a41953d.js +97 -0
- package/dist/cjs/{util-d383acb8.js → util-47e320b2.js} +2 -2
- package/dist/collection/PrivateRoute.js +2 -2
- package/dist/collection/collection-manifest.json +5 -2
- package/dist/collection/components/layout/facilitator/facilitator-page.js +2 -3
- package/dist/collection/components/layout/page/page.css +4 -0
- package/dist/collection/components/layout/page/page.js +39 -26
- package/dist/collection/components/sparkle-assignment/sparkle-assignment.css +30 -0
- package/dist/collection/components/sparkle-assignment/sparkle-assignment.js +159 -0
- package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.css +8 -1
- package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.js +10 -6
- package/dist/collection/components/sparkle-course-root/sparkle-course-root.js +13 -2
- package/dist/collection/components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.js +4 -2
- package/dist/collection/components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.js +15 -9
- package/dist/collection/components/sparkle-discussion/sparkle-discussion.css +5 -0
- package/dist/collection/components/sparkle-discussion/sparkle-discussion.js +5 -3
- package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.js +54 -75
- package/dist/collection/components/sparkle-file-upload/sparkle-file-upload.css +0 -0
- package/dist/collection/components/sparkle-file-upload/sparkle-file-upload.js +105 -0
- package/dist/collection/components/sparkle-input/sparkle-input.css +0 -0
- package/dist/collection/components/sparkle-input/sparkle-input.js +212 -0
- package/dist/collection/components/sparkle-login/sparkle-login.js +2 -1
- package/dist/collection/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.css → sparkle-quiz-old/sparkle-quiz-old.css} +1 -1
- package/dist/collection/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.js → sparkle-quiz-old/sparkle-quiz-old.js} +4 -4
- package/dist/collection/components/sparkle-quiz/{sparkle-quiz-v1.js → sparkle-quiz.js} +23 -25
- package/dist/collection/components/sparkle-quiz-container/sparkle-quiz-container.js +1 -1
- package/dist/collection/components/sparkle-root/sparkle-root.js +12 -10
- package/dist/collection/services/assignment.service.js +14 -0
- package/dist/collection/services/auth/auth.service.js +15 -14
- package/dist/collection/services/environment/environment-config.js +1 -1
- package/dist/collection/services/environment/environment-config.service.js +0 -1
- package/dist/collection/services/httpService.js +12 -10
- package/dist/collection/services/signalR.service.js +17 -19
- package/dist/collection/services/token.service.js +79 -0
- package/dist/collection/util.js +5 -2
- package/dist/esm/{PrivateRoute-c5441f35.js → PrivateRoute-90ac95b8.js} +17 -29
- package/dist/esm/{feed.service-8fbe4ce3.js → appdata.service-2e84e167.js} +5 -55
- package/dist/esm/{assets.service-66e848b8.js → assets.service-def1d63c.js} +1 -1
- package/dist/esm/assignment.service-8d31f141.js +17 -0
- package/dist/esm/{environment-config.service-2b5d692b.js → environment-config.service-b191f276.js} +0 -1
- package/dist/esm/{facilitator.service-b0292f7f.js → facilitator.service-18c47bdf.js} +1 -1
- package/dist/esm/feed.service-b4f3cae4.js +54 -0
- package/dist/esm/header-mobile-collapse_61.entry.js +71 -82
- package/dist/esm/{httpService-7b75b095.js → httpService-7986aeed.js} +14 -12
- package/dist/esm/index.js +6 -5
- package/dist/esm/{ion-action-sheet_4.entry.js → ion-action-sheet_7.entry.js} +729 -4
- package/dist/esm/ion-loading.entry.js +1 -1
- package/dist/esm/ion-menu.entry.js +1 -1
- package/dist/esm/ion-modal.entry.js +1 -1
- package/dist/esm/ion-picker.entry.js +1 -1
- package/dist/esm/ion-toast.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/media.service-6e90bc41.js +37 -0
- package/dist/esm/{overlays-3b4dca92.js → overlays-4233a39d.js} +1 -1
- package/dist/esm/{signalR.service-9d5b9f36.js → signalR.service-c33fba50.js} +18 -20
- package/dist/esm/sparkle-animation-player.entry.js +1 -1
- package/dist/esm/sparkle-assignment.entry.js +106 -0
- package/dist/esm/sparkle-character-intro.entry.js +3 -3
- package/dist/esm/sparkle-core.js +1 -1
- package/dist/esm/sparkle-discussion-questions_2.entry.js +20 -11
- package/dist/esm/sparkle-discussion.entry.js +6 -4
- package/dist/esm/sparkle-facilitator-notes-form.entry.js +6 -4
- package/dist/esm/sparkle-feed-post.entry.js +112 -0
- package/dist/esm/sparkle-feedback.entry.js +6 -4
- package/dist/esm/sparkle-file-upload.entry.js +49 -0
- package/dist/esm/sparkle-goal-form.entry.js +9 -6
- package/dist/esm/sparkle-input.entry.js +52 -0
- package/dist/esm/sparkle-quiz-container.entry.js +1 -1
- package/dist/esm/sparkle-quiz-old.entry.js +116 -0
- package/dist/esm/sparkle-quiz.entry.js +31 -48
- package/dist/esm/{student.service-0746418b.js → student.service-08af124f.js} +1 -1
- package/dist/esm/token.service-71a5d33f.js +94 -0
- package/dist/esm/{util-6ef753e9.js → util-57cc8006.js} +2 -2
- package/dist/sparkle-core/index.esm.js +1 -1
- package/dist/sparkle-core/p-08420531.entry.js +1 -0
- package/dist/sparkle-core/p-08cca80d.entry.js +1 -0
- package/dist/sparkle-core/p-0e8e539f.entry.js +1 -0
- package/dist/sparkle-core/p-13ec39db.entry.js +1 -0
- package/dist/sparkle-core/p-1adc98f6.js +1 -0
- package/dist/sparkle-core/p-38c842d5.entry.js +1 -0
- package/dist/sparkle-core/{p-fbccd30c.js → p-39a31e43.js} +1 -1
- package/dist/sparkle-core/{p-0a5d7c4f.entry.js → p-3daf2915.entry.js} +26 -26
- package/dist/sparkle-core/{p-9a443f51.js → p-408176ba.js} +1 -1
- package/dist/sparkle-core/p-42ed7d5f.entry.js +1 -0
- package/dist/sparkle-core/p-4b4a8703.js +1 -0
- package/dist/sparkle-core/p-4d1cfcbe.entry.js +1 -0
- package/dist/sparkle-core/p-4fba3e4c.js +1 -0
- package/dist/sparkle-core/{p-54dd894f.entry.js → p-6bde0192.entry.js} +1 -1
- package/dist/sparkle-core/{p-6faa194c.entry.js → p-6d2f4093.entry.js} +1 -1
- package/dist/sparkle-core/{p-162bff1a.entry.js → p-72053ae0.entry.js} +1 -1
- package/dist/sparkle-core/p-7dae0f0e.js +1 -0
- package/dist/sparkle-core/{p-18cdd458.entry.js → p-85d4cd5c.entry.js} +1 -1
- package/dist/sparkle-core/p-973fe404.entry.js +22 -0
- package/dist/sparkle-core/{p-ff0e0d4e.entry.js → p-98daeddb.entry.js} +1 -1
- package/dist/sparkle-core/p-b06e2bef.js +1 -0
- package/dist/sparkle-core/{p-e863bf1d.entry.js → p-b6fec622.entry.js} +1 -1
- package/dist/sparkle-core/p-b8d71ff4.js +1 -0
- package/dist/sparkle-core/p-bd90903e.js +1 -0
- package/dist/sparkle-core/{p-a49ab4e8.entry.js → p-c64a34cd.entry.js} +1 -1
- package/dist/sparkle-core/{p-5efc6566.js → p-c9f753a4.js} +1 -1
- package/dist/sparkle-core/p-da391f3f.js +1 -0
- package/dist/sparkle-core/p-e0cad1bb.js +1 -0
- package/dist/sparkle-core/{p-ce4b22f7.entry.js → p-f196c124.entry.js} +1 -1
- package/dist/sparkle-core/p-f47fe1fe.entry.js +1 -0
- package/dist/sparkle-core/p-f714f77a.entry.js +1 -0
- package/dist/sparkle-core/p-f891c79a.entry.js +1 -0
- package/dist/sparkle-core/{p-377b04c2.entry.js → p-ff080f82.entry.js} +1 -1
- package/dist/sparkle-core/{p-2ff67662.js → p-ff7a8a71.js} +1 -1
- package/dist/sparkle-core/sparkle-core.esm.js +1 -1
- package/dist/types/components/layout/page/page.d.ts +2 -0
- package/dist/types/components/sparkle-assignment/sparkle-assignment.d.ts +16 -0
- package/dist/types/components/sparkle-course-root/sparkle-course-root.d.ts +1 -0
- package/dist/types/components/sparkle-feed-post/sparkle-feed-post.d.ts +4 -3
- package/dist/types/components/sparkle-file-upload/sparkle-file-upload.d.ts +15 -0
- package/dist/types/components/sparkle-input/sparkle-input.d.ts +23 -0
- package/dist/types/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.d.ts → sparkle-quiz-old/sparkle-quiz-old.d.ts} +1 -1
- package/dist/types/components/sparkle-quiz/{sparkle-quiz-v1.d.ts → sparkle-quiz.d.ts} +1 -1
- package/dist/types/components.d.ts +111 -36
- package/dist/types/models/class.model.d.ts +4 -0
- package/dist/types/services/assignment.service.d.ts +8 -0
- package/dist/types/services/auth/auth.service.d.ts +1 -1
- package/dist/types/services/environment/environment-config.d.ts +3 -0
- package/dist/types/services/token.service.d.ts +13 -0
- package/dist/types/util.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +0 -618
- package/dist/cjs/ion-textarea.cjs.entry.js +0 -248
- package/dist/cjs/sparkle-quiz-v1.cjs.entry.js +0 -105
- package/dist/esm/ion-select_3.entry.js +0 -612
- package/dist/esm/ion-textarea.entry.js +0 -244
- package/dist/esm/sparkle-quiz-v1.entry.js +0 -101
- package/dist/sparkle-core/p-0f1c5899.entry.js +0 -18
- package/dist/sparkle-core/p-1d4c7c11.js +0 -1
- package/dist/sparkle-core/p-30767c1c.entry.js +0 -1
- package/dist/sparkle-core/p-3265ed87.entry.js +0 -1
- package/dist/sparkle-core/p-370609ba.entry.js +0 -1
- package/dist/sparkle-core/p-44334ef3.entry.js +0 -4
- package/dist/sparkle-core/p-462bffba.js +0 -1
- package/dist/sparkle-core/p-4c9f994f.js +0 -1
- package/dist/sparkle-core/p-58e4bbe5.entry.js +0 -1
- package/dist/sparkle-core/p-600cf6a3.js +0 -1
- package/dist/sparkle-core/p-641bfc92.entry.js +0 -1
- package/dist/sparkle-core/p-80d6b0e6.entry.js +0 -1
- package/dist/sparkle-core/p-af3cc111.entry.js +0 -1
- package/dist/sparkle-core/p-b226f54d.js +0 -1
- /package/dist/collection/components/sparkle-quiz/{sparkle-quiz-v1.css → sparkle-quiz.css} +0 -0
- /package/dist/sparkle-core/{p-935e7cfc.js → p-8b56f734.js} +0 -0
@@ -13,19 +13,22 @@ const index$3 = require('./index-9c7b27e4.js');
|
|
13
13
|
const dir = require('./dir-5af5259a.js');
|
14
14
|
const spinnerConfigs = require('./spinner-configs-0ac05f2d.js');
|
15
15
|
const activeRouter = require('./active-router-f9e18bd8.js');
|
16
|
-
const PrivateRoute = require('./PrivateRoute-
|
17
|
-
const assets_service = require('./assets.service-
|
16
|
+
const PrivateRoute = require('./PrivateRoute-f97245ce.js');
|
17
|
+
const assets_service = require('./assets.service-bfa75092.js');
|
18
18
|
const auth_store = require('./auth.store-1e630a7d.js');
|
19
|
-
const student_service = require('./student.service-
|
20
|
-
const environmentConfig_service = require('./environment-config.service-
|
21
|
-
const util = require('./util-
|
22
|
-
const facilitator_service = require('./facilitator.service-
|
19
|
+
const student_service = require('./student.service-7e5385be.js');
|
20
|
+
const environmentConfig_service = require('./environment-config.service-c8ff1f3d.js');
|
21
|
+
const util = require('./util-47e320b2.js');
|
22
|
+
const facilitator_service = require('./facilitator.service-ff0e1659.js');
|
23
23
|
const index$4 = require('./index-15ea05f5.js');
|
24
24
|
const overlays = require('./overlays-32df265a.js');
|
25
|
-
const signalR_service = require('./signalR.service-
|
26
|
-
const httpService = require('./httpService-
|
27
|
-
const
|
28
|
-
require('./
|
25
|
+
const signalR_service = require('./signalR.service-bd6b42f9.js');
|
26
|
+
const httpService = require('./httpService-d2e7bf8f.js');
|
27
|
+
const appdata_service = require('./appdata.service-c8d71e05.js');
|
28
|
+
const feed_service = require('./feed.service-8eca4de6.js');
|
29
|
+
const media_service = require('./media.service-8a1b9bc5.js');
|
30
|
+
const localstorage_service = require('./localstorage.service-6346a41d.js');
|
31
|
+
const token_service = require('./token.service-7a41953d.js');
|
29
32
|
require('./hardware-back-button-92d97ff8.js');
|
30
33
|
require('./animation-ee586546.js');
|
31
34
|
|
@@ -3069,7 +3072,7 @@ const SparkleCourseRoot = class {
|
|
3069
3072
|
this.config = {
|
3070
3073
|
appUrl: 'http://localhost:3333',
|
3071
3074
|
globalAssetsUrl: 'http://localhost:3333/assets',
|
3072
|
-
apiUrl: 'https://localhost:
|
3075
|
+
apiUrl: 'https://localhost:44369/',
|
3073
3076
|
quizPath: this.quizPath,
|
3074
3077
|
tocPath: this.tocPath,
|
3075
3078
|
menu: {
|
@@ -3118,6 +3121,10 @@ const SparkleCourseRoot = class {
|
|
3118
3121
|
var sidebar = document.getElementById('onlineStudents');
|
3119
3122
|
await sidebar.show();
|
3120
3123
|
}
|
3124
|
+
useDidLogin(event) {
|
3125
|
+
console.log('Received the userDidLogInevent: ', event.detail);
|
3126
|
+
return index.h("stencil-router-redirect", { url: "/home" });
|
3127
|
+
}
|
3121
3128
|
renderPage(path) {
|
3122
3129
|
return (index.h("stencil-route", { url: '/' + path, routeRender: props => [
|
3123
3130
|
this.renderHeaderAndMenu(),
|
@@ -12543,7 +12550,7 @@ const FacilitatorPage = class {
|
|
12543
12550
|
}
|
12544
12551
|
path = /^\/docs\/pages\/[a-z]{2}\.json$/.test(path) ? path.replace('.json', '/index.json') : path;
|
12545
12552
|
let lessonPath = this.getLessonPath(path);
|
12546
|
-
console.log(lessonPath);
|
12553
|
+
console.log("lessonPath", lessonPath);
|
12547
12554
|
return fetch(path).then(this.validateFetch).then(this.handleNotesPage).catch(this.handleBadFetch) &&
|
12548
12555
|
fetch(lessonPath).then(this.validateFetch).then(this.handleLessonNotesPage).catch(this.handleLessonNotesBadFetch);
|
12549
12556
|
}
|
@@ -12556,7 +12563,7 @@ const FacilitatorPage = class {
|
|
12556
12563
|
if (path === null || path === oldPath) {
|
12557
12564
|
return;
|
12558
12565
|
}
|
12559
|
-
if (signalR_service.SignalRService.getInstance().connection.
|
12566
|
+
if (signalR_service.SignalRService.getInstance().connection._connectionState == "Connected") {
|
12560
12567
|
signalR_service.SignalRService.getInstance().callSignalR("NavigateFacilitatorPresentationCourseTo", { url: this.path.replace(".json", "") });
|
12561
12568
|
}
|
12562
12569
|
path = /^\/docs\/pages\/[a-z]{2}\.json$/.test(path) ? path.replace('.json', '/index.json') : path;
|
@@ -12632,7 +12639,6 @@ const FacilitatorPage = class {
|
|
12632
12639
|
return index.h(Template, { page: notesPage });
|
12633
12640
|
}
|
12634
12641
|
__stencil_render() {
|
12635
|
-
console.log(facilitator_service.facilitatorStore.state.classes);
|
12636
12642
|
const { page } = this;
|
12637
12643
|
const content = this.renderTabs();
|
12638
12644
|
return index.h("div", { class: "container" }, index.h("div", { class: "d-flex justify-content-between align-items-center" }, index.h("sparkle-page-footer", { page: page }), index.h("div", null, index.h("select", { class: "form-select", "aria-label": "Default select example" }, facilitator_service.facilitatorStore.state.classes.map(item => index.h("option", null, item.ClassName))))), content);
|
@@ -12796,7 +12802,7 @@ const SparkleGoals = class {
|
|
12796
12802
|
index.registerInstance(this, hostRef);
|
12797
12803
|
}
|
12798
12804
|
async componentDidLoad() {
|
12799
|
-
await
|
12805
|
+
await appdata_service.AppDataService.getInstance().getAllGoals();
|
12800
12806
|
}
|
12801
12807
|
async presentAddGoalModal(appData) {
|
12802
12808
|
const modal = await overlays.modalController.create({
|
@@ -12807,8 +12813,8 @@ const SparkleGoals = class {
|
|
12807
12813
|
await modal.present();
|
12808
12814
|
}
|
12809
12815
|
render() {
|
12810
|
-
return (index.h(index.Host, null, index.h("h2", null, "MY GOALS"), index.h("ion-item", { lines: "none" }, index.h("ion-button", { size: "default", color: "primary", slot: "end", onClick: () => this.presentAddGoalModal(null) }, index.h("ion-icon", { name: "add-outline" }), "Add")), index.h("div", { class: "ion-padding" }, index.h("sparkle-cards", null,
|
12811
|
-
&& index.h("div", { class: "text-center" }, "No Goals"),
|
12816
|
+
return (index.h(index.Host, null, index.h("h2", null, "MY GOALS"), index.h("ion-item", { lines: "none" }, index.h("ion-button", { size: "default", color: "primary", slot: "end", onClick: () => this.presentAddGoalModal(null) }, index.h("ion-icon", { name: "add-outline" }), "Add")), index.h("div", { class: "ion-padding" }, index.h("sparkle-cards", null, appdata_service.goalStore.state.goals.map((goal) => index.h("div", { style: { "position": "relative" } }, index.h("sparkle-goal-item", { goal: goal.AppData, onEditGoal: () => this.presentAddGoalModal(goal) })))), !appdata_service.goalStore.state.goalsLoading && appdata_service.goalStore.state.goals.length == 0
|
12817
|
+
&& index.h("div", { class: "text-center" }, "No Goals"), appdata_service.goalStore.state.goalsLoading &&
|
12812
12818
|
index.h("div", { class: "text-center" }, index.h("ion-spinner", { name: "dots" })))));
|
12813
12819
|
}
|
12814
12820
|
};
|
@@ -12979,39 +12985,6 @@ const SparkleHeader = class {
|
|
12979
12985
|
};
|
12980
12986
|
SparkleHeader.style = headerCss;
|
12981
12987
|
|
12982
|
-
const { state, reset } = auth_store.createStore({
|
12983
|
-
mediaUploading: false,
|
12984
|
-
});
|
12985
|
-
const mediaStore = { state, reset };
|
12986
|
-
|
12987
|
-
class MediaService {
|
12988
|
-
constructor() { }
|
12989
|
-
static getInstance() {
|
12990
|
-
if (!MediaService.instance) {
|
12991
|
-
MediaService.instance = new MediaService();
|
12992
|
-
}
|
12993
|
-
return MediaService.instance;
|
12994
|
-
}
|
12995
|
-
async uploadImage(files) {
|
12996
|
-
let formData = new FormData();
|
12997
|
-
for (let i = 0; i < files.length; i++) {
|
12998
|
-
formData.append("uploads[]", files[i], files[i].name);
|
12999
|
-
}
|
13000
|
-
mediaStore.state.mediaUploading = true;
|
13001
|
-
let result;
|
13002
|
-
try {
|
13003
|
-
result = await httpService.HttpService.http.post(`api/v1/MediaItems/Upload`, formData);
|
13004
|
-
if (result) {
|
13005
|
-
mediaStore.state.mediaUploading = false;
|
13006
|
-
}
|
13007
|
-
}
|
13008
|
-
catch (e) {
|
13009
|
-
mediaStore.state.mediaUploading = false;
|
13010
|
-
}
|
13011
|
-
return result;
|
13012
|
-
}
|
13013
|
-
}
|
13014
|
-
|
13015
12988
|
const sparkleHealthCss = ":host{display:block}.health-image{display:block;max-width:300px;max-height:200px;width:auto;height:auto}";
|
13016
12989
|
|
13017
12990
|
const SparkleHealth = class {
|
@@ -13042,7 +13015,7 @@ const SparkleHealth = class {
|
|
13042
13015
|
this.submitted = true;
|
13043
13016
|
console.log(event.target.files);
|
13044
13017
|
if (event.target.files && event.target.files[0]) {
|
13045
|
-
const result = await MediaService.getInstance().uploadImage(event.target.files);
|
13018
|
+
const result = await media_service.MediaService.getInstance().uploadImage(event.target.files);
|
13046
13019
|
if (result.Succeeded && result.Data && result.Data.length > 0) {
|
13047
13020
|
this.uploadedImageUrl = result.Data[0].FullImageUrl;
|
13048
13021
|
console.log(this.uploadedImageUrl);
|
@@ -13053,7 +13026,7 @@ const SparkleHealth = class {
|
|
13053
13026
|
this.el.querySelector("#fileInput").click();
|
13054
13027
|
}
|
13055
13028
|
render() {
|
13056
|
-
return (index.h(index.Host, null, index.h("div", null, index.h("h3", null, "MY HEALTH"), index.h("p", null, "This mini-app will help girls develop and instil good physical health habits"), index.h("ion-list", null, index.h("ion-list-header", null, "Select Heart Rate"), index.h("ion-item", { lines: "none" }, index.h("ion-range", { min: 0, max: 150, step: 1, snaps: true, pin: true, onIonChange: (ev) => this.heartRate = +ev.detail.value }, index.h("ion-icon", { size: "small", slot: "start", name: "pulse" }), index.h("ion-icon", { name: "pulse", size: "small" }), index.h("div", { slot: "end" }, index.h("strong", null, this.heartRate)))), this.uploadedImageUrl && index.h("ion-item", { lines: "none" }, index.h("img", { class: "health-image", src: this.uploadedImageUrl })), index.h("ion-item", { lines: "none" }, index.h("input", { type: "file", id: "fileInput", onChange: (ev) => this.uploadImage(ev), style: { display: "none" }, accept: "image/*" }), index.h("div", null, index.h("ion-button", { onClick: () => this.selectFile(), disabled: mediaStore.state.mediaUploading }, mediaStore.state.mediaUploading && index.h("ion-spinner", { name: "dots" }), "Upload Image"))), index.h("ion-item", { lines: "none" }, index.h("ion-label", null, "Share to Community Wall"), index.h("ion-checkbox", { slot: "start", onChange: (ev) => this.public = ev.detail.checked, checked: true })), index.h("ion-item", { lines: "none" }, index.h("ion-button", { slot: "end", color: "primary", size: "default", onClick: () => this.postFeed(), disabled: mediaStore.state.mediaUploading || feed_service.feedStore.state.createPostLoading }, feed_service.feedStore.state.createPostLoading && index.h("ion-spinner", { name: "dots" }), " POST"))))));
|
13029
|
+
return (index.h(index.Host, null, index.h("div", null, index.h("h3", null, "MY HEALTH"), index.h("p", null, "This mini-app will help girls develop and instil good physical health habits"), index.h("ion-list", null, index.h("ion-list-header", null, "Select Heart Rate"), index.h("ion-item", { lines: "none" }, index.h("ion-range", { min: 0, max: 150, step: 1, snaps: true, pin: true, onIonChange: (ev) => this.heartRate = +ev.detail.value }, index.h("ion-icon", { size: "small", slot: "start", name: "pulse" }), index.h("ion-icon", { name: "pulse", size: "small" }), index.h("div", { slot: "end" }, index.h("strong", null, this.heartRate)))), this.uploadedImageUrl && index.h("ion-item", { lines: "none" }, index.h("img", { class: "health-image", src: this.uploadedImageUrl })), index.h("ion-item", { lines: "none" }, index.h("input", { type: "file", id: "fileInput", onChange: (ev) => this.uploadImage(ev), style: { display: "none" }, accept: "image/*" }), index.h("div", null, index.h("ion-button", { onClick: () => this.selectFile(), disabled: media_service.mediaStore.state.mediaUploading }, media_service.mediaStore.state.mediaUploading && index.h("ion-spinner", { name: "dots" }), "Upload Image"))), index.h("ion-item", { lines: "none" }, index.h("ion-label", null, "Share to Community Wall"), index.h("ion-checkbox", { slot: "start", onChange: (ev) => this.public = ev.detail.checked, checked: true })), index.h("ion-item", { lines: "none" }, index.h("ion-button", { slot: "end", color: "primary", size: "default", onClick: () => this.postFeed(), disabled: media_service.mediaStore.state.mediaUploading || feed_service.feedStore.state.createPostLoading }, feed_service.feedStore.state.createPostLoading && index.h("ion-spinner", { name: "dots" }), " POST"))))));
|
13057
13030
|
}
|
13058
13031
|
get el() { return index.getElement(this); }
|
13059
13032
|
};
|
@@ -13126,12 +13099,13 @@ const PageLogin = class {
|
|
13126
13099
|
this.submitted = true;
|
13127
13100
|
if (this.password.valid && this.username.valid) {
|
13128
13101
|
//await UserData.login(this.username.value);
|
13129
|
-
await PrivateRoute.AuthService.getInstance().authenticate({
|
13102
|
+
let result = await PrivateRoute.AuthService.getInstance().authenticate({
|
13130
13103
|
Email: this.username.value,
|
13131
13104
|
Password: this.password.value,
|
13132
13105
|
RememberClient: this.rememberMe.value
|
13133
13106
|
});
|
13134
|
-
|
13107
|
+
console.log(result);
|
13108
|
+
//sessionStorage.setItem('rememberMe', this.rememberMe.value == true ? '1' : '0');
|
13135
13109
|
this.userDidLogIn.emit({ loginStatus: true });
|
13136
13110
|
}
|
13137
13111
|
}
|
@@ -13394,7 +13368,7 @@ const SparkleOnlineStudents = class {
|
|
13394
13368
|
};
|
13395
13369
|
SparkleOnlineStudents.style = onlineStudentsCss;
|
13396
13370
|
|
13397
|
-
const pageCss = ".Error{align-items:center;background-color:var(--offset-background);color:var(--text-color--light);display:flex;flex-direction:column;justify-content:center;line-height:1;white-space:nowrap}.Error.full-screen{padding-bottom:3rem}.Error>*{margin:10px}.Error h1,.Error div{color:inherit;font-size:3rem}.Error div{text-shadow:3px 3px 3px rgba(0,0,0,0.1)}.Error p{font-size:18px}sparkle-page{display:grid;font-size:16px;grid-template-columns:1fr minmax(0, var(--page-width, 720px)) 1fr;line-height:2;margin-left:var(--page-margin-left);margin-top:var(--header-height);overflow-x:hidden;transform:var(--page-transform, none);transition:transform 200ms cubic-bezier(0.2, 1, 0.2, 1)}@media (min-width: 1234px){sparkle-page{grid-template-columns:1fr minmax(0, var(--page-width, 720px)) 3fr}}@media (min-width: 1800px){sparkle-page{grid-template-columns:1fr minmax(0, var(--page-width, 720px)) 1fr 240px}}sparkle-page>main{position:relative;grid-column:2;margin-bottom:3rem;padding:var(--page-padding, 2rem 1rem);position:relative}sparkle-page sparkle-pagination{grid-column:1 / -1}sparkle-page .full-screen{grid-column:1 / -1;height:calc(100vh - var(--header-height));margin-bottom:0;overflow:hidden;padding:0}sparkle-page .page-heading-encapsulation{text-transform:uppercase;background:transparent;color:#2d4665;border:1px solid #dee3ea;border-radius:14px;height:24px;padding:2px 8px;font-weight:600;font-size:10px;line-height:14px;display:inline-flex;align-items:center;align-self:center;justify-self:flex-end;letter-spacing:0.08em;float:right}sparkle-page .page-heading-encapsulation:hover{border-color:#92a1b3}sparkle-page h1{display:flex;justify-content:space-between;margin-top:2rem;margin-bottom:1rem}sparkle-page h2 a[href^='#'],sparkle-page h3 a[href^='#'],sparkle-page h4 a[href^='#'],sparkle-page h5 a[href^='#'],sparkle-page h6 a[href^='#']{color:inherit;position:relative}sparkle-page h2 a[href^='#']:before,sparkle-page h3 a[href^='#']:before,sparkle-page h4 a[href^='#']:before,sparkle-page h5 a[href^='#']:before,sparkle-page h6 a[href^='#']:before{content:'#';opacity:0;padding-right:5px;position:absolute;right:100%;transition:opacity 100ms ease}sparkle-page h2 a[href^='#']:hover:before,sparkle-page h3 a[href^='#']:hover:before,sparkle-page h4 a[href^='#']:hover:before,sparkle-page h5 a[href^='#']:hover:before,sparkle-page h6 a[href^='#']:hover:before{opacity:1}sparkle-page h2 code,sparkle-page h3 code,sparkle-page h4 code,sparkle-page h5 code,sparkle-page h6 code{background:none;font-size:inherit}sparkle-page aside{float:right;margin-left:20px;margin-bottom:20px}@media (min-width: 1234px){sparkle-page main.no-demo .page-meta{position:fixed;right:0;top:100px;width:240px;transition:0.2s transform ease}sparkle-header.hidden~stencil-route sparkle-page main.no-demo .page-meta{transform:translateY(-60px)}}sparkle-page main.has-demo .page-meta internal-ad{display:none}sparkle-page .controls{display:flex;justify-content:flex-end}";
|
13371
|
+
const pageCss = ".Error{align-items:center;background-color:var(--offset-background);color:var(--text-color--light);display:flex;flex-direction:column;justify-content:center;line-height:1;white-space:nowrap}.Error.full-screen{padding-bottom:3rem}.Error>*{margin:10px}.Error h1,.Error div{color:inherit;font-size:3rem}.Error div{text-shadow:3px 3px 3px rgba(0,0,0,0.1)}.Error p{font-size:18px}sparkle-page{display:grid;font-size:16px;grid-template-columns:1fr minmax(0, var(--page-width, 720px)) 1fr;line-height:2;margin-left:var(--page-margin-left);margin-top:var(--header-height);overflow-x:hidden;transform:var(--page-transform, none);transition:transform 200ms cubic-bezier(0.2, 1, 0.2, 1)}@media (min-width: 1234px){sparkle-page{grid-template-columns:1fr minmax(0, var(--page-width, 720px)) 3fr}}@media (min-width: 1800px){sparkle-page{grid-template-columns:1fr minmax(0, var(--page-width, 720px)) 1fr 240px}}sparkle-page>main{position:relative;grid-column:2;margin-bottom:3rem;padding:var(--page-padding, 2rem 1rem);position:relative}sparkle-page sparkle-pagination{grid-column:1 / -1}sparkle-page .full-screen{grid-column:1 / -1;height:calc(100vh - var(--header-height));margin-bottom:0;overflow:hidden;padding:0}sparkle-page .page-heading-encapsulation{text-transform:uppercase;background:transparent;color:#2d4665;border:1px solid #dee3ea;border-radius:14px;height:24px;padding:2px 8px;font-weight:600;font-size:10px;line-height:14px;display:inline-flex;align-items:center;align-self:center;justify-self:flex-end;letter-spacing:0.08em;float:right}sparkle-page .page-heading-encapsulation:hover{border-color:#92a1b3}sparkle-page h1{display:flex;justify-content:space-between;margin-top:2rem;margin-bottom:1rem}sparkle-page h2 a[href^='#'],sparkle-page h3 a[href^='#'],sparkle-page h4 a[href^='#'],sparkle-page h5 a[href^='#'],sparkle-page h6 a[href^='#']{color:inherit;position:relative}sparkle-page h2 a[href^='#']:before,sparkle-page h3 a[href^='#']:before,sparkle-page h4 a[href^='#']:before,sparkle-page h5 a[href^='#']:before,sparkle-page h6 a[href^='#']:before{content:'#';opacity:0;padding-right:5px;position:absolute;right:100%;transition:opacity 100ms ease}sparkle-page h2 a[href^='#']:hover:before,sparkle-page h3 a[href^='#']:hover:before,sparkle-page h4 a[href^='#']:hover:before,sparkle-page h5 a[href^='#']:hover:before,sparkle-page h6 a[href^='#']:hover:before{opacity:1}sparkle-page h2 code,sparkle-page h3 code,sparkle-page h4 code,sparkle-page h5 code,sparkle-page h6 code{background:none;font-size:inherit}sparkle-page aside{float:right;margin-left:20px;margin-bottom:20px}@media (min-width: 1234px){sparkle-page main.no-demo .page-meta{position:fixed;right:0;top:100px;width:240px;transition:0.2s transform ease}sparkle-header.hidden~stencil-route sparkle-page main.no-demo .page-meta{transform:translateY(-60px)}}sparkle-page main.has-demo .page-meta internal-ad{display:none}sparkle-page .controls{display:flex;justify-content:flex-end}.controls ion-button ion-icon{color:#fff}";
|
13398
13372
|
|
13399
13373
|
const SparklePage = class {
|
13400
13374
|
constructor(hostRef) {
|
@@ -13403,7 +13377,15 @@ const SparklePage = class {
|
|
13403
13377
|
this.presentation = false;
|
13404
13378
|
this.page = { title: null, path: null, body: null, pageInfo: null };
|
13405
13379
|
this.isLesson = false;
|
13406
|
-
this.
|
13380
|
+
this.eventEmitter = (user, data) => {
|
13381
|
+
let event = new CustomEvent('receivedSignalREvent', { detail: JSON.parse(data) });
|
13382
|
+
document.body.dispatchEvent(event);
|
13383
|
+
};
|
13384
|
+
this.pollSubmissionEventEmitter = (type, data) => {
|
13385
|
+
let event = new CustomEvent('receivedPollSubmissionSignalREvent', { detail: { data: data, type: type } });
|
13386
|
+
document.body.dispatchEvent(event);
|
13387
|
+
};
|
13388
|
+
this.handleFacilitatorNavigationChange = url => {
|
13407
13389
|
this.history.replace(url, {});
|
13408
13390
|
};
|
13409
13391
|
this.validateFetch = (response) => {
|
@@ -13416,7 +13398,7 @@ const SparklePage = class {
|
|
13416
13398
|
this.badFetch = null;
|
13417
13399
|
this.page = page;
|
13418
13400
|
if (this.presentation) {
|
13419
|
-
this.page = Object.assign(Object.assign({}, this.page), { previousUrl:
|
13401
|
+
this.page = Object.assign(Object.assign({}, this.page), { previousUrl: '/presentation' + this.page.previousUrl, nextUrl: '/presentation' + this.page.nextUrl });
|
13420
13402
|
}
|
13421
13403
|
StoreService.getInstance().UpdateTocPageInfo(this.page.pageInfo);
|
13422
13404
|
this.isLesson = this.page.pageInfo.pageId > 0;
|
@@ -13428,7 +13410,7 @@ const SparklePage = class {
|
|
13428
13410
|
title: error.statusText,
|
13429
13411
|
body: null,
|
13430
13412
|
path: null,
|
13431
|
-
pageInfo: null
|
13413
|
+
pageInfo: null,
|
13432
13414
|
};
|
13433
13415
|
};
|
13434
13416
|
}
|
@@ -13439,19 +13421,25 @@ const SparklePage = class {
|
|
13439
13421
|
}
|
13440
13422
|
componentDidLoad() {
|
13441
13423
|
if (this.presentation) {
|
13442
|
-
signalR_service.signalRStore.onChange(
|
13424
|
+
signalR_service.signalRStore.onChange('connected', connected => {
|
13443
13425
|
if (connected) {
|
13444
|
-
signalR_service.SignalRService.getInstance().connection.on(
|
13426
|
+
signalR_service.SignalRService.getInstance().connection.on('SendMessage', this.eventEmitter);
|
13427
|
+
signalR_service.SignalRService.getInstance().connection.on('NavigateFacilitatorPresentationCourseTo', this.handleFacilitatorNavigationChange);
|
13428
|
+
signalR_service.SignalRService.getInstance().connection.on('PollSubmission', this.pollSubmissionEventEmitter);
|
13429
|
+
}
|
13430
|
+
else {
|
13431
|
+
signalR_service.SignalRService.getInstance().connection.off('SendMessage', this.eventEmitter);
|
13432
|
+
signalR_service.SignalRService.getInstance().connection.off('PollSubmission', this.eventEmitter);
|
13433
|
+
signalR_service.SignalRService.getInstance().connection.off('NavigateFacilitatorPresentationCourseTo', this.handleFacilitatorNavigationChange);
|
13445
13434
|
}
|
13446
13435
|
});
|
13447
13436
|
}
|
13448
13437
|
}
|
13449
13438
|
fetchPage(path, oldPath) {
|
13450
|
-
if (signalR_service.SignalRService.getInstance().connection.
|
13451
|
-
signalR_service.SignalRService.getInstance().callSignalR(
|
13439
|
+
if (signalR_service.SignalRService.getInstance().connection._connectionState == 'Connected') {
|
13440
|
+
signalR_service.SignalRService.getInstance().callSignalR('OnStudentNavigate', { url: window.location.href });
|
13452
13441
|
if (this.presentation) {
|
13453
|
-
|
13454
|
-
signalR_service.SignalRService.getInstance().connection.on("NavigateFacilitatorPresentationCourseTo", this.handleFacilitatorNavigationChange);
|
13442
|
+
signalR_service.SignalRService.getInstance().connection.on('NavigateFacilitatorPresentationCourseTo', this.handleFacilitatorNavigationChange);
|
13455
13443
|
}
|
13456
13444
|
}
|
13457
13445
|
if (path === null || path === oldPath) {
|
@@ -13522,7 +13510,7 @@ const SparklePage = class {
|
|
13522
13510
|
async presentFeedbackModal() {
|
13523
13511
|
const modal = await overlays.modalController.create({
|
13524
13512
|
component: 'sparkle-feedback',
|
13525
|
-
cssClass: 'sparkle-modal sparkle-feedback-modal'
|
13513
|
+
cssClass: 'sparkle-modal sparkle-feedback-modal',
|
13526
13514
|
});
|
13527
13515
|
await modal.present();
|
13528
13516
|
}
|
@@ -13553,29 +13541,28 @@ const SparklePage = class {
|
|
13553
13541
|
text: 'Cancel',
|
13554
13542
|
role: 'cancel',
|
13555
13543
|
cssClass: 'secondary',
|
13556
|
-
handler: () => {
|
13557
|
-
|
13558
|
-
|
13544
|
+
handler: () => { },
|
13545
|
+
},
|
13546
|
+
{
|
13559
13547
|
text: 'Ok',
|
13560
|
-
handler:
|
13561
|
-
|
13562
|
-
|
13563
|
-
]
|
13548
|
+
handler: data => { },
|
13549
|
+
},
|
13550
|
+
],
|
13564
13551
|
});
|
13565
13552
|
await alert.present();
|
13566
13553
|
}
|
13567
13554
|
openWindows() {
|
13568
13555
|
//this.jwtService.updateDefaultCourseClassId(data);
|
13569
|
-
window.open(window.location.origin +
|
13556
|
+
window.open(window.location.origin + '/presentation' + this.path.replace('.json', ''), '_blank');
|
13570
13557
|
setTimeout(() => {
|
13571
|
-
window.open(window.location.origin +
|
13558
|
+
window.open(window.location.origin + '/presentation' + '/teacher' + this.path.replace('.json', ''), '_blank');
|
13572
13559
|
}, 500);
|
13573
13560
|
}
|
13574
13561
|
renderControls() {
|
13575
13562
|
if (auth_store.AuthStore.state.isAuthenticated) {
|
13576
|
-
return (index.h("div", { class: "controls" }, index.h("ion-button", { onClick: () => this.presentFeedbackModal() }, index.h("ion-icon", { name: "chatbox-outline" })), this.isLesson && student_service.userStore.state.user && student_service.userStore.state.user.Roles.indexOf('Facilitator') > -1 && index.h("ion-button", { onClick: () => this.openProjectorPage() }, index.h("ion-icon", { name: "desktop-outline" }))));
|
13563
|
+
return (index.h("div", { class: "controls" }, index.h("ion-button", { onClick: () => this.presentFeedbackModal() }, index.h("ion-icon", { name: "chatbox-outline" })), this.isLesson && student_service.userStore.state.user && student_service.userStore.state.user.Roles.indexOf('Facilitator') > -1 && (index.h("ion-button", { onClick: () => this.openProjectorPage() }, index.h("ion-icon", { name: "desktop-outline" })))));
|
13577
13564
|
}
|
13578
|
-
return
|
13565
|
+
return '';
|
13579
13566
|
}
|
13580
13567
|
__stencil_render() {
|
13581
13568
|
if (this.path) {
|
@@ -13585,12 +13572,12 @@ const SparklePage = class {
|
|
13585
13572
|
}
|
13586
13573
|
const Template = templates[page.template] || templates.default;
|
13587
13574
|
const content = [
|
13588
|
-
index.h("main", { class: 'no-demo' }, this.renderControls(), index.h(Template, { page: page }))
|
13575
|
+
index.h("main", { class: 'no-demo' }, this.renderControls(), index.h(Template, { page: page })),
|
13589
13576
|
];
|
13590
13577
|
return content;
|
13591
13578
|
}
|
13592
13579
|
else {
|
13593
|
-
return index.h("main", { class: 'no-demo' }, index.h("slot", null));
|
13580
|
+
return (index.h("main", { class: 'no-demo' }, index.h("slot", null)));
|
13594
13581
|
}
|
13595
13582
|
}
|
13596
13583
|
static get watchers() { return {
|
@@ -13752,22 +13739,24 @@ const SparkleRoot = class {
|
|
13752
13739
|
constructor(hostRef) {
|
13753
13740
|
index.registerInstance(this, hostRef);
|
13754
13741
|
this.history = null;
|
13755
|
-
this.handleStudentNavigationChange =
|
13742
|
+
this.handleStudentNavigationChange = url => {
|
13756
13743
|
this.history.replace(url, {});
|
13757
13744
|
};
|
13758
13745
|
}
|
13759
13746
|
async componentWillLoad() {
|
13760
13747
|
PrivateRoute.setupConfig({
|
13761
|
-
sparkle: Object.assign(Object.assign({}, this.config), { prod: true })
|
13748
|
+
sparkle: Object.assign(Object.assign({}, this.config), { prod: true }),
|
13762
13749
|
});
|
13763
13750
|
//return Promise.reject();
|
13764
13751
|
await httpService.HttpService.getInstance();
|
13765
13752
|
await httpService.HttpService.init();
|
13766
|
-
|
13767
|
-
|
13753
|
+
let auth = await localstorage_service.get(token_service.AppConsts.AUTH_USER_LOCALSTORAGE);
|
13754
|
+
console.log(auth);
|
13755
|
+
//TODO: check expiry as well
|
13756
|
+
if (auth && auth.JWToken) {
|
13768
13757
|
auth_store.AuthStore.state.isAuthenticated = true;
|
13769
13758
|
}
|
13770
|
-
auth_store.AuthStore.onChange(
|
13759
|
+
auth_store.AuthStore.onChange('isAuthenticated', async (isAuthenticated) => {
|
13771
13760
|
if (isAuthenticated) {
|
13772
13761
|
console.log('authenticated');
|
13773
13762
|
await student_service.StudentService.getInstance().fetchUserConfiguration();
|
@@ -13779,8 +13768,8 @@ const SparkleRoot = class {
|
|
13779
13768
|
//SignalRAspNetCoreHelper.initSignalR();
|
13780
13769
|
}
|
13781
13770
|
componentDidLoad() {
|
13782
|
-
signalR_service.SignalRService.getInstance().connection.on(
|
13783
|
-
auth_store.AuthStore.onChange(
|
13771
|
+
signalR_service.SignalRService.getInstance().connection.on('NavigateStudentTo', this.handleStudentNavigationChange);
|
13772
|
+
auth_store.AuthStore.onChange('isAuthenticated', async (isAuthenticated) => {
|
13784
13773
|
if (isAuthenticated) {
|
13785
13774
|
signalR_service.SignalRService.getInstance().start();
|
13786
13775
|
}
|
@@ -14085,7 +14074,7 @@ const SparkleUserProfile = class {
|
|
14085
14074
|
}
|
14086
14075
|
async uploadProfileImage(event) {
|
14087
14076
|
if (event.target.files && event.target.files[0]) {
|
14088
|
-
const result = await MediaService.getInstance().uploadImage(event.target.files);
|
14077
|
+
const result = await media_service.MediaService.getInstance().uploadImage(event.target.files);
|
14089
14078
|
if (result.Succeeded && result.Data && result.Data.length > 0) {
|
14090
14079
|
this.changeFormValue("ProfileImage", result.Data[0].FullImageUrl);
|
14091
14080
|
await this.updateUser();
|
@@ -14096,7 +14085,7 @@ const SparkleUserProfile = class {
|
|
14096
14085
|
this.el.querySelector("#fileInput").click();
|
14097
14086
|
}
|
14098
14087
|
render() {
|
14099
|
-
return (index.h(index.Host, null, index.h("ion-card", { color: "sparkle" }, index.h("div", { class: "img-wrapper" }, index.h("img", { class: mediaStore.state.mediaUploading ? "loading" : '', src: this.profileFormControls.ProfileImage.value || index.getAssetPath(`../assets/svg/profile.svg`) }), index.h("input", { type: "file", id: "fileInput", onChange: (ev) => this.uploadProfileImage(ev), style: { display: "none" }, accept: "image/*" }), index.h("ion-button", { color: "sparkle", onClick: () => this.selectFile(), disabled: mediaStore.state.mediaUploading }, index.h("ion-icon", { slot: "icon-only", name: "camera-outline" })), mediaStore.state.mediaUploading && index.h("ion-spinner", { class: "image-upload-loading", name: "dots" })), index.h("ion-card-content", { class: "ion-text-center" }, index.h("h2", null, this.profileFormControls.FirstName.value, " ", this.profileFormControls.LastName.value), index.h("h3", null, this.profileFormControls.ProfileText.value))), index.h("form", { onSubmit: e => this.handleProfileFormSubmit(e), novalidate: true }, index.h("ion-list", { "no-lines": true }, index.h("ion-item", null, index.h("ion-label", { position: "stacked", color: "primary" }, "First Name"), index.h("ion-input", { name: "firstName", type: "text", value: this.profileFormControls.FirstName.value, onInput: (ev) => this.changeFormValue("FirstName", ev.target.value) })), index.h("ion-text", { color: "danger" }, index.h("p", { hidden: this.profileFormControls.FirstName.isValid || this.profileFormSubmitted === false, class: "ion-padding-start" }, "First Name is required")), index.h("ion-item", null, index.h("ion-label", { position: "stacked", color: "primary" }, "Last Name"), index.h("ion-input", { name: "lastName", type: "text", value: this.profileFormControls.LastName.value, onInput: (ev) => this.changeFormValue("LastName", ev.target.value) })), index.h("ion-text", { color: "danger" }, index.h("p", { hidden: this.profileFormControls.LastName.isValid || this.profileFormSubmitted === false, class: "ion-padding-start" }, "Last Name is required")), index.h("ion-item", null, index.h("ion-label", { position: "stacked", color: "primary" }, "Profile Bio"), index.h("ion-input", { name: "lastName", type: "text", value: this.profileFormControls.ProfileText.value, onInput: (ev) => this.changeFormValue("ProfileText", ev.target.value) })), index.h("ion-text", { color: "danger" }, index.h("p", { hidden: this.profileFormControls.ProfileText.isValid || this.profileFormSubmitted === false, class: "ion-padding-start" }, "Profile Bio is required"))), index.h("div", { class: "ion-padding" }, index.h("ion-button", { type: "submit", expand: "block", disabled: student_service.userStore.state.updateLoading }, student_service.userStore.state.updateLoading && index.h("ion-spinner", { name: "dots" }), " Update")))));
|
14088
|
+
return (index.h(index.Host, null, index.h("ion-card", { color: "sparkle" }, index.h("div", { class: "img-wrapper" }, index.h("img", { class: media_service.mediaStore.state.mediaUploading ? "loading" : '', src: this.profileFormControls.ProfileImage.value || index.getAssetPath(`../assets/svg/profile.svg`) }), index.h("input", { type: "file", id: "fileInput", onChange: (ev) => this.uploadProfileImage(ev), style: { display: "none" }, accept: "image/*" }), index.h("ion-button", { color: "sparkle", onClick: () => this.selectFile(), disabled: media_service.mediaStore.state.mediaUploading }, index.h("ion-icon", { slot: "icon-only", name: "camera-outline" })), media_service.mediaStore.state.mediaUploading && index.h("ion-spinner", { class: "image-upload-loading", name: "dots" })), index.h("ion-card-content", { class: "ion-text-center" }, index.h("h2", null, this.profileFormControls.FirstName.value, " ", this.profileFormControls.LastName.value), index.h("h3", null, this.profileFormControls.ProfileText.value))), index.h("form", { onSubmit: e => this.handleProfileFormSubmit(e), novalidate: true }, index.h("ion-list", { "no-lines": true }, index.h("ion-item", null, index.h("ion-label", { position: "stacked", color: "primary" }, "First Name"), index.h("ion-input", { name: "firstName", type: "text", value: this.profileFormControls.FirstName.value, onInput: (ev) => this.changeFormValue("FirstName", ev.target.value) })), index.h("ion-text", { color: "danger" }, index.h("p", { hidden: this.profileFormControls.FirstName.isValid || this.profileFormSubmitted === false, class: "ion-padding-start" }, "First Name is required")), index.h("ion-item", null, index.h("ion-label", { position: "stacked", color: "primary" }, "Last Name"), index.h("ion-input", { name: "lastName", type: "text", value: this.profileFormControls.LastName.value, onInput: (ev) => this.changeFormValue("LastName", ev.target.value) })), index.h("ion-text", { color: "danger" }, index.h("p", { hidden: this.profileFormControls.LastName.isValid || this.profileFormSubmitted === false, class: "ion-padding-start" }, "Last Name is required")), index.h("ion-item", null, index.h("ion-label", { position: "stacked", color: "primary" }, "Profile Bio"), index.h("ion-input", { name: "lastName", type: "text", value: this.profileFormControls.ProfileText.value, onInput: (ev) => this.changeFormValue("ProfileText", ev.target.value) })), index.h("ion-text", { color: "danger" }, index.h("p", { hidden: this.profileFormControls.ProfileText.isValid || this.profileFormSubmitted === false, class: "ion-padding-start" }, "Profile Bio is required"))), index.h("div", { class: "ion-padding" }, index.h("ion-button", { type: "submit", expand: "block", disabled: student_service.userStore.state.updateLoading }, student_service.userStore.state.updateLoading && index.h("ion-spinner", { name: "dots" }), " Update")))));
|
14100
14089
|
}
|
14101
14090
|
get el() { return index.getElement(this); }
|
14102
14091
|
};
|
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
const auth_store = require('./auth.store-1e630a7d.js');
|
4
4
|
const overlays = require('./overlays-32df265a.js');
|
5
|
-
const environmentConfig_service = require('./environment-config.service-
|
5
|
+
const environmentConfig_service = require('./environment-config.service-c8ff1f3d.js');
|
6
|
+
const token_service = require('./token.service-7a41953d.js');
|
6
7
|
|
7
8
|
var axios = auth_store.axios_1;
|
8
9
|
|
@@ -598,7 +599,7 @@ class HttpService {
|
|
598
599
|
this.http = axios.create({
|
599
600
|
baseURL: sparkleConfig.apiUrl,
|
600
601
|
headers: {
|
601
|
-
'Content-Type': 'application/json'
|
602
|
+
'Content-Type': 'application/json',
|
602
603
|
},
|
603
604
|
timeout: 30000,
|
604
605
|
paramsSerializer: function (params) {
|
@@ -607,9 +608,10 @@ class HttpService {
|
|
607
608
|
});
|
608
609
|
},
|
609
610
|
});
|
610
|
-
this.http.interceptors.request.use(function (config) {
|
611
|
-
|
612
|
-
|
611
|
+
this.http.interceptors.request.use(async function (config) {
|
612
|
+
let token = await token_service.TokenService.getInstance().getToken();
|
613
|
+
if (token) {
|
614
|
+
config.headers.common['Authorization'] = 'Bearer ' + token;
|
613
615
|
}
|
614
616
|
// //config.headers.common['.AspNetCore.Culture'] = sparkle.utils.getCookieValue('Sparkle.Localization.CultureName');
|
615
617
|
config.headers.common['Sparkle.CourseId'] = sparkleConfig.courseId;
|
@@ -627,7 +629,7 @@ class HttpService {
|
|
627
629
|
if (response.data.Message) {
|
628
630
|
const toast = await overlays.toastController.create({
|
629
631
|
message: response.data.Message,
|
630
|
-
duration: 3000
|
632
|
+
duration: 3000,
|
631
633
|
});
|
632
634
|
toast.present();
|
633
635
|
}
|
@@ -638,7 +640,7 @@ class HttpService {
|
|
638
640
|
// that falls out of the range of 2xx
|
639
641
|
const toast = await overlays.toastController.create({
|
640
642
|
message: error.response.data.ErrorMessage,
|
641
|
-
duration: 3000
|
643
|
+
duration: 3000,
|
642
644
|
});
|
643
645
|
toast.present();
|
644
646
|
return Promise.reject(error);
|
@@ -648,7 +650,7 @@ class HttpService {
|
|
648
650
|
// that falls out of the range of 2xx
|
649
651
|
const toast = await overlays.toastController.create({
|
650
652
|
message: error.response.data.Message,
|
651
|
-
duration: 3000
|
653
|
+
duration: 3000,
|
652
654
|
});
|
653
655
|
toast.present();
|
654
656
|
return Promise.reject(error.response.data);
|
@@ -658,7 +660,7 @@ class HttpService {
|
|
658
660
|
// that falls out of the range of 2xx
|
659
661
|
const toast = await overlays.toastController.create({
|
660
662
|
message: error.response.data.Message,
|
661
|
-
duration: 3000
|
663
|
+
duration: 3000,
|
662
664
|
});
|
663
665
|
toast.present();
|
664
666
|
return Promise.reject(error);
|
@@ -671,8 +673,8 @@ class HttpService {
|
|
671
673
|
}
|
672
674
|
else {
|
673
675
|
const toast = await overlays.toastController.create({
|
674
|
-
message:
|
675
|
-
duration: 3000
|
676
|
+
message: 'Unknown Error',
|
677
|
+
duration: 3000,
|
676
678
|
});
|
677
679
|
toast.present();
|
678
680
|
}
|
package/dist/cjs/index.cjs.js
CHANGED
@@ -2,17 +2,18 @@
|
|
2
2
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
4
4
|
|
5
|
-
const PrivateRoute = require('./PrivateRoute-
|
6
|
-
const environmentConfig_service = require('./environment-config.service-
|
7
|
-
const assets_service = require('./assets.service-
|
5
|
+
const PrivateRoute = require('./PrivateRoute-f97245ce.js');
|
6
|
+
const environmentConfig_service = require('./environment-config.service-c8ff1f3d.js');
|
7
|
+
const assets_service = require('./assets.service-bfa75092.js');
|
8
8
|
const auth_store = require('./auth.store-1e630a7d.js');
|
9
9
|
require('./index-51e8292e.js');
|
10
10
|
require('./localstorage.service-6346a41d.js');
|
11
|
-
require('./httpService-
|
11
|
+
require('./httpService-d2e7bf8f.js');
|
12
12
|
require('./overlays-32df265a.js');
|
13
13
|
require('./ionic-global-2cde9d3a.js');
|
14
14
|
require('./hardware-back-button-92d97ff8.js');
|
15
15
|
require('./helpers-c2496722.js');
|
16
|
+
require('./token.service-7a41953d.js');
|
16
17
|
|
17
18
|
|
18
19
|
|