@sparkle-learning/core 0.0.65 → 0.0.66
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-475e69ce.js → PrivateRoute-5587d53f.js} +0 -99
- package/dist/cjs/{appdata.service-ab6bfcc8.js → appdata.service-0c34ed2d.js} +4 -4
- package/dist/cjs/{assignment.service-690fb59c.js → assignment.service-981b8cb7.js} +2 -2
- package/dist/cjs/{httpService-d2e7bf8f.js → auth.service-fa7cd4b6.js} +100 -0
- package/dist/cjs/{facilitator.service-ff0e1659.js → facilitator.service-a46828df.js} +7 -7
- package/dist/cjs/{feed.service-8eca4de6.js → feed.service-6d8f58e2.js} +4 -4
- package/dist/cjs/header-mobile-collapse_61.cjs.entry.js +15 -15
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{media.service-8a1b9bc5.js → media.service-dc1f8cf5.js} +2 -2
- package/dist/cjs/sparkle-assignment.cjs.entry.js +3 -3
- package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +3 -3
- package/dist/cjs/sparkle-feed-post.cjs.entry.js +5 -5
- package/dist/cjs/sparkle-feedback.cjs.entry.js +3 -3
- package/dist/cjs/sparkle-file-upload.cjs.entry.js +3 -3
- package/dist/cjs/sparkle-goal-form.cjs.entry.js +4 -4
- package/dist/cjs/{student.service-6a085b00.js → student.service-e8c0a40d.js} +6 -6
- package/dist/collection/services/httpService.js +4 -1
- package/dist/esm/{PrivateRoute-c83727f9.js → PrivateRoute-7f03b168.js} +1 -99
- package/dist/esm/{appdata.service-4497cdd5.js → appdata.service-f4433b21.js} +1 -1
- package/dist/esm/{assignment.service-8d31f141.js → assignment.service-5d1d98f6.js} +1 -1
- package/dist/esm/{httpService-7986aeed.js → auth.service-16db0809.js} +102 -3
- package/dist/esm/{facilitator.service-18c47bdf.js → facilitator.service-dbbc8486.js} +1 -1
- package/dist/esm/{feed.service-b4f3cae4.js → feed.service-c6dc6d53.js} +1 -1
- package/dist/esm/header-mobile-collapse_61.entry.js +7 -7
- package/dist/esm/index.js +2 -2
- package/dist/esm/{media.service-6e90bc41.js → media.service-e54a3ffd.js} +1 -1
- package/dist/esm/sparkle-assignment.entry.js +3 -3
- package/dist/esm/sparkle-facilitator-notes-form.entry.js +3 -3
- package/dist/esm/sparkle-feed-post.entry.js +5 -5
- package/dist/esm/sparkle-feedback.entry.js +3 -3
- package/dist/esm/sparkle-file-upload.entry.js +3 -3
- package/dist/esm/sparkle-goal-form.entry.js +4 -4
- package/dist/esm/{student.service-12d66503.js → student.service-9b21ffa2.js} +1 -1
- package/dist/sparkle-core/index.esm.js +1 -1
- package/dist/sparkle-core/{p-38c842d5.entry.js → p-07e8ad22.entry.js} +1 -1
- package/dist/sparkle-core/p-1cde83fb.js +1 -0
- package/dist/sparkle-core/{p-5de1651a.entry.js → p-21af1e9e.entry.js} +4 -4
- package/dist/sparkle-core/{p-1adc98f6.js → p-4d470a94.js} +1 -1
- package/dist/sparkle-core/{p-b8d71ff4.js → p-4e36890b.js} +1 -1
- package/dist/sparkle-core/{p-f47fe1fe.entry.js → p-4ff307cc.entry.js} +1 -1
- package/dist/sparkle-core/p-83c39dfc.js +1 -0
- package/dist/sparkle-core/{p-4a0ab315.js → p-86774d01.js} +1 -1
- package/dist/sparkle-core/{p-517d51cc.entry.js → p-9363c0ff.entry.js} +1 -1
- package/dist/sparkle-core/{p-d0687f56.entry.js → p-a1e7c8b9.entry.js} +1 -1
- package/dist/sparkle-core/{p-5c333142.entry.js → p-b6d71c06.entry.js} +1 -1
- package/dist/sparkle-core/{p-0e8e539f.entry.js → p-bfc111bf.entry.js} +1 -1
- package/dist/sparkle-core/{p-39a31e43.js → p-c0c79958.js} +1 -1
- package/dist/sparkle-core/{p-3d81e425.js → p-dee198ac.js} +1 -1
- package/dist/sparkle-core/p-fb39c577.js +1 -0
- package/dist/sparkle-core/sparkle-core.esm.js +1 -1
- package/package.json +1 -1
- package/dist/sparkle-core/p-4fba3e4c.js +0 -1
- package/dist/sparkle-core/p-a6788e13.js +0 -1
- package/dist/sparkle-core/p-b06e2bef.js +0 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
'use strict';
|
2
2
|
|
3
|
-
const
|
3
|
+
const auth_service = require('./auth.service-fa7cd4b6.js');
|
4
4
|
const auth_store = require('./auth.store-1e630a7d.js');
|
5
5
|
|
6
6
|
const { state, onChange, reset } = auth_store.createStore({
|
@@ -28,14 +28,14 @@ class StudentService {
|
|
28
28
|
return StudentService.instance;
|
29
29
|
}
|
30
30
|
async enrollClass(enrollInput) {
|
31
|
-
let result = await
|
31
|
+
let result = await auth_service.HttpService.http.post('api/v1/Student/EnrollClass', enrollInput);
|
32
32
|
if (result) {
|
33
33
|
userStore.state.enrollmentList = [...userStore.state.enrollmentList, result.Data];
|
34
34
|
}
|
35
35
|
return result;
|
36
36
|
}
|
37
37
|
async leaveClass(leaveInput) {
|
38
|
-
let result = await
|
38
|
+
let result = await auth_service.HttpService.http.post('api/v1/Student/LeaveClass', leaveInput);
|
39
39
|
if (result) {
|
40
40
|
userStore.state.enrollmentList = userStore.state.enrollmentList.filter(item => item.Id != result.Data);
|
41
41
|
}
|
@@ -43,7 +43,7 @@ class StudentService {
|
|
43
43
|
}
|
44
44
|
async fetchUserConfiguration() {
|
45
45
|
try {
|
46
|
-
let result = await
|
46
|
+
let result = await auth_service.HttpService.http.get('api/v1/Student/UserConfiguration');
|
47
47
|
if (result) {
|
48
48
|
userStore.state.enrollmentList = result.Data.EnrollmentList;
|
49
49
|
userStore.state.user.FirstName = result.Data.FirstName;
|
@@ -62,7 +62,7 @@ class StudentService {
|
|
62
62
|
}
|
63
63
|
async updateProfile(updateProfileInput) {
|
64
64
|
userStore.state.updateLoading = true;
|
65
|
-
let result = await
|
65
|
+
let result = await auth_service.HttpService.http.post('api/Account/update-profile', updateProfileInput);
|
66
66
|
console.log('after fetch', result);
|
67
67
|
if (result) {
|
68
68
|
userStore.state.updateLoading = false;
|
@@ -71,7 +71,7 @@ class StudentService {
|
|
71
71
|
return result;
|
72
72
|
}
|
73
73
|
async submitFeedback(feedbackInput) {
|
74
|
-
let result = await
|
74
|
+
let result = await auth_service.HttpService.http.post('api/v1/Feedback', feedbackInput);
|
75
75
|
return result;
|
76
76
|
}
|
77
77
|
}
|
@@ -2,7 +2,7 @@ import axios from 'axios';
|
|
2
2
|
import qs from 'qs';
|
3
3
|
import { toastController } from '@ionic/core';
|
4
4
|
import { TocStore } from '../stores/toc.store';
|
5
|
-
import { EnvironmentConfigService } from '.';
|
5
|
+
import { AuthService, EnvironmentConfigService } from '.';
|
6
6
|
import { TokenService } from './token.service';
|
7
7
|
export class HttpService {
|
8
8
|
constructor() { }
|
@@ -53,6 +53,9 @@ export class HttpService {
|
|
53
53
|
}
|
54
54
|
return response.data.Failed ? null : response.data;
|
55
55
|
}, async (error) => {
|
56
|
+
if (error && error.response && error.response.status == 401) {
|
57
|
+
await AuthService.getInstance().signOut();
|
58
|
+
}
|
56
59
|
if (error.response && error.response.data && error.response.data.ErrorMessage) {
|
57
60
|
// The request was made and the server responded with a status code
|
58
61
|
// that falls out of the range of 2xx
|
@@ -1,7 +1,4 @@
|
|
1
1
|
import { c as getAssetPath, h } from './index-c04b9ed5.js';
|
2
|
-
import { r as remove, g as get } from './localstorage.service-4bf408c8.js';
|
3
|
-
import { H as HttpService } from './httpService-7986aeed.js';
|
4
|
-
import { T as TokenService, A as AppConsts } from './token.service-71a5d33f.js';
|
5
2
|
import { A as AuthStore } from './auth.store-dba2c2da.js';
|
6
3
|
|
7
4
|
//import * as abpTypings from '../lib/abp';
|
@@ -120,101 +117,6 @@ async function initSetupConfig(config) {
|
|
120
117
|
await setupConfig(config);
|
121
118
|
}
|
122
119
|
|
123
|
-
class AuthService {
|
124
|
-
constructor() { }
|
125
|
-
static getInstance() {
|
126
|
-
if (!AuthService.instance) {
|
127
|
-
AuthService.instance = new AuthService();
|
128
|
-
}
|
129
|
-
return AuthService.instance;
|
130
|
-
}
|
131
|
-
async authenticate(authenticationInput) {
|
132
|
-
const headers = {
|
133
|
-
'Content-Type': 'application/json',
|
134
|
-
};
|
135
|
-
AuthStore.state.loading = true;
|
136
|
-
let result;
|
137
|
-
try {
|
138
|
-
result = await HttpService.http.post('api/Account/Authenticate', authenticationInput, {
|
139
|
-
headers: headers,
|
140
|
-
});
|
141
|
-
if (result) {
|
142
|
-
const authData = result.Data;
|
143
|
-
const authUser = {
|
144
|
-
Id: authData.Id,
|
145
|
-
UserName: authData.UserName,
|
146
|
-
Email: authData.Email,
|
147
|
-
Roles: authData.Roles,
|
148
|
-
IsVerified: authData.IsVerified,
|
149
|
-
JWToken: authData.JWToken,
|
150
|
-
IssuedOn: authData.IssuedOn,
|
151
|
-
ExpiresOn: authData.ExpiresOn,
|
152
|
-
RefreshToken: authData.RefreshToken,
|
153
|
-
PhotoUrl: '',
|
154
|
-
IsFacilitator: authData.Roles.indexOf('Facilitator') > 0,
|
155
|
-
};
|
156
|
-
//const expireDate = authenticationInput.RememberClient ? new Date(authUser.ExpiresOn) : undefined;
|
157
|
-
// let authObj: EnvironmentAuthConfig = {
|
158
|
-
// token: authUser.JWToken,
|
159
|
-
// expiryDate: expireDate,
|
160
|
-
// };
|
161
|
-
// EnvironmentConfigService.getInstance().setupAuth(authObj);
|
162
|
-
//sparkle.utils.setCookieValue(AppConsts.authorization.encrptedAuthTokenName, authUser.JWToken, expireDate, sparkle.appPath);
|
163
|
-
await TokenService.getInstance().saveAuthUser(authUser);
|
164
|
-
AuthStore.state.loading = false;
|
165
|
-
return authUser;
|
166
|
-
}
|
167
|
-
}
|
168
|
-
catch (e) {
|
169
|
-
AuthStore.state.loading = false;
|
170
|
-
return e;
|
171
|
-
}
|
172
|
-
}
|
173
|
-
async googleAuthenticate(authenticationInput) {
|
174
|
-
const headers = {
|
175
|
-
'Content-Type': 'application/json',
|
176
|
-
};
|
177
|
-
AuthStore.state.loading = true;
|
178
|
-
let result;
|
179
|
-
try {
|
180
|
-
result = await HttpService.http.post('api/Account/googleAuthenticate', authenticationInput, {
|
181
|
-
headers: headers,
|
182
|
-
});
|
183
|
-
if (result) {
|
184
|
-
const authData = result.Data;
|
185
|
-
const authUser = {
|
186
|
-
Id: authData.Id,
|
187
|
-
UserName: authData.UserName,
|
188
|
-
Email: authData.Email,
|
189
|
-
Roles: authData.Roles,
|
190
|
-
IsVerified: authData.IsVerified,
|
191
|
-
JWToken: authData.JWToken,
|
192
|
-
IssuedOn: authData.IssuedOn,
|
193
|
-
ExpiresOn: authData.ExpiresOn,
|
194
|
-
RefreshToken: authData.RefreshToken,
|
195
|
-
PhotoUrl: '',
|
196
|
-
IsFacilitator: authData.Roles.indexOf('Facilitator') > 0,
|
197
|
-
};
|
198
|
-
await TokenService.getInstance().saveAuthUser(authUser);
|
199
|
-
AuthStore.state.loading = false;
|
200
|
-
return authUser;
|
201
|
-
}
|
202
|
-
}
|
203
|
-
catch (e) {
|
204
|
-
AuthStore.state.loading = false;
|
205
|
-
return e;
|
206
|
-
}
|
207
|
-
}
|
208
|
-
async signOut() {
|
209
|
-
await remove(AppConsts.AUTH_USER_LOCALSTORAGE);
|
210
|
-
await TokenService.getInstance().removeAuthUser();
|
211
|
-
sessionStorage.clear();
|
212
|
-
}
|
213
|
-
async getLocalAuthUser() {
|
214
|
-
return get(AppConsts.AUTH_USER_LOCALSTORAGE);
|
215
|
-
}
|
216
|
-
}
|
217
|
-
|
218
120
|
function isGranted(permissionName) {
|
219
121
|
return sparkle.auth.isGranted(permissionName);
|
220
122
|
}
|
@@ -244,4 +146,4 @@ const Route = (_a) => {
|
|
244
146
|
};
|
245
147
|
const PrivateRoute = Route;
|
246
148
|
|
247
|
-
export {
|
149
|
+
export { PrivateRoute as P, initSetupConfig as i, setupConfig as s };
|
@@ -1,7 +1,8 @@
|
|
1
|
-
import {
|
1
|
+
import { r as remove, g as get } from './localstorage.service-4bf408c8.js';
|
2
|
+
import { a as axios_1, u as utils, f as formats, s as sideChannel, T as TocStore, A as AuthStore } from './auth.store-dba2c2da.js';
|
2
3
|
import { t as toastController } from './overlays-4233a39d.js';
|
3
4
|
import { E as EnvironmentConfigService } from './environment-config.service-b191f276.js';
|
4
|
-
import { T as TokenService } from './token.service-71a5d33f.js';
|
5
|
+
import { T as TokenService, A as AppConsts } from './token.service-71a5d33f.js';
|
5
6
|
|
6
7
|
var axios = axios_1;
|
7
8
|
|
@@ -633,6 +634,9 @@ class HttpService {
|
|
633
634
|
}
|
634
635
|
return response.data.Failed ? null : response.data;
|
635
636
|
}, async (error) => {
|
637
|
+
if (error && error.response && error.response.status == 401) {
|
638
|
+
await AuthService.getInstance().signOut();
|
639
|
+
}
|
636
640
|
if (error.response && error.response.data && error.response.data.ErrorMessage) {
|
637
641
|
// The request was made and the server responded with a status code
|
638
642
|
// that falls out of the range of 2xx
|
@@ -682,4 +686,99 @@ class HttpService {
|
|
682
686
|
}
|
683
687
|
}
|
684
688
|
|
685
|
-
|
689
|
+
class AuthService {
|
690
|
+
constructor() { }
|
691
|
+
static getInstance() {
|
692
|
+
if (!AuthService.instance) {
|
693
|
+
AuthService.instance = new AuthService();
|
694
|
+
}
|
695
|
+
return AuthService.instance;
|
696
|
+
}
|
697
|
+
async authenticate(authenticationInput) {
|
698
|
+
const headers = {
|
699
|
+
'Content-Type': 'application/json',
|
700
|
+
};
|
701
|
+
AuthStore.state.loading = true;
|
702
|
+
let result;
|
703
|
+
try {
|
704
|
+
result = await HttpService.http.post('api/Account/Authenticate', authenticationInput, {
|
705
|
+
headers: headers,
|
706
|
+
});
|
707
|
+
if (result) {
|
708
|
+
const authData = result.Data;
|
709
|
+
const authUser = {
|
710
|
+
Id: authData.Id,
|
711
|
+
UserName: authData.UserName,
|
712
|
+
Email: authData.Email,
|
713
|
+
Roles: authData.Roles,
|
714
|
+
IsVerified: authData.IsVerified,
|
715
|
+
JWToken: authData.JWToken,
|
716
|
+
IssuedOn: authData.IssuedOn,
|
717
|
+
ExpiresOn: authData.ExpiresOn,
|
718
|
+
RefreshToken: authData.RefreshToken,
|
719
|
+
PhotoUrl: '',
|
720
|
+
IsFacilitator: authData.Roles.indexOf('Facilitator') > 0,
|
721
|
+
};
|
722
|
+
//const expireDate = authenticationInput.RememberClient ? new Date(authUser.ExpiresOn) : undefined;
|
723
|
+
// let authObj: EnvironmentAuthConfig = {
|
724
|
+
// token: authUser.JWToken,
|
725
|
+
// expiryDate: expireDate,
|
726
|
+
// };
|
727
|
+
// EnvironmentConfigService.getInstance().setupAuth(authObj);
|
728
|
+
//sparkle.utils.setCookieValue(AppConsts.authorization.encrptedAuthTokenName, authUser.JWToken, expireDate, sparkle.appPath);
|
729
|
+
await TokenService.getInstance().saveAuthUser(authUser);
|
730
|
+
AuthStore.state.loading = false;
|
731
|
+
return authUser;
|
732
|
+
}
|
733
|
+
}
|
734
|
+
catch (e) {
|
735
|
+
AuthStore.state.loading = false;
|
736
|
+
return e;
|
737
|
+
}
|
738
|
+
}
|
739
|
+
async googleAuthenticate(authenticationInput) {
|
740
|
+
const headers = {
|
741
|
+
'Content-Type': 'application/json',
|
742
|
+
};
|
743
|
+
AuthStore.state.loading = true;
|
744
|
+
let result;
|
745
|
+
try {
|
746
|
+
result = await HttpService.http.post('api/Account/googleAuthenticate', authenticationInput, {
|
747
|
+
headers: headers,
|
748
|
+
});
|
749
|
+
if (result) {
|
750
|
+
const authData = result.Data;
|
751
|
+
const authUser = {
|
752
|
+
Id: authData.Id,
|
753
|
+
UserName: authData.UserName,
|
754
|
+
Email: authData.Email,
|
755
|
+
Roles: authData.Roles,
|
756
|
+
IsVerified: authData.IsVerified,
|
757
|
+
JWToken: authData.JWToken,
|
758
|
+
IssuedOn: authData.IssuedOn,
|
759
|
+
ExpiresOn: authData.ExpiresOn,
|
760
|
+
RefreshToken: authData.RefreshToken,
|
761
|
+
PhotoUrl: '',
|
762
|
+
IsFacilitator: authData.Roles.indexOf('Facilitator') > 0,
|
763
|
+
};
|
764
|
+
await TokenService.getInstance().saveAuthUser(authUser);
|
765
|
+
AuthStore.state.loading = false;
|
766
|
+
return authUser;
|
767
|
+
}
|
768
|
+
}
|
769
|
+
catch (e) {
|
770
|
+
AuthStore.state.loading = false;
|
771
|
+
return e;
|
772
|
+
}
|
773
|
+
}
|
774
|
+
async signOut() {
|
775
|
+
await remove(AppConsts.AUTH_USER_LOCALSTORAGE);
|
776
|
+
await TokenService.getInstance().removeAuthUser();
|
777
|
+
sessionStorage.clear();
|
778
|
+
}
|
779
|
+
async getLocalAuthUser() {
|
780
|
+
return get(AppConsts.AUTH_USER_LOCALSTORAGE);
|
781
|
+
}
|
782
|
+
}
|
783
|
+
|
784
|
+
export { AuthService as A, HttpService as H };
|
@@ -9,20 +9,20 @@ import { f as findClosestIonContent, d as disableContentScrollY, r as resetConte
|
|
9
9
|
import { i as isRTL } from './dir-03012648.js';
|
10
10
|
import { S as SPINNERS } from './spinner-configs-a37e628a.js';
|
11
11
|
import { A as ActiveRouter } from './active-router-fc9e4e06.js';
|
12
|
-
import { i as initSetupConfig,
|
12
|
+
import { i as initSetupConfig, P as PrivateRoute, s as setupConfig } from './PrivateRoute-7f03b168.js';
|
13
13
|
import { A as AssetsService } from './assets.service-def1d63c.js';
|
14
14
|
import { A as AuthStore, c as createCommonjsModule, g as getDefaultExportFromCjs, b as commonjsGlobal, T as TocStore } from './auth.store-dba2c2da.js';
|
15
|
-
import {
|
15
|
+
import { A as AuthService, H as HttpService } from './auth.service-16db0809.js';
|
16
|
+
import { u as userStore, S as StudentService } from './student.service-9b21ffa2.js';
|
16
17
|
import { E as EnvironmentConfigService } from './environment-config.service-b191f276.js';
|
17
18
|
import { s as sample, S as SparkleGlobal$1, d as date, M as MyHealthTemplate, a as MyHealthTemplateJSON, b as MyMoodTemplate, c as MyMoodTemplateJSON } from './util-458c62fb.js';
|
18
|
-
import { F as FacilitatorService, f as facilitatorStore } from './facilitator.service-
|
19
|
+
import { F as FacilitatorService, f as facilitatorStore } from './facilitator.service-dbbc8486.js';
|
19
20
|
import { m as menuController } from './index-cded2d87.js';
|
20
21
|
import { m as modalController, a as alertController, t as toastController } from './overlays-4233a39d.js';
|
21
22
|
import { S as SignalRService, s as signalRStore } from './signalR.service-c33fba50.js';
|
22
|
-
import {
|
23
|
-
import {
|
24
|
-
import {
|
25
|
-
import { M as MediaService, m as mediaStore } from './media.service-6e90bc41.js';
|
23
|
+
import { A as AppDataService, g as goalStore } from './appdata.service-f4433b21.js';
|
24
|
+
import { F as FeedService, f as feedStore } from './feed.service-c6dc6d53.js';
|
25
|
+
import { M as MediaService, m as mediaStore } from './media.service-e54a3ffd.js';
|
26
26
|
import { g as get$1 } from './localstorage.service-4bf408c8.js';
|
27
27
|
import { A as AppConsts } from './token.service-71a5d33f.js';
|
28
28
|
import './hardware-back-button-fa04d6e9.js';
|
package/dist/esm/index.js
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
export {
|
1
|
+
export { P as PrivateRoute, i as initSetupEnvironmentConfig, s as setupEnvironmentConfig } from './PrivateRoute-7f03b168.js';
|
2
2
|
export { E as EnvironmentConfigService } from './environment-config.service-b191f276.js';
|
3
3
|
export { A as AssetsService } from './assets.service-def1d63c.js';
|
4
|
+
export { A as AuthService } from './auth.service-16db0809.js';
|
4
5
|
export { A as AuthStore } from './auth.store-dba2c2da.js';
|
5
6
|
import './index-c04b9ed5.js';
|
6
7
|
import './localstorage.service-4bf408c8.js';
|
7
|
-
import './httpService-7986aeed.js';
|
8
8
|
import './overlays-4233a39d.js';
|
9
9
|
import './ionic-global-4903e23e.js';
|
10
10
|
import './hardware-back-button-fa04d6e9.js';
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { r as registerInstance, i as createEvent, h, H as Host, e as getElement } from './index-c04b9ed5.js';
|
2
|
-
import { A as AssignmentService } from './assignment.service-
|
2
|
+
import { A as AssignmentService } from './assignment.service-5d1d98f6.js';
|
3
3
|
import { T as TokenService } from './token.service-71a5d33f.js';
|
4
|
-
import './
|
4
|
+
import './auth.service-16db0809.js';
|
5
|
+
import './localstorage.service-4bf408c8.js';
|
5
6
|
import './auth.store-dba2c2da.js';
|
6
7
|
import './overlays-4233a39d.js';
|
7
8
|
import './ionic-global-4903e23e.js';
|
8
9
|
import './hardware-back-button-fa04d6e9.js';
|
9
10
|
import './helpers-bf0e23d6.js';
|
10
11
|
import './environment-config.service-b191f276.js';
|
11
|
-
import './localstorage.service-4bf408c8.js';
|
12
12
|
|
13
13
|
const sparkleAssignmentCss = ":host{display:block}.assignment-footer-container{display:flex;justify-content:flex-end}.assignment-footer{display:flex;justify-content:space-between;align-items:center}.error{color:red;margin-right:10px}.success{color:green;margin-right:10px}.uploaded-image{display:block;max-height:140px;width:auto !important}";
|
14
14
|
|
@@ -1,14 +1,14 @@
|
|
1
1
|
import { h, r as registerInstance, H as Host, e as getElement } from './index-c04b9ed5.js';
|
2
2
|
import { t as toastController } from './overlays-4233a39d.js';
|
3
|
-
import { F as FacilitatorService, f as facilitatorStore } from './facilitator.service-
|
3
|
+
import { F as FacilitatorService, f as facilitatorStore } from './facilitator.service-dbbc8486.js';
|
4
4
|
import './ionic-global-4903e23e.js';
|
5
5
|
import './hardware-back-button-fa04d6e9.js';
|
6
6
|
import './helpers-bf0e23d6.js';
|
7
|
-
import './
|
7
|
+
import './auth.service-16db0809.js';
|
8
|
+
import './localstorage.service-4bf408c8.js';
|
8
9
|
import './auth.store-dba2c2da.js';
|
9
10
|
import './environment-config.service-b191f276.js';
|
10
11
|
import './token.service-71a5d33f.js';
|
11
|
-
import './localstorage.service-4bf408c8.js';
|
12
12
|
|
13
13
|
const LoadingSpinner = () => (h("div", { class: "spinner-border", role: "status" }));
|
14
14
|
|
@@ -1,17 +1,17 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, e as getElement } from './index-c04b9ed5.js';
|
2
|
-
import { A as AssignmentService } from './assignment.service-
|
3
|
-
import { F as FeedService } from './feed.service-
|
4
|
-
import { M as MediaService } from './media.service-
|
2
|
+
import { A as AssignmentService } from './assignment.service-5d1d98f6.js';
|
3
|
+
import { F as FeedService } from './feed.service-c6dc6d53.js';
|
4
|
+
import { M as MediaService } from './media.service-e54a3ffd.js';
|
5
5
|
import { T as TokenService } from './token.service-71a5d33f.js';
|
6
6
|
import { S as SparkleGlobal } from './util-458c62fb.js';
|
7
|
-
import './
|
7
|
+
import './auth.service-16db0809.js';
|
8
|
+
import './localstorage.service-4bf408c8.js';
|
8
9
|
import './auth.store-dba2c2da.js';
|
9
10
|
import './overlays-4233a39d.js';
|
10
11
|
import './ionic-global-4903e23e.js';
|
11
12
|
import './hardware-back-button-fa04d6e9.js';
|
12
13
|
import './helpers-bf0e23d6.js';
|
13
14
|
import './environment-config.service-b191f276.js';
|
14
|
-
import './localstorage.service-4bf408c8.js';
|
15
15
|
|
16
16
|
const sparkleFeedPostCss = ":host{display:block}.post-footer-container{display:flex;justify-content:flex-end}.post-footer{display:flex;justify-content:space-between;align-items:center}.error{color:red;margin-right:10px}.success{color:green;margin-right:10px}.uploaded-image{display:block;max-height:140px;width:auto !important}.public-post-toggle{display:flex;justify-content:flex-end;align-items:center}.assignment-name{display:none}";
|
17
17
|
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import { r as registerInstance, h, H as Host, e as getElement } from './index-c04b9ed5.js';
|
2
|
-
import { S as StudentService } from './student.service-
|
2
|
+
import { S as StudentService } from './student.service-9b21ffa2.js';
|
3
3
|
import { t as toastController } from './overlays-4233a39d.js';
|
4
|
-
import './
|
4
|
+
import './auth.service-16db0809.js';
|
5
|
+
import './localstorage.service-4bf408c8.js';
|
5
6
|
import './auth.store-dba2c2da.js';
|
6
7
|
import './environment-config.service-b191f276.js';
|
7
8
|
import './token.service-71a5d33f.js';
|
8
|
-
import './localstorage.service-4bf408c8.js';
|
9
9
|
import './ionic-global-4903e23e.js';
|
10
10
|
import './hardware-back-button-fa04d6e9.js';
|
11
11
|
import './helpers-bf0e23d6.js';
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { r as registerInstance, i as createEvent, h, H as Host, e as getElement } from './index-c04b9ed5.js';
|
2
|
-
import { M as MediaService } from './media.service-
|
3
|
-
import './
|
2
|
+
import { M as MediaService } from './media.service-e54a3ffd.js';
|
3
|
+
import './auth.service-16db0809.js';
|
4
|
+
import './localstorage.service-4bf408c8.js';
|
4
5
|
import './auth.store-dba2c2da.js';
|
5
6
|
import './overlays-4233a39d.js';
|
6
7
|
import './ionic-global-4903e23e.js';
|
@@ -8,7 +9,6 @@ import './hardware-back-button-fa04d6e9.js';
|
|
8
9
|
import './helpers-bf0e23d6.js';
|
9
10
|
import './environment-config.service-b191f276.js';
|
10
11
|
import './token.service-71a5d33f.js';
|
11
|
-
import './localstorage.service-4bf408c8.js';
|
12
12
|
|
13
13
|
const sparkleFileUploadCss = "";
|
14
14
|
|
@@ -2,16 +2,16 @@ import { r as registerInstance, h, e as getElement } from './index-c04b9ed5.js';
|
|
2
2
|
import { S as SparkleGlobal, G as GetGoalAppData, e as MyGoalTemplate, f as MyGoalTemplateJSON } from './util-458c62fb.js';
|
3
3
|
import { E as EnvironmentConfigService } from './environment-config.service-b191f276.js';
|
4
4
|
import { A as AssetsService } from './assets.service-def1d63c.js';
|
5
|
-
import { A as AppDataService, g as goalStore } from './appdata.service-
|
6
|
-
import { F as FeedService, f as feedStore } from './feed.service-
|
7
|
-
import './
|
5
|
+
import { A as AppDataService, g as goalStore } from './appdata.service-f4433b21.js';
|
6
|
+
import { F as FeedService, f as feedStore } from './feed.service-c6dc6d53.js';
|
7
|
+
import './auth.service-16db0809.js';
|
8
|
+
import './localstorage.service-4bf408c8.js';
|
8
9
|
import './auth.store-dba2c2da.js';
|
9
10
|
import './overlays-4233a39d.js';
|
10
11
|
import './ionic-global-4903e23e.js';
|
11
12
|
import './hardware-back-button-fa04d6e9.js';
|
12
13
|
import './helpers-bf0e23d6.js';
|
13
14
|
import './token.service-71a5d33f.js';
|
14
|
-
import './localstorage.service-4bf408c8.js';
|
15
15
|
|
16
16
|
const sparkleGoalFormCss = ":host{display:block}";
|
17
17
|
|
@@ -1 +1 @@
|
|
1
|
-
export{
|
1
|
+
export{P as PrivateRoute,i as initSetupEnvironmentConfig,s as setupEnvironmentConfig}from"./p-fb39c577.js";export{E as EnvironmentConfigService}from"./p-bd90903e.js";export{A as AssetsService}from"./p-408176ba.js";export{A as AuthService}from"./p-83c39dfc.js";export{A as AuthStore}from"./p-2f569553.js";import"./p-ee1e0eb4.js";import"./p-5d409601.js";import"./p-ff7a8a71.js";import"./p-871106e0.js";import"./p-add30d46.js";import"./p-d68092b7.js";import"./p-7dae0f0e.js";
|
@@ -1 +1 @@
|
|
1
|
-
import{h as t,r as s,H as e,e as i}from"./p-ee1e0eb4.js";import{t as a}from"./p-ff7a8a71.js";import{F as o,f as l}from"./p-
|
1
|
+
import{h as t,r as s,H as e,e as i}from"./p-ee1e0eb4.js";import{t as a}from"./p-ff7a8a71.js";import{F as o,f as l}from"./p-c0c79958.js";import"./p-871106e0.js";import"./p-add30d46.js";import"./p-d68092b7.js";import"./p-83c39dfc.js";import"./p-5d409601.js";import"./p-2f569553.js";import"./p-bd90903e.js";import"./p-7dae0f0e.js";const r=()=>t("div",{class:"spinner-border",role:"status"}),n=class{constructor(t){s(this,t),this.formControls={noteText:{isValid:!0,value:"",errorMessage:"",validate:t=>(console.log(t),t&&t.length>0?{valid:!0,errorMessage:""}:{valid:!1,errorMessage:"Notes is required"})}},this.submitted=!1}componentDidLoad(){this.initialValues&&this.changeFormValue("noteText",this.initialValues.NoteText)}async onSubmit(t){t.preventDefault(),this.submitted=!0;let s=!0;for(let t in this.formControls){let e=this.formControls[t];e.isValid=e.validate(e.value).valid,e.errorMessage=e.validate(e.value).errorMessage,e.isValid||(s=!1)}if(s)if(this.initialValues&&this.initialValues.Id>0){let t=await o.getInstance().updateFacilitatorNote({NoteText:this.formControls.noteText.value,Id:this.initialValues.Id});t.Succeeded?((await a.create({message:"Notes updated successfully",duration:3e3})).present(),this.dismiss()):(await a.create({message:t.Message,duration:3e3})).present()}else{let t=await o.getInstance().addFacilitatorNote({NoteText:this.formControls.noteText.value});t.Succeeded?((await a.create({message:"Notes added successfully",duration:3e3})).present(),this.dismiss()):(await a.create({message:t.Message,duration:3e3})).present()}}dismiss(t){this.el.closest("ion-modal").dismiss({dismissed:!0})}changeFormValue(t,s){this.formControls=Object.assign(Object.assign({},this.formControls),{[t]:Object.assign(Object.assign({},this.formControls[t]),{value:s,isValid:this.formControls[t].validate(s).valid,errorMessage:this.formControls[t].validate(s).errorMessage})})}render(){const s=this.formControls.noteText.isValid?"is-valid":"is-invalid";return t(e,null,t("ion-header",{translucent:!0},t("ion-toolbar",null,t("ion-title",null,"Facilitator Note"),t("ion-buttons",{slot:"end"},t("ion-button",{onClick:()=>this.dismiss()},"Close")))),t("ion-content",{class:"ion-padding"},t("form",{onSubmit:t=>this.onSubmit(t),novalidate:!0},t("div",{class:"mb-3"},t("label",{htmlFor:"validationTextarea",class:"form-label"},"Notes"),t("textarea",{class:`form-control ${this.submitted&&s}`,placeholder:"Notes",value:this.formControls.noteText.value,onChange:t=>this.changeFormValue("noteText",t.target.value)}),this.formControls.noteText.errorMessage&&t("div",{class:"invalid-feedback"},this.formControls.noteText.errorMessage)),t("div",{class:"mb-3"},l.state.notesLoading&&t(r,null),t("button",{class:"btn btn-primary",type:"submit",disabled:l.state.notesLoading},"Submit")))))}get el(){return i(this)}};n.style=":host{display:block}";export{n as sparkle_facilitator_notes_form}
|
@@ -0,0 +1 @@
|
|
1
|
+
import{H as t}from"./p-83c39dfc.js";class s{constructor(){}static getInstance(){return s.instance||(s.instance=new s),s.instance}async createAssignment(s){return await t.http.post("api/v1/Assignment/Create",s)}}export{s as A}
|