-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into SWIK-906-robots.txt
- Loading branch information
Showing
35 changed files
with
1,453 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import UserProfileStore from '../../stores/UserProfileStore'; | ||
import {shortTitle} from '../../configs/general'; | ||
import striptags from 'striptags'; | ||
import TreeUtil from '../../components/Deck/TreePanel/util/TreeUtil'; | ||
const log = require('../log/clog'); | ||
import addActivity from '../activityfeed/addActivity'; | ||
import {navigateAction} from 'fluxible-router'; | ||
import Util from '../../components/common/Util'; | ||
|
||
export default function addLTI(context, payload, done) { | ||
//log.info(context); | ||
//console.log('actions/slide/addLTI.js'); | ||
//enrich with user id | ||
let userid = context.getStore(UserProfileStore).userid; | ||
if (userid != null && userid !== '') { | ||
|
||
context.service.create('lticonsumer', payload, {timeout: 20 * 1000}, (err, res) => { | ||
//console.log('addLTI.js'); | ||
//console.log('res='+res); | ||
if (err) { | ||
console.log(err); | ||
//console.log('ADD_LTI_FAILURE'); | ||
context.dispatch('ADD_LTI_FAILURE', err); | ||
} else { | ||
context.dispatch('ADD_LTI_SUCCESS', res); | ||
} | ||
done(); | ||
}); | ||
|
||
} //end if (userid != null && userid !== '') | ||
else | ||
done(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import UserProfileStore from '../../../stores/UserProfileStore'; | ||
import {navigateAction} from 'fluxible-router'; | ||
|
||
export default function cancelUserlti(context, payload, done) { | ||
|
||
context.dispatch('CANCEL_USERLTI_SUCCESS'); | ||
context.executeAction(navigateAction, { | ||
url: '/user/' + context.getStore(UserProfileStore).username + '/ltis/overview' | ||
}); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import UserProfileStore from '../../../stores/UserProfileStore'; | ||
|
||
export default function deleteUserlti(context, payload, done) { | ||
context.dispatch('UPDATE_USERLTIS_STATUS', null); | ||
payload.jwt = context.getStore(UserProfileStore).jwt; | ||
context.service.update('userProfile.deleteUserlti', payload, { timeout: 20 * 1000 }, (err, res) => { | ||
if (err) { | ||
context.dispatch('DELETE_USERLTI_FAILED', err); | ||
} else { | ||
context.dispatch('DELETE_USERLTI_SUCCESS', payload.ltiid); | ||
} | ||
done(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import UserProfileStore from '../../../stores/UserProfileStore'; | ||
|
||
export default function leaveUserlti(context, payload, done) { | ||
context.dispatch('UPDATE_USERLTIS_STATUS', null); | ||
payload.jwt = context.getStore(UserProfileStore).jwt; | ||
context.service.update('userProfile.leaveUserlti', payload, { timeout: 20 * 1000 }, (err, res) => { | ||
if (err) { | ||
context.dispatch('LEAVE_USERLTI_FAILED', err); | ||
} else { | ||
context.dispatch('LEAVE_USERLTI_SUCCESS', payload.ltiid); | ||
} | ||
done(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import UserProfileStore from '../../../stores/UserProfileStore'; | ||
import {navigateAction} from 'fluxible-router'; | ||
|
||
export default function saveUserlti(context, payload, done) { | ||
context.dispatch('SAVE_USERLTI_START', {}); | ||
payload.jwt = context.getStore(UserProfileStore).jwt; | ||
context.service.update('userProfile.saveUserlti', payload, {timeout: 60 * 1000}, { timeout: 60 * 1000 }, (err, res) => { | ||
if (err) { | ||
context.dispatch('SAVE_USERLTI_FAILED', err); | ||
} else { | ||
context.dispatch('SAVE_USERLTI_SUCCESS', res); | ||
context.executeAction(navigateAction, { | ||
url: '/user/' + context.getStore(UserProfileStore).username + '/ltis/overview' | ||
}); | ||
} | ||
done(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
const log = require('../../log/clog'); | ||
import { shortTitle } from '../../../configs/general'; | ||
|
||
export default function updateUserlti(context, payload, done) { | ||
log.info(context); | ||
|
||
if (payload.offline) { | ||
context.dispatch('UPDATE_USERLTI', payload.lti); | ||
context.dispatch('UPDATE_PAGE_TITLE', {pageTitle: shortTitle + ' | Edit LTI ' + payload.lti.name}); | ||
return done(); | ||
} | ||
|
||
let payload2 = { | ||
ltiid: payload.lti._id | ||
}; | ||
|
||
context.service.read('userlti.read', payload2, { timeout: 20 * 1000 }, (err, res) => { | ||
if (err) { | ||
context.dispatch('UPDATE_USERLTI', payload.lti); | ||
} | ||
else { | ||
context.dispatch('UPDATE_USERLTI', res[0]); | ||
context.dispatch('UPDATE_PAGE_TITLE', {pageTitle: shortTitle + ' | Edit LTI ' + res[0].name}); | ||
} | ||
done(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.