mirror of
https://github.com/documize/community.git
synced 2025-07-24 23:59:47 +02:00
ember.js upgrade 2.12, jshint replaced with eslint
This commit is contained in:
parent
945fadaf00
commit
b2620e80e1
34 changed files with 131 additions and 217 deletions
36
app/.eslintrc.js
Normal file
36
app/.eslintrc.js
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
module.exports = {
|
||||||
|
root: true,
|
||||||
|
parserOptions: {
|
||||||
|
ecmaVersion: 6,
|
||||||
|
sourceType: 'module'
|
||||||
|
},
|
||||||
|
extends: 'eslint:recommended',
|
||||||
|
env: {
|
||||||
|
browser: true,
|
||||||
|
jquery: true,
|
||||||
|
qunit: true,
|
||||||
|
embertest: true
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
},
|
||||||
|
globals: {
|
||||||
|
"$": true,
|
||||||
|
"is": true,
|
||||||
|
"_": true,
|
||||||
|
"tinymce": true,
|
||||||
|
"CodeMirror": true,
|
||||||
|
"Drop": true,
|
||||||
|
"Mousetrap": true,
|
||||||
|
"Sortable": true,
|
||||||
|
"moment": true,
|
||||||
|
"Dropzone": true,
|
||||||
|
"Tooltip": true,
|
||||||
|
"server": true,
|
||||||
|
"authenticateUser": true,
|
||||||
|
"stubAudit": true,
|
||||||
|
"stubUserNotification": true,
|
||||||
|
"userLogin": true,
|
||||||
|
"Keycloak": true,
|
||||||
|
"Intercom": true,
|
||||||
|
}
|
||||||
|
};
|
5
app/.gitignore
vendored
5
app/.gitignore
vendored
|
@ -1,7 +1,8 @@
|
||||||
# See http://help.github.com/ignore-files/ for more about ignoring files.
|
# See https://help.github.com/ignore-files/ for more about ignoring files.
|
||||||
|
|
||||||
# compiled output
|
# compiled output
|
||||||
/dist
|
/dist
|
||||||
|
/dist-prod
|
||||||
/tmp
|
/tmp
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
|
@ -13,5 +14,5 @@
|
||||||
/connect.lock
|
/connect.lock
|
||||||
/coverage/*
|
/coverage/*
|
||||||
/libpeerconnection.log
|
/libpeerconnection.log
|
||||||
npm-debug.log
|
npm-debug.log*
|
||||||
testem.log
|
testem.log
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
{
|
|
||||||
"predef": [
|
|
||||||
"server",
|
|
||||||
"document",
|
|
||||||
"window",
|
|
||||||
"-Promise",
|
|
||||||
"moment",
|
|
||||||
"$",
|
|
||||||
"jQuery",
|
|
||||||
"_",
|
|
||||||
"is",
|
|
||||||
"Mousetrap",
|
|
||||||
"CodeMirror",
|
|
||||||
"Intercom",
|
|
||||||
"Materialize",
|
|
||||||
"tinymce",
|
|
||||||
"Tether",
|
|
||||||
"Tooltip",
|
|
||||||
"Drop",
|
|
||||||
"Dropzone",
|
|
||||||
"Sortable",
|
|
||||||
"datetimepicker",
|
|
||||||
"Waypoint",
|
|
||||||
"velocity",
|
|
||||||
"Keycloak"
|
|
||||||
],
|
|
||||||
"browser": true,
|
|
||||||
"boss": true,
|
|
||||||
"curly": true,
|
|
||||||
"debug": false,
|
|
||||||
"devel": true,
|
|
||||||
"eqeqeq": true,
|
|
||||||
"evil": true,
|
|
||||||
"forin": false,
|
|
||||||
"immed": false,
|
|
||||||
"laxbreak": false,
|
|
||||||
"newcap": true,
|
|
||||||
"noarg": true,
|
|
||||||
"noempty": false,
|
|
||||||
"nonew": false,
|
|
||||||
"nomen": false,
|
|
||||||
"onevar": false,
|
|
||||||
"plusplus": false,
|
|
||||||
"regexp": false,
|
|
||||||
"undef": true,
|
|
||||||
"sub": true,
|
|
||||||
"strict": false,
|
|
||||||
"white": false,
|
|
||||||
"eqnull": true,
|
|
||||||
"esnext": true,
|
|
||||||
"unused": true
|
|
||||||
}
|
|
|
@ -1,21 +1,22 @@
|
||||||
---
|
---
|
||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "0.12"
|
- "6"
|
||||||
|
|
||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- node_modules
|
- $HOME/.npm
|
||||||
|
- $HOME/.cache # includes bowers cache
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
|
- npm config set spin false
|
||||||
- "npm config set spin false"
|
- npm install -g bower phantomjs-prebuilt
|
||||||
- "npm install -g npm@^2"
|
- bower --version
|
||||||
|
- phantomjs --version
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- npm install -g bower
|
|
||||||
- npm install
|
- npm install
|
||||||
- bower install
|
- bower install
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,9 @@ export default Ember.Component.extend({
|
||||||
|
|
||||||
switch (provider) {
|
switch (provider) {
|
||||||
case constants.AuthProvider.Documize:
|
case constants.AuthProvider.Documize:
|
||||||
|
// nothing to do
|
||||||
break;
|
break;
|
||||||
case constants.AuthProvider.Keycloak:
|
case constants.AuthProvider.Keycloak: // eslint-disable-line no-case-declarations
|
||||||
let config = this.get('authConfig');
|
let config = this.get('authConfig');
|
||||||
|
|
||||||
if (is.undefined(config) || is.null(config) || is.empty(config) ) {
|
if (is.undefined(config) || is.null(config) || is.empty(config) ) {
|
||||||
|
|
|
@ -34,7 +34,7 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, {
|
||||||
|
|
||||||
this.loadBlocks();
|
this.loadBlocks();
|
||||||
|
|
||||||
Ember.run.schedule('afterRender', () => {
|
Ember.run.schedule('afterRender', () => {
|
||||||
let jumpTo = "#page-" + this.get('pageId');
|
let jumpTo = "#page-" + this.get('pageId');
|
||||||
if (!$(jumpTo).inView()) {
|
if (!$(jumpTo).inView()) {
|
||||||
$(jumpTo).velocity("scroll", { duration: 250, offset: -100 });
|
$(jumpTo).velocity("scroll", { duration: 250, offset: -100 });
|
||||||
|
|
|
@ -15,8 +15,8 @@ export default Ember.Component.extend({
|
||||||
selectedDocuments: [],
|
selectedDocuments: [],
|
||||||
|
|
||||||
emptyState: Ember.computed('documents', function() {
|
emptyState: Ember.computed('documents', function() {
|
||||||
return this.get('documents.length') === 0;
|
return this.get('documents.length') === 0;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
didReceiveAttrs() {
|
didReceiveAttrs() {
|
||||||
this.set('selectedDocuments', []);
|
this.set('selectedDocuments', []);
|
||||||
|
|
|
@ -103,7 +103,7 @@ export default Ember.Component.extend({
|
||||||
message = this.getDefaultInvitationMessage();
|
message = this.getDefaultInvitationMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.get('permissions').forEach((permission, index) => { /* jshint ignore:line */
|
this.get('permissions').forEach((permission, index) => { // eslint-disable-line no-unused-vars
|
||||||
Ember.set(permission, 'canView', $("#canView-" + permission.userId).prop('checked'));
|
Ember.set(permission, 'canView', $("#canView-" + permission.userId).prop('checked'));
|
||||||
Ember.set(permission, 'canEdit', $("#canEdit-" + permission.userId).prop('checked'));
|
Ember.set(permission, 'canEdit', $("#canEdit-" + permission.userId).prop('checked'));
|
||||||
});
|
});
|
||||||
|
|
|
@ -64,7 +64,7 @@ export default Ember.Component.extend(NotifierMixin, {
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on("error", function (x) {
|
this.on("error", function (x) {
|
||||||
console.log("Conversion failed for ", x.name, " obj ", x); // TODO proper error handling
|
console.log("Conversion failed for ", x.name, " obj ", x); // eslint-disable-line no-console
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on("queuecomplete", function () {});
|
this.on("queuecomplete", function () {});
|
||||||
|
|
|
@ -77,7 +77,7 @@ export default Ember.Component.extend(TooltipMixin, {
|
||||||
self.get('pinned').updateSequence(this.toArray()).then((pins) => {
|
self.get('pinned').updateSequence(this.toArray()).then((pins) => {
|
||||||
self.set('pins', pins);
|
self.set('pins', pins);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.set('sortable', sortable);
|
this.set('sortable', sortable);
|
||||||
|
|
|
@ -28,7 +28,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
|
|
||||||
try {
|
try {
|
||||||
config = JSON.parse(this.get('meta.config'));
|
config = JSON.parse(this.get('meta.config'));
|
||||||
} catch (e) {}
|
} catch (e) {} // eslint-disable-line no-empty
|
||||||
|
|
||||||
if (is.empty(config)) {
|
if (is.empty(config)) {
|
||||||
config = {
|
config = {
|
||||||
|
@ -57,8 +57,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
if (response.apikey.length > 0 && response.url.length > 0 && response.username.length > 0) {
|
if (response.apikey.length > 0 && response.url.length > 0 && response.username.length > 0) {
|
||||||
self.send('auth');
|
self.send('auth');
|
||||||
}
|
}
|
||||||
}, function (reason) { //jshint ignore: line
|
}, function (reason) { // eslint-disable-line no-unused-vars
|
||||||
console.log(reason);
|
|
||||||
self.set('waiting', false);
|
self.set('waiting', false);
|
||||||
if (self.get('config.userId') > 0) {
|
if (self.get('config.userId') > 0) {
|
||||||
self.send('auth');
|
self.send('auth');
|
||||||
|
@ -96,7 +95,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
self.set('waiting', false);
|
self.set('waiting', false);
|
||||||
}, function (reason) { //jshint ignore: line
|
}, function (reason) { // eslint-disable-line no-unused-vars
|
||||||
self.set('workspaces', []);
|
self.set('workspaces', []);
|
||||||
self.set('waiting', false);
|
self.set('waiting', false);
|
||||||
});
|
});
|
||||||
|
@ -116,7 +115,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
self.set('items', response);
|
self.set('items', response);
|
||||||
self.set('config.itemCount', response.length);
|
self.set('config.itemCount', response.length);
|
||||||
self.set('waiting', false);
|
self.set('waiting', false);
|
||||||
}, function (reason) { //jshint ignore: line
|
}, function (reason) { // eslint-disable-line no-unused-vars
|
||||||
if (self.get('isDestroyed') || self.get('isDestroying')) {
|
if (self.get('isDestroyed') || self.get('isDestroying')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -187,7 +186,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
self.set('config.userId', response.BaseEntity.id);
|
self.set('config.userId', response.BaseEntity.id);
|
||||||
self.set('waiting', false);
|
self.set('waiting', false);
|
||||||
self.getWorkspaces();
|
self.getWorkspaces();
|
||||||
}, function (reason) { //jshint ignore: line
|
}, function (reason) { // eslint-disable-line no-unused-vars
|
||||||
self.set('authenticated', false);
|
self.set('authenticated', false);
|
||||||
self.set('user', null);
|
self.set('user', null);
|
||||||
self.set('config.userId', 0);
|
self.set('config.userId', 0);
|
||||||
|
|
|
@ -56,7 +56,8 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
config.showMilestones = metaConfig.showMilestones;
|
config.showMilestones = metaConfig.showMilestones;
|
||||||
config.showIssues = metaConfig.showIssues;
|
config.showIssues = metaConfig.showIssues;
|
||||||
config.showCommits = metaConfig.showCommits;
|
config.showCommits = metaConfig.showCommits;
|
||||||
} catch (e) {}
|
} catch (e) { // eslint-disable-line no-empty
|
||||||
|
}
|
||||||
|
|
||||||
if (_.isUndefined(config.showCommits)) {
|
if (_.isUndefined(config.showCommits)) {
|
||||||
config.showCommits = true;
|
config.showCommits = true;
|
||||||
|
@ -75,24 +76,24 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
.then(function () {
|
.then(function () {
|
||||||
self.send('authStage2');
|
self.send('authStage2');
|
||||||
}, function (error) { //jshint ignore: line
|
}, function (error) { //jshint ignore: line
|
||||||
console.log(error);
|
console.log(error); // eslint-disable-line no-console
|
||||||
self.send('auth');
|
self.send('auth');
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (config.userId !== self.get("session.session.authenticated.user.id")) {
|
if (config.userId !== self.get("session.session.authenticated.user.id")) {
|
||||||
console.log("github auth wrong user ID, switching");
|
console.log("github auth wrong user ID, switching"); // eslint-disable-line no-console
|
||||||
self.set('config.userId', self.get("session.session.authenticated.user.id"));
|
self.set('config.userId', self.get("session.session.authenticated.user.id"));
|
||||||
}
|
}
|
||||||
self.get('sectionService').fetch(page, "checkAuth", self.get('config'))
|
self.get('sectionService').fetch(page, "checkAuth", self.get('config'))
|
||||||
.then(function () {
|
.then(function () {
|
||||||
self.send('authStage2');
|
self.send('authStage2');
|
||||||
}, function (error) { //jshint ignore: line
|
}, function (error) {
|
||||||
console.log(error);
|
console.log(error); // eslint-disable-line no-console
|
||||||
self.send('auth'); // require auth if the db token is invalid
|
self.send('auth'); // require auth if the db token is invalid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, function (error) { //jshint ignore: line
|
}, function (error) {
|
||||||
console.log(error);
|
console.log(error); // eslint-disable-line no-console
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -163,11 +164,11 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
|
|
||||||
self.set('config.lists', lists);
|
self.set('config.lists', lists);
|
||||||
self.set('busy', false);
|
self.set('busy', false);
|
||||||
}, function (error) { //jshint ignore: line
|
}, function (error) {
|
||||||
self.set('busy', false);
|
self.set('busy', false);
|
||||||
self.set('authenticated', false);
|
self.set('authenticated', false);
|
||||||
self.showNotification("Unable to fetch repositories");
|
self.showNotification("Unable to fetch repositories");
|
||||||
console.log(error);
|
console.log(error); // eslint-disable-line no-console
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -201,11 +202,11 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
self.set('busy', false);
|
self.set('busy', false);
|
||||||
self.set('owners', owners);
|
self.set('owners', owners);
|
||||||
self.getOwnerLists();
|
self.getOwnerLists();
|
||||||
}, function (error) { //jshint ignore: line
|
}, function (error) {
|
||||||
self.set('busy', false);
|
self.set('busy', false);
|
||||||
self.set('authenticated', false);
|
self.set('authenticated', false);
|
||||||
self.showNotification("Unable to fetch owners");
|
self.showNotification("Unable to fetch owners");
|
||||||
console.log(error);
|
console.log(error); // eslint-disable-line no-console
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -253,7 +254,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
meta.set('rawBody', JSON.stringify(response));
|
meta.set('rawBody', JSON.stringify(response));
|
||||||
self.set('busy', false);
|
self.set('busy', false);
|
||||||
self.attrs.onAction(page, meta);
|
self.attrs.onAction(page, meta);
|
||||||
}, function (reason) { //jshint ignore: line
|
}, function (reason) { // eslint-disable-line no-unused-vars
|
||||||
self.set('busy', false);
|
self.set('busy', false);
|
||||||
self.attrs.onAction(page, meta);
|
self.attrs.onAction(page, meta);
|
||||||
});
|
});
|
||||||
|
|
|
@ -28,7 +28,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
|
|
||||||
try {
|
try {
|
||||||
config = JSON.parse(this.get('meta.config'));
|
config = JSON.parse(this.get('meta.config'));
|
||||||
} catch (e) {}
|
} catch (e) {} // eslint-disable-line no-empty
|
||||||
|
|
||||||
if (is.empty(config)) {
|
if (is.empty(config)) {
|
||||||
config = {
|
config = {
|
||||||
|
@ -90,19 +90,19 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
if (is.not.undefined(group)) {
|
if (is.not.undefined(group)) {
|
||||||
Ember.set(config, 'group', group);
|
Ember.set(config, 'group', group);
|
||||||
}
|
}
|
||||||
}, function (reason) { //jshint ignore: line
|
}, function (reason) {
|
||||||
self.set('authenticated', false);
|
self.set('authenticated', false);
|
||||||
self.set('waiting', false);
|
self.set('waiting', false);
|
||||||
self.set('config.APIToken', ''); // clear the api token
|
self.set('config.APIToken', ''); // clear the api token
|
||||||
self.displayError(reason);
|
self.displayError(reason);
|
||||||
console.log("get options call failed");
|
console.log("get options call failed"); // eslint-disable-line no-console
|
||||||
});
|
});
|
||||||
}, function (reason) { //jshint ignore: line
|
}, function (reason) {
|
||||||
self.set('authenticated', false);
|
self.set('authenticated', false);
|
||||||
self.set('waiting', false);
|
self.set('waiting', false);
|
||||||
self.set('config.APIToken', ''); // clear the api token
|
self.set('config.APIToken', ''); // clear the api token
|
||||||
self.displayError(reason);
|
self.displayError(reason);
|
||||||
console.log("auth token invalid");
|
console.log("auth token invalid"); // eslint-disable-line no-console
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
|
|
||||||
self.set('waiting', false);
|
self.set('waiting', false);
|
||||||
self.attrs.onAction(page, meta);
|
self.attrs.onAction(page, meta);
|
||||||
}, function (reason) { //jshint ignore: line
|
}, function (reason) { // eslint-disable-line no-unused-vars
|
||||||
self.set('authenticated', false);
|
self.set('authenticated', false);
|
||||||
self.set('waiting', false);
|
self.set('waiting', false);
|
||||||
self.showNotification(`Something went wrong, try again!`);
|
self.showNotification(`Something went wrong, try again!`);
|
||||||
|
|
|
@ -43,7 +43,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
|
|
||||||
try {
|
try {
|
||||||
config = JSON.parse(this.get('meta.config'));
|
config = JSON.parse(this.get('meta.config'));
|
||||||
} catch (e) {}
|
} catch (e) {} // eslint-disable-line no-empty
|
||||||
|
|
||||||
if (is.empty(config)) {
|
if (is.empty(config)) {
|
||||||
config = {
|
config = {
|
||||||
|
@ -77,8 +77,8 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
Trello.deauthorize();
|
Trello.deauthorize();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}, function (error) { //jshint ignore: line
|
}, function (error) {
|
||||||
console.log(error);
|
console.log(error); // eslint-disable-line no-console
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
self.set('busy', false);
|
self.set('busy', false);
|
||||||
self.set('authenticated', false);
|
self.set('authenticated', false);
|
||||||
self.showNotification("Unable to fetch board lists");
|
self.showNotification("Unable to fetch board lists");
|
||||||
console.log(error);
|
console.log(error); // eslint-disable-line no-console
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
Trello.members.get("me", function (user) {
|
Trello.members.get("me", function (user) {
|
||||||
self.set('config.user', user);
|
self.set('config.user', user);
|
||||||
}, function (error) {
|
}, function (error) {
|
||||||
console.log(error);
|
console.log(error); // eslint-disable-line no-console
|
||||||
});
|
});
|
||||||
|
|
||||||
self.get('sectionService').fetch(page, "boards", self.get('config'))
|
self.get('sectionService').fetch(page, "boards", self.get('config'))
|
||||||
|
@ -193,14 +193,14 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
self.set('busy', false);
|
self.set('busy', false);
|
||||||
self.set('authenticated', false);
|
self.set('authenticated', false);
|
||||||
self.showNotification("Unable to fetch boards");
|
self.showNotification("Unable to fetch boards");
|
||||||
console.log(error);
|
console.log(error); // eslint-disable-line no-console
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
error: function (error) {
|
error: function (error) {
|
||||||
self.set('busy', false);
|
self.set('busy', false);
|
||||||
self.set('authenticated', false);
|
self.set('authenticated', false);
|
||||||
self.showNotification("Unable to authenticate");
|
self.showNotification("Unable to authenticate");
|
||||||
console.log(error);
|
console.log(error); // eslint-disable-line no-console
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -233,7 +233,7 @@ export default Ember.Component.extend(SectionMixin, NotifierMixin, TooltipMixin,
|
||||||
meta.set('rawBody', JSON.stringify(response));
|
meta.set('rawBody', JSON.stringify(response));
|
||||||
self.set('busy', false);
|
self.set('busy', false);
|
||||||
self.attrs.onAction(page, meta);
|
self.attrs.onAction(page, meta);
|
||||||
}, function (reason) { //jshint ignore: line
|
}, function (reason) { // eslint-disable-line no-unused-vars
|
||||||
self.set('busy', false);
|
self.set('busy', false);
|
||||||
self.attrs.onAction(page, meta);
|
self.attrs.onAction(page, meta);
|
||||||
});
|
});
|
||||||
|
|
|
@ -54,16 +54,16 @@ export default Ember.Component.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
codesample_languages: [
|
codesample_languages: [
|
||||||
{text: 'HTML/XML', value: 'markup'},
|
{text: 'HTML/XML', value: 'markup'},
|
||||||
{text: 'JavaScript', value: 'javascript'},
|
{text: 'JavaScript', value: 'javascript'},
|
||||||
{text: 'CSS', value: 'css'},
|
{text: 'CSS', value: 'css'},
|
||||||
{text: 'PHP', value: 'php'},
|
{text: 'PHP', value: 'php'},
|
||||||
{text: 'Ruby', value: 'ruby'},
|
{text: 'Ruby', value: 'ruby'},
|
||||||
{text: 'Python', value: 'python'},
|
{text: 'Python', value: 'python'},
|
||||||
{text: 'Java', value: 'java'},
|
{text: 'Java', value: 'java'},
|
||||||
{text: 'C', value: 'c'},
|
{text: 'C', value: 'c'},
|
||||||
{text: 'C#', value: 'csharp'},
|
{text: 'C#', value: 'csharp'},
|
||||||
{text: 'C++', value: 'cpp'}],
|
{text: 'C++', value: 'cpp'}],
|
||||||
extended_valid_elements: "b,i,b/strong,i/em",
|
extended_valid_elements: "b,i,b/strong,i/em",
|
||||||
plugins: [
|
plugins: [
|
||||||
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
|
'advlist autolink lists link image charmap print preview hr anchor pagebreak',
|
||||||
|
|
|
@ -48,7 +48,6 @@ export default Ember.Component.extend(NotifierMixin, {
|
||||||
},
|
},
|
||||||
|
|
||||||
addFolder() {
|
addFolder() {
|
||||||
console.log("adding folder!");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,11 +34,10 @@ export function documentFileIcon(params) {
|
||||||
|
|
||||||
case "html":
|
case "html":
|
||||||
html = "html.png";
|
html = "html.png";
|
||||||
break;
|
break;
|
||||||
case "css":
|
case "css":
|
||||||
html = "css.png";
|
html = "css.png";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case "bat":
|
case "bat":
|
||||||
case "sh":
|
case "sh":
|
||||||
|
|
|
@ -30,7 +30,6 @@ export default Ember.Route.extend({
|
||||||
let authConfig = this.get('appMeta.authConfig');
|
let authConfig = this.get('appMeta.authConfig');
|
||||||
|
|
||||||
if (authProvider !== constants.AuthProvider.Keycloak) {
|
if (authProvider !== constants.AuthProvider.Keycloak) {
|
||||||
console.log('Expecting keycloak auth but found ' + authProvider);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,6 @@ export default Ember.Route.extend({
|
||||||
this.transitionTo('folders');
|
this.transitionTo('folders');
|
||||||
}, () => {
|
}, () => {
|
||||||
this.transitionTo('auth.login');
|
this.transitionTo('auth.login');
|
||||||
console.log(">>>>> Documize SSO failure");
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,8 +20,8 @@ export default Ember.Controller.extend(NotifierMixin, {
|
||||||
pages: [],
|
pages: [],
|
||||||
toggled: false,
|
toggled: false,
|
||||||
queryParams: ['pageId', 'tab'],
|
queryParams: ['pageId', 'tab'],
|
||||||
pageId: '',
|
pageId: '',
|
||||||
tab: 'index',
|
tab: 'index',
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
toggleSidebar() {
|
toggleSidebar() {
|
||||||
|
|
|
@ -65,8 +65,6 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
error(error /*, transition*/ ) {
|
error(error /*, transition*/ ) {
|
||||||
console.log(error);
|
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
this.transitionTo('/not-found');
|
this.transitionTo('/not-found');
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -81,7 +81,7 @@ export default Ember.Route.extend(NotifierMixin, {
|
||||||
folderPermissions.pushObject(u);
|
folderPermissions.pushObject(u);
|
||||||
|
|
||||||
this.get('folderService').getPermissions(model.id).then((permissions) => {
|
this.get('folderService').getPermissions(model.id).then((permissions) => {
|
||||||
permissions.forEach((permission, index) => { /* jshint ignore:line */
|
permissions.forEach((permission, index) => { // eslint-disable-line no-unused-vars
|
||||||
var folderPermission = folderPermissions.findBy('userId', permission.get('userId'));
|
var folderPermission = folderPermissions.findBy('userId', permission.get('userId'));
|
||||||
if (is.not.undefined(folderPermission)) {
|
if (is.not.undefined(folderPermission)) {
|
||||||
Ember.setProperties(folderPermission, {
|
Ember.setProperties(folderPermission, {
|
||||||
|
|
|
@ -26,9 +26,8 @@ export default Ember.Controller.extend(NotifierMixin, {
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
var credentials = Encoding.Base64.encode(":" + this.model.email + ":" + this.model.password);
|
var credentials = Encoding.Base64.encode(":" + this.model.email + ":" + this.model.password);
|
||||||
window.location.href = "/auth/sso/" + encodeURIComponent(credentials);
|
window.location.href = "/auth/sso/" + encodeURIComponent(credentials);
|
||||||
}).catch((error) => {
|
}).catch((error) => { // eslint-disable-line no-unused-vars
|
||||||
// TODO notify user of the error within the GUI
|
// TODO notify user of the error within the GUI
|
||||||
console.log("Something went wrong attempting database creation, see server log: " + error);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,8 +43,8 @@ export default Ember.Route.extend(ApplicationRouteMixin, TooltipMixin, {
|
||||||
|
|
||||||
error(error, transition) {
|
error(error, transition) {
|
||||||
if (error) {
|
if (error) {
|
||||||
console.log(error);
|
console.log(error); // eslint-disable-line no-console
|
||||||
console.log(transition);
|
console.log(transition); // eslint-disable-line no-console
|
||||||
|
|
||||||
if (netUtil.isAjaxAccessError(error)) {
|
if (netUtil.isAjaxAccessError(error)) {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
|
|
|
@ -43,7 +43,7 @@ export default Ember.Service.extend({
|
||||||
return [this.get('endpoint'), endpoint].join('/');
|
return [this.get('endpoint'), endpoint].join('/');
|
||||||
},
|
},
|
||||||
|
|
||||||
boot(requestedUrl) { // jshint ignore:line
|
boot(requestedUrl) { // eslint-disable-line no-unused-vars
|
||||||
let dbhash;
|
let dbhash;
|
||||||
if (is.not.null(document.head.querySelector("[property=dbhash]"))) {
|
if (is.not.null(document.head.querySelector("[property=dbhash]"))) {
|
||||||
dbhash = document.head.querySelector("[property=dbhash]").content;
|
dbhash = document.head.querySelector("[property=dbhash]").content;
|
||||||
|
|
|
@ -31,7 +31,6 @@ export default Ember.Service.extend({
|
||||||
this.get('audit').record("initialized-keycloak");
|
this.get('audit').record("initialized-keycloak");
|
||||||
resolve(this.get('keycloak'));
|
resolve(this.get('keycloak'));
|
||||||
}).error((err) => {
|
}).error((err) => {
|
||||||
console.log('Keycloak init failed', err);
|
|
||||||
reject(err);
|
reject(err);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -55,7 +54,6 @@ export default Ember.Service.extend({
|
||||||
kc.loadUserProfile().success((profile) => {
|
kc.loadUserProfile().success((profile) => {
|
||||||
return resolve(profile);
|
return resolve(profile);
|
||||||
}).error((err) => {
|
}).error((err) => {
|
||||||
console.log('Keycloak loadUserProfile failed', err);
|
|
||||||
return reject(err);
|
return reject(err);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,14 +13,14 @@ import Ember from 'ember';
|
||||||
|
|
||||||
export default Ember.Service.extend({
|
export default Ember.Service.extend({
|
||||||
action: function(entry) {
|
action: function(entry) {
|
||||||
console.log(entry);
|
console.log(entry); // eslint-disable-line no-console
|
||||||
},
|
},
|
||||||
|
|
||||||
error: function(entry) {
|
error: function(entry) {
|
||||||
console.log(entry);
|
console.log(entry); // eslint-disable-line no-console
|
||||||
},
|
},
|
||||||
|
|
||||||
info: function(entry) {
|
info: function(entry) {
|
||||||
console.log(entry);
|
console.log(entry); // eslint-disable-line no-console
|
||||||
}
|
}
|
||||||
});
|
});
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"node": true,
|
|
||||||
"browser": false
|
|
||||||
}
|
|
|
@ -31,11 +31,11 @@ export default function () {
|
||||||
this.get('/documents', function (schema, request) {
|
this.get('/documents', function (schema, request) {
|
||||||
let folder_id = request.queryParams.folder;
|
let folder_id = request.queryParams.folder;
|
||||||
|
|
||||||
if (folder_id = "VzMuyEw_3WqiafcG") {
|
if (folder_id === "VzMuyEw_3WqiafcG") {
|
||||||
return schema.db.documents.where({ folderId: folder_id });
|
return schema.db.documents.where({ folderId: folder_id });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (folder_id = 'V0Vy5Uw_3QeDAMW9') {
|
if (folder_id === 'V0Vy5Uw_3QeDAMW9') {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -21,17 +21,16 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"broccoli-asset-rev": "^2.4.5",
|
"broccoli-asset-rev": "^2.4.5",
|
||||||
"ember-ajax": "^2.4.1",
|
"ember-ajax": "^2.4.1",
|
||||||
"ember-cli": "2.11.1",
|
"ember-cli": "2.12.0",
|
||||||
"ember-cli-app-version": "^2.0.0",
|
"ember-cli-app-version": "^2.0.0",
|
||||||
"ember-cli-babel": "^5.1.7",
|
"ember-cli-babel": "^5.1.7",
|
||||||
"ember-cli-dependency-checker": "^1.3.0",
|
"ember-cli-dependency-checker": "^1.3.0",
|
||||||
|
"ember-cli-eslint": "^3.0.0",
|
||||||
"ember-cli-htmlbars": "^1.1.1",
|
"ember-cli-htmlbars": "^1.1.1",
|
||||||
"ember-cli-htmlbars-inline-precompile": "^0.3.6",
|
"ember-cli-htmlbars-inline-precompile": "^0.3.6",
|
||||||
"ember-cli-inject-live-reload": "^1.4.1",
|
"ember-cli-inject-live-reload": "^1.4.1",
|
||||||
"ember-cli-jshint": "^2.0.1",
|
|
||||||
"ember-cli-mirage": "^0.2.0",
|
"ember-cli-mirage": "^0.2.0",
|
||||||
"ember-cli-qunit": "^3.0.1",
|
"ember-cli-qunit": "^3.1.0",
|
||||||
"ember-cli-release": "^0.2.9",
|
|
||||||
"ember-cli-sass": "5.3.1",
|
"ember-cli-sass": "5.3.1",
|
||||||
"ember-cli-shims": "^1.0.2",
|
"ember-cli-shims": "^1.0.2",
|
||||||
"ember-cli-sri": "^2.1.0",
|
"ember-cli-sri": "^2.1.0",
|
||||||
|
@ -42,8 +41,8 @@
|
||||||
"ember-load-initializers": "^0.6.0",
|
"ember-load-initializers": "^0.6.0",
|
||||||
"ember-resolver": "^2.0.3",
|
"ember-resolver": "^2.0.3",
|
||||||
"ember-simple-auth": "1.2.0",
|
"ember-simple-auth": "1.2.0",
|
||||||
"ember-source": "~2.11.0",
|
"ember-source": "~2.12.0",
|
||||||
"loader.js": "^4.0.10"
|
"loader.js": "^4.2.3"
|
||||||
},
|
},
|
||||||
"ember-addon": {
|
"ember-addon": {
|
||||||
"paths": [
|
"paths": [
|
||||||
|
|
5
app/tests/.eslintrc.js
Normal file
5
app/tests/.eslintrc.js
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
module.exports = {
|
||||||
|
env: {
|
||||||
|
embertest: true
|
||||||
|
}
|
||||||
|
};
|
|
@ -1,64 +0,0 @@
|
||||||
{
|
|
||||||
"predef": [
|
|
||||||
"server",
|
|
||||||
"document",
|
|
||||||
"window",
|
|
||||||
"location",
|
|
||||||
"setTimeout",
|
|
||||||
"$",
|
|
||||||
"-Promise",
|
|
||||||
"define",
|
|
||||||
"console",
|
|
||||||
"visit",
|
|
||||||
"exists",
|
|
||||||
"fillIn",
|
|
||||||
"click",
|
|
||||||
"keyEvent",
|
|
||||||
"triggerEvent",
|
|
||||||
"find",
|
|
||||||
"findWithAssert",
|
|
||||||
"wait",
|
|
||||||
"DS",
|
|
||||||
"andThen",
|
|
||||||
"currentURL",
|
|
||||||
"currentPath",
|
|
||||||
"currentRouteName",
|
|
||||||
"stubSession",
|
|
||||||
"stubAudit",
|
|
||||||
"pauseTest",
|
|
||||||
"userLogin",
|
|
||||||
"skip",
|
|
||||||
"waitToAppear",
|
|
||||||
"waitToAppear",
|
|
||||||
"stubUserNotification",
|
|
||||||
"is",
|
|
||||||
"authenticateUser",
|
|
||||||
"localStorage"
|
|
||||||
],
|
|
||||||
"node": false,
|
|
||||||
"browser": false,
|
|
||||||
"boss": true,
|
|
||||||
"curly": true,
|
|
||||||
"debug": false,
|
|
||||||
"devel": false,
|
|
||||||
"eqeqeq": true,
|
|
||||||
"evil": true,
|
|
||||||
"forin": false,
|
|
||||||
"immed": false,
|
|
||||||
"laxbreak": false,
|
|
||||||
"newcap": true,
|
|
||||||
"noarg": true,
|
|
||||||
"noempty": false,
|
|
||||||
"nonew": false,
|
|
||||||
"nomen": false,
|
|
||||||
"onevar": false,
|
|
||||||
"plusplus": false,
|
|
||||||
"regexp": false,
|
|
||||||
"undef": true,
|
|
||||||
"sub": true,
|
|
||||||
"strict": false,
|
|
||||||
"white": false,
|
|
||||||
"eqnull": true,
|
|
||||||
"esversion": 6,
|
|
||||||
"unused": true
|
|
||||||
}
|
|
|
@ -8,19 +8,19 @@ const { RSVP: { Promise } } = Ember;
|
||||||
export default function(name, options = {}) {
|
export default function(name, options = {}) {
|
||||||
module(name, {
|
module(name, {
|
||||||
beforeEach() {
|
beforeEach() {
|
||||||
this.application = startApp();
|
this.application = startApp();
|
||||||
localStorage.setItem('folder', 'VzMuyEw_3WqiafcG');
|
localStorage.setItem('folder', 'VzMuyEw_3WqiafcG');
|
||||||
stubAudit(this);
|
stubAudit(this);
|
||||||
stubUserNotification(this);
|
stubUserNotification(this);
|
||||||
server.createList('folder', 2);
|
server.createList('folder', 2);
|
||||||
server.createList('user', 2);
|
server.createList('user', 2);
|
||||||
server.createList('document', 2);
|
server.createList('document', 2);
|
||||||
server.createList('permission', 4);
|
server.createList('permission', 4);
|
||||||
server.createList('folder-permission', 2);
|
server.createList('folder-permission', 2);
|
||||||
server.createList('organization', 1);
|
server.createList('organization', 1);
|
||||||
|
|
||||||
if (options.beforeEach) {
|
if (options.beforeEach) {
|
||||||
return options.beforeEach.apply(this, arguments);
|
return options.beforeEach.apply(this, arguments);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue