Skip to content

Commit

Permalink
Merge branch 'editorRole' of https://github.com/stuartf/3akai-ux into…
Browse files Browse the repository at this point in the history
… editorRole
  • Loading branch information
Nicolaas Matthijs committed Apr 24, 2015
2 parents fba5a3f + 5fe7f2b commit 79f32f6
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 23 deletions.
2 changes: 1 addition & 1 deletion node_modules/oae-core/aboutcontent/tests/aboutcontent.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions node_modules/oae-core/createcollabdoc/js/createcollabdoc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/oae-core/etherpad/js/etherpad.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/oae-core/filepreview/tests/filepreview.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/oae-core/manageaccess/js/manageaccess.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions node_modules/oae-core/manageaccess/manageaccess.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion node_modules/oae-core/revisions/tests/revisions.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion shared/oae/api/oae.api.content.js
Expand Up @@ -237,14 +237,15 @@ define(['exports', 'jquery', 'underscore', 'oae.api.i18n', 'mimetypes'], functio
* @param {String} [description] The collaborative document's description
* @param {String} [visibility] The collaborative document's visibility. This can be public, loggedin or private
* @param {String[]} [managers] Array of user/group ids that should be added as managers to the collaborative document
* @param {String[]} [editors] Array of user/group ids that should be added as editors to the collaborative document
* @param {String[]} [viewers] Array of user/group ids that should be added as viewers to the collaborative document
* @param {String[]} [folders] Array of folder ids to which the collaborative document should be added
* @param {Function} [callback] Standard callback function
* @param {Object} [callback.err] Error object containing error code and error message
* @param {Content} [callback.content] Content object representing the created collaborative document
* @throws {Error} Error thrown when not all of the required parameters have been provided
*/
var createCollabDoc = exports.createCollabDoc = function(displayName, description, visibility, managers, viewers, folders, callback) {
var createCollabDoc = exports.createCollabDoc = function(displayName, description, visibility, managers, editors, viewers, folders, callback) {
if (!displayName) {
throw new Error('A valid document name should be provided');
}
Expand All @@ -258,6 +259,7 @@ define(['exports', 'jquery', 'underscore', 'oae.api.i18n', 'mimetypes'], functio
'description': description,
'visibility': visibility,
'managers': managers,
'editors': editors,
'viewers': viewers,
'folders': folders
};
Expand Down
1 change: 1 addition & 0 deletions shared/oae/bundles/ui/default.properties
Expand Up @@ -211,6 +211,7 @@ AUTHORING_EXPERIENCE = Authoring Experiences
A_POWERFULL_NEW_WAY_FOR_STUDENTS_AND_FACULTY_TO_CREATE_KNOWLEDGE_COLLABORATE_AND_CONNECT_WITH_THE_WORLD = A powerful new way for students and faculty to create knowledge, collaborate and connect with the world
BROWSE = Browse
CANCEL = Cancel
CAN_EDIT = Can edit
CAN_MANAGE = Can manage
CAN_VIEW = Can view
CAUTION_THIS_ACTION_CANNOT_BE_UNDONE = <strong>Caution:</strong> this action cannot be undone!
Expand Down
2 changes: 1 addition & 1 deletion shared/oae/macros/tests/metadata.js
Expand Up @@ -74,7 +74,7 @@ casper.test.begin('Macro - List Metadata', function(test) {
// Create a link
contentUtil.createLink(null, null, null, 'http://www.oaeproject.org', null, null, null, function(err, linkProfile) {
// Create a collaborative document
contentUtil.createCollabDoc(null, null, null, null, null, null, function(err, collabdocProfile) {
contentUtil.createCollabDoc(null, null, null, null, null, null, null, function(err, collabdocProfile) {
// Create a discussion
discussionUtil.createDiscussion(null, null, null, null, null, function(err, discussionProfile) {
// Create a group
Expand Down
6 changes: 4 additions & 2 deletions tests/casperjs/util/include/content.js
Expand Up @@ -222,24 +222,26 @@ var contentUtil = (function() {
* @param {String} [description] The collabdoc's description
* @param {String} [visibility] The collabdoc's visibility. This can be public, loggedin or private
* @param {String[]} [managers] Array of user/group ids that should be added as managers to the collabdoc
* @param {String[]} [editors] Array of user/group ids that should be added as editors to the collabdoc
* @param {String[]} [viewers] Array of user/group ids that should be added as viewers to the collabdoc
* @param {String[]} [folders] Array of folder ids to which the collaborative document should be added
* @param {Function} callback Standard callback method
* @param {Object} [callback.err] Error object containing error code and error message
* @param {Content} [callback.content] Content object representing the created collabdoc
*/
var createCollabDoc = function(displayName, description, visibility, managers, viewers, folders, callback) {
var createCollabDoc = function(displayName, description, visibility, managers, editors, viewers, folders, callback) {
casper.then(function() {
var collabdocProfile = null;
var err = null;
displayName = displayName || 'Collabdoc ' + mainUtil.generateRandomString();
description = description || '';
visibility = visibility || 'public';
managers = managers || [];
editors = editors || [];
viewers = viewers || [];
folders = folders || [];

mainUtil.callInternalAPI('content', 'createCollabDoc', [displayName, description, visibility, managers, viewers, folders], function(_err, _collabdocProfile) {
mainUtil.callInternalAPI('content', 'createCollabDoc', [displayName, description, visibility, managers, editors, viewers, folders], function(_err, _collabdocProfile) {
if (_err) {
casper.echo('Could not create ' + displayName + '. Error ' + _err.code + ': ' + _err.msg, 'ERROR');
err = _err;
Expand Down
18 changes: 12 additions & 6 deletions ui/js/content.js
Expand Up @@ -290,20 +290,26 @@ require(['jquery', 'underscore', 'oae.core'], function($, _, oae) {
* @see manageaccess#initManageAccess
*/
var getManageAccessData = function() {
return {
var widgetData = {
'contextProfile': contentProfile,
'messages': getManageAccessMessages(),
'defaultRole': contentProfile.resourceSubType === 'collabdoc' ? 'manager' : 'viewer',
'roles': {
'viewer': oae.api.i18n.translate('__MSG__CAN_VIEW__'),
'manager': oae.api.i18n.translate('__MSG__CAN_MANAGE__')
},
'defaultRole': 'viewer',
'roles': [
{'id': 'viewer', 'name': oae.api.i18n.translate('__MSG__CAN_VIEW__')},
{'id': 'manager', 'name': oae.api.i18n.translate('__MSG__CAN_MANAGE__')}
],
'api': {
'getMembersURL': '/api/content/'+ contentProfile.id + '/members',
'setMembers': oae.api.content.updateMembers,
'setVisibility': oae.api.content.updateContent
}
};
// Collabdocs have a special editor role
if (contentProfile.resourceSubType === 'collabdoc') {
widgetData.roles.splice(1, 0, {'id': 'editor', 'name': oae.api.i18n.translate('__MSG__CAN_EDIT__')});
widgetData.defaultRole = 'manager';
}
return widgetData;
};

/**
Expand Down
2 changes: 1 addition & 1 deletion ui/tests/content.js
Expand Up @@ -167,7 +167,7 @@ casper.test.begin('Page - Content', function(test) {

contentUtil.createFile(null, null, null, null, null, [user2.id], function(err, contentProfile) {
contentUtil.createLink(null, null, null, null, null, [user2.id], null, function(err, linkProfile) {
contentUtil.createCollabDoc(null, null, null, null, [user2.id], null, function(err, collabdocProfile) {
contentUtil.createCollabDoc(null, null, null, null, [user2.id], null, null, function(err, collabdocProfile) {
///////////
// FILES //
///////////
Expand Down

0 comments on commit 79f32f6

Please sign in to comment.