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
// Set secret key for your application globally | |
CompanyCamConfiguration.SetSecretKey("YourSecretKey"); | |
var requestOptions = new CompanyCamRequestOptions | |
{ | |
ApiKey = "CompanyApiKey", | |
UserEmailAddress = "UserPerformingAction" | |
}; | |
var projectService = new ProjectService(requestOptions); | |
var project = projectService.Create(new Project |
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 { Controller } from 'stimulus'; | |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import AppContainer from 'components/core/AppContainer'; | |
export default class extends Controller { | |
connect() { | |
const Component = window.ReactComponents[this.data.get('component')]; | |
let props = this.data.get('props') || {}; | |
if (typeof props === 'string') { |
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
module ReactHelper | |
def react_component(name, props: {}, html_class: nil) | |
content_tag( | |
'div', | |
nil, | |
class: html_class, | |
data: { controller: 'react', 'react-component' => name, 'react-props' => react_props(props) } | |
) | |
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
import { Controller } from 'stimulus'; | |
export default class extends Controller { | |
static targets = ['message'] | |
connect() { | |
this.timeout = setTimeout(this.closeFlash, 2500); | |
} | |
disconnect() { |
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 { Controller } from 'stimulus'; | |
export default class extends Controller { | |
connect() { | |
this.select2Mount(); | |
document.addEventListener('turbolinks:before-cache', this.handleCache); | |
} | |
disconnect() { |
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
{ | |
"parser": "babel-eslint", | |
"extends": "airbnb", | |
"globals": { | |
"alert": true, | |
"document": true, | |
"FormData": true, | |
"window": true | |
}, | |
"plugins": [ |
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
{ | |
"project": { | |
"name": "The Office", | |
"address": { | |
"street_address_1": "3793 West Trickery Rd", | |
"city": "Lincoln", | |
"state": "NE", | |
"postal_code": "68512", | |
"country": "US" | |
}, |
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
json = { | |
id: project.id, | |
name: project.name, | |
street_address_1: project.street_address_1, | |
street_address_2: project.street_address_2, | |
city: project.city, | |
state: project.state, | |
postal_code: project.postal_code, | |
country: project.country, | |
company_id: project.company_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
can_view_users_photos = current_user.has_permission?(Permission::VIEW_USERS_PHOTOS) | |
@projects.map do |project| | |
Rails.cache.fetch(['v1', "can-view-all-photo-#{can_view_users_photos}", 'recent', project]) do | |
render partial: 'v1/locations/recent/project', locals: { project: project, can_view_users: can_view_users_photos } | |
end | |
end |
NewerOlder