Skip to content

Instantly share code, notes, and snippets.

View dbouwman's full-sized avatar
😎
Hubbin it up @ Esri

Dave Bouwman dbouwman

😎
Hubbin it up @ Esri
View GitHub Profile
<p>
<font size='4'>Data created 2010 - 2012.</font>
</p>
<p>
<font size='4'><br /></font>
</p>
<p>
<font size='4'><br /></font>
</p>
<p>
@dbouwman
dbouwman / e2e-requirements.md
Last active June 22, 2019 14:51
End to End Test System

Requirements

Replacement e2e test system that is easy for all devs to debug/extend/maintain.

Functional

  • ES6
  • run against local, qa and prod
  • able to run multiple browsers
    • ff/ch/edge
  • report test status to same end-point the ember ones use

Site Boot Flow

Injection Parsing

  • __SITE Injected? Y: use as model, store in appSettings
    • N: __DOMAININFO injected? : Y: use siteId to fetch Site
      • N: use window.location to determine siteId

Determine domainInfo model from Window.location

At this stage we do not actually fetch the full item. We are constructing a hash that is roughly the shape of a domain record:

@dbouwman
dbouwman / pen.js
Created February 8, 2019 19:57
CodePen Hacking of /updateInfo
const token = 'FbIWugy4eCsS-hq2ZV42MJR7EYH9ID_AXY2SAeNmCZvi5NVjSNuUysrCr1cgesIZHP_ti31IaGWLZDJFX1U21Z3aQ3B6A8Xcny9kZc-i_IdUzY-kBYXyV2gn_euATqpfr8zw9TemIODV4ORAB0gxDPTwc884PpR_qVwa4Ud-nc47JoN_v53_n1xzSqSX6bg_OSy7VDcevFyiA8hOpWdekg..';
const data = {
name: 'Dave Bouwman',
email: 'dbouwman@esri.com'
};
const body = {
file: new Blob([JSON.stringify(data)], {type: 'application/json'}),
f: 'json',
token: token,
@dbouwman
dbouwman / Tech.md
Created August 31, 2017 13:32
Theme Blog Tech

Static Generated Css

For the last year, when a Hub Site was saved, we had been taking your theme colors, and sending them to a server which would generate a complete stylesheet, based on those colors. The resulting css was then stored as a "resource" with the Hub Site item, and would remain static until the site owner edited the theme in the Layout Editor.

In general, this processed worked pretty well, however over time we noticed a number of issues.

The first issue, which caused the most problems, was due to the css being generated and persisted. When Esri updated the underlying application code, all sites would be running that code immediately - however, they would load with the old css. Although we went to great lengths to ensure no catastrophic changes, with tens of thousands of sites, many highly customized, inevitably issues would arise, and customers would have to edit and re-save the site.

The second reason for making a change is that Hub Sites With be included with the ArcGIS Enterprise 10.6 re

/**
* Given a username and password, make a https request for a token
*/
getToken (username, password, portalBaseUrl) {
const url = `${portalBaseUrl}/sharing/rest/generateToken?f=json`;
let options = {
method: 'POST',
form: {
username: username,
password: password,
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
rejectMe () {
return Ember.RSVP.reject('I rejected');
},
resolveMe () {
return Ember.RSVP.resolve('I resolved');
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
toggleValue() {
this.toggleProperty('value');
},
inputChanged(value) {
if (typeof this.onchange === 'function') {
@dbouwman
dbouwman / panel-card.html
Created September 11, 2016 17:13
Gist w/ Bootstrap Responsive Card
<div class="panel panel-default panel-card ">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
<img src="http://pipsum.com/280x320.jpg" class="img-responsive center-block">
<div class="overlay">
<ul>
<li><span class="glyphicon glyphicon-trash"></span></li>
<li><span class="glyphicon glyphicon-cog"></span></li>
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
attr: {
"type":{
"label":"Type",
"fieldType":"esriFieldTypeString"
},
"date":{