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
createdByUserName: Ember.computed( | |
'userId', | |
function() { | |
this.store.findRecord('user', parseInt(this.get('userId'))).then((user) => { | |
console.log("userId"); | |
console.log(this.get('userId')); | |
console.log(user); | |
console.log(user.get('firstname')); | |
return user.get('firstname'); | |
}); |
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
// app/routes/application.js | |
import Ember from 'ember'; | |
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin'; | |
export default Ember.Route.extend(ApplicationRouteMixin, { | |
session: Ember.inject.service('session'), | |
authenticated: Ember.computed.oneWay('session.isAuthenticated'), | |
model() { | |
if (this.get('authenticated')) { |
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
showDashboardLink: Ember.computed( | |
function() { | |
if (this.get('session.isAuthenticated')) { | |
return this.get('store').findAll('datasource').then((datasources) => { | |
this.get('store').filter('datasource', {}, function(datasource) { | |
return datasource.get('id') != null; | |
}).then((datasources) => { | |
if (datasources.get('length') != 0) { | |
return true | |
} else { |
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
showDashboardLink: false, | |
didReceiveAttrs() { | |
console.log("didReceiveAttrs"); | |
if (this.get('session.isAuthenticated')) { | |
return this.get('store').findAll('datasource').then((datasources) => { | |
return this.get('store').filter('datasource', {}, function(datasource) { | |
return datasource.get('id') != null; | |
}).then((datasources) => { | |
console.log("datasources.get('length')"); |
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
/* eslint no-undef: "off" */ | |
import { test } from 'qunit'; | |
import moduleForAcceptance from 'zenline-frontend/tests/helpers/module-for-acceptance'; | |
moduleForAcceptance('Acceptance | login logout'); | |
/* | |
Checks if a user can login and logout | |
*/ |
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
class BackchannelController < ApplicationController | |
skip_before_action :authenticate! | |
before_action :authenticate_internal_api! | |
# POST /backchannel/event | |
def backchannel_event | |
organization_id = params[:organization_id] | |
report_id = params[:report_id] | |
execution_id = params[:execution_id] |
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
import Ember from 'ember'; | |
import AuthenticatedRouteMixin from 'ember-simple-auth/mixins/authenticated-route-mixin'; | |
export default Ember.Route.extend(AuthenticatedRouteMixin, { | |
session: Ember.inject.service('session'), | |
model() { | |
return this.store.findAll('dashboard'); | |
}, |
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
@user = User.find_by(id: params[:id]) | |
unless @user | |
logger.error 'Not found' | |
end | |
begin | |
@user = User.find(params[:id]) | |
rescue => e | |
logger.error 'Not found' | |
end |
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
// app/controllers/datasources/index.js | |
// 1 | |
datasources: Ember.computed.sort('model', 'name') | |
=> Uncaught Error: Assertion Failed: The sort definition for 'datasources' must be a function or an array of strings | |
// 2 | |
datasources: Ember.computed.sort('model', ['name']) | |
=> Uncaught Error: Assertion Failed: The key provided to get must be a string, you passed name |
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
{{#power-select | |
selected=report.dashboardId | |
options=myDashboards | |
placeholder="Select a dashboard" | |
onchange=(action (mut report.dashboardId) value=dashboard.id) | |
as |dashboard| | |
}} | |
{{dashboard.name}} | |
{{/power-select}} |