saxifrage / cityasacampus

An open-source platform for connecting and showcasing resources within local learning communities.
http://cityasacampus.org/
5 stars 4 forks source link

UI for creating pathways #364

Closed chadwhitacre closed 3 years ago

chadwhitacre commented 8 years ago

Closes #201.

To-do

Based on https://github.com/saxifrage/cityasacampus/pull/364#issuecomment-162681923.

WIP on #377

chadwhitacre commented 8 years ago

Alright, so where is our client-side routing implemented?

chadwhitacre commented 8 years ago

client/index.js, looks like ...

chadwhitacre commented 8 years ago

I made a client/dashboard/PathwaysView.html file, and wired it up in index.js, but it's not available through the web. Our Gulp asset pipeline is not copying it over into public/dashboard/ as I would expect. How do I tell Gulp to do that?

chadwhitacre commented 8 years ago

Looks like templates is the task responsible for copying the file over.

chadwhitacre commented 8 years ago

Why isn't it?

chadwhitacre commented 8 years ago

Hrm, it's there now. :-/

chadwhitacre commented 8 years ago

:shrug:

screen shot 2015-12-04 at 5 25 31 pm

chadwhitacre commented 8 years ago

Alright, there's a start, anyway. I plan to pick up with this on Monday, hopefully at the Sprout office! :-)

MatthewVita commented 8 years ago

Lookin' good, @whit537. Adding a couple commits for housekeeping.

chadwhitacre commented 8 years ago

Cool, thanks @MatthewVita. :-)

chadwhitacre commented 8 years ago

Rebased on master now that #357 has landed. Previous head was d4458add7a311982b4200903705de039782aa460.

chadwhitacre commented 8 years ago

https://github.com/marceljuenemann/angular-drag-and-drop-lists

chadwhitacre commented 8 years ago

http://marceljuenemann.github.io/angular-drag-and-drop-lists/demo/#/simple

Looks about right:

screen shot 2015-12-07 at 9 56 21 am

chadwhitacre commented 8 years ago

I am working on installing angular-drag-and-drop-lists into our application.

chadwhitacre commented 8 years ago

My first step is to get the code into our public/vendors.min.js.

chadwhitacre commented 8 years ago

I've added the following to our package.json:

    "angular-drag-and-drop-lists": "marceljuenemann/angular-drag-and-drop-lists#822552b2b6fe28fa7675ec434c769fa96ba5e154",
chadwhitacre commented 8 years ago

I've run npm install and npm ls shows angular-drag-and-drop-lists to be installed:

$ npm ls|grep angular
├── angular@1.3.14
├── angular-cookie@1.0.0 (git+https://github.com/ivpusic/angular-cookie.git#67eb8455445dfbf38d23f17e3a0b9af773b03d77)
├── angular-drag-and-drop-lists@1.3.0 (git+https://github.com/marceljuenemann/angular-drag-and-drop-lists.git#822552b2b6fe28fa7675ec434c769fa96ba5e154)
├── angular-filter@0.5.4
├── angular-route@1.3.14
$
chadwhitacre commented 8 years ago

From angular-drag-and-drop-lists' package.json, I expect the angular-drag-and-drop-lists.js file to end up in our node_modules, and for gulp to include it from there when creating vendors.min.js.

chadwhitacre commented 8 years ago

Looks like I have to add it to the gulpfile ...

chadwhitacre commented 8 years ago

Yay! :-)

screen shot 2015-12-07 at 10 23 59 am

I had to rerun gulp. The gulp watcher wasn't apparently smart enough?

chadwhitacre commented 8 years ago

Now I'm working on getting the simple demo installed into the stub pathways page.

chadwhitacre commented 8 years ago

29a6a676df4709c0b61cdd1ecfd4ea75084e82b3 is giving me the pre with the computed dummy data, but I'm not getting the ul items.

screen shot 2015-12-07 at 10 31 23 am

chadwhitacre commented 8 years ago

So Angular has some kinda scopes, right? And the DOM has to match or be scoped or whatever with the controller?

chadwhitacre commented 8 years ago

modelAsJson appears to be in scope in the DOM.

chadwhitacre commented 8 years ago

Where does list come from in https://github.com/marceljuenemann/angular-drag-and-drop-lists/blob/822552b2b6fe28fa7675ec434c769fa96ba5e154/demo/simple/simple.html#L8?

chadwhitacre commented 8 years ago

Looks like it comes from https://github.com/marceljuenemann/angular-drag-and-drop-lists/blob/822552b2b6fe28fa7675ec434c769fa96ba5e154/demo/simple/simple-frame.html#L13.

chadwhitacre commented 8 years ago

Boom!

screen shot 2015-12-07 at 10 51 09 am

chadwhitacre commented 8 years ago

Okay! Ready to start getting the drag/drop itself actually working. :-)

screen shot 2015-12-07 at 10 59 02 am

chadwhitacre commented 8 years ago

Alright! Where the heck is the drag-n-drop?

chadwhitacre commented 8 years ago

What is click supposed to do and why isn't it doing it in my case?

chadwhitacre commented 8 years ago

https://github.com/marceljuenemann/angular-drag-and-drop-lists/pull/186 :hamburger:

chadwhitacre commented 8 years ago

The demo has a click event listed in the DOM inspector:

screen shot 2015-12-07 at 11 35 18 am

Ours doesn't:

screen shot 2015-12-07 at 11 35 56 am

chadwhitacre commented 8 years ago

Alright, how the heck do I debug this?

chadwhitacre commented 8 years ago

Let's read the docs ...

chadwhitacre commented 8 years ago

BTW, what's our browser support target, @MatthewVita @dmtroyer @timothyfcook? I'm not seeing an answer on http://cityasacampus.org/ ...

chadwhitacre commented 8 years ago

dnd-draggable Required attribute. The value has to be an object that represents the data of the element. In case of a drag and drop operation the object will be serialized and unserialized on the receiving end.

https://github.com/marceljuenemann/angular-drag-and-drop-lists#dnd-draggable-directive

chadwhitacre commented 8 years ago

The value has to be an object that represents the data of the element.

Why is this item in the demo? Do I have some plumbing wrong?

chadwhitacre commented 8 years ago

Why is this item in the demo?

Probably from the item in list ng-repeat?

chadwhitacre commented 8 years ago

... which I believe is working because {{item.label}} appears to be working.

chadwhitacre commented 8 years ago

More to the point: the demo has drag{start,end} events, and we don't:

screen shot 2015-12-07 at 12 03 31 pm

chadwhitacre commented 8 years ago

The (program):34 links are unhelpful. They go to:

chrome-devtools://devtools/bundled/inspector.html?&remoteBase=https://chrome-devtools-frontend.appspot.com/serve_file/@deadbeef/&can_dock=true&dockSide=undocked
chadwhitacre commented 8 years ago

And that's an empty page:

<!--
 * Copyright 2014 The Chromium Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
-->
<!doctype html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Security-Policy" content="object-src 'none'; script-src 'self' 'unsafe-eval' https://chrome-devtools-frontend.appspot.com">
    <link rel="stylesheet" type="text/css" href="inspector.css">
    <script type="text/javascript" src="inspector.js"></script>
</head>
<body class="undocked" id="-blink-dev-tools"></body>
</html>
chadwhitacre commented 8 years ago

Is Angular not running properly on this page?

chadwhitacre commented 8 years ago

I don't see any Angular-y events on the html element (I'm now using the Firefox web inspector since Chrome's events helper was unhelpful):

screen shot 2015-12-07 at 12 09 43 pm

chadwhitacre commented 8 years ago

I do see some on the demo:

screen shot 2015-12-07 at 12 11 09 pm

chadwhitacre commented 8 years ago

Well, I guess we bundle Angular into vendors.min.js.

chadwhitacre commented 8 years ago

My hunch is that @MatthewVita and/or @dmtroyer could point me in the right direction pretty quickly here.

chadwhitacre commented 8 years ago

Barring that, I suppose it's time to go spelunking in Angular ...

chadwhitacre commented 8 years ago

I'm trying to get unminified Angular into vendors.min.js. I modified our gulpfile.js to reference the angular.js instead of angular.min.js. I double-checked that angular.js contains the unminified source. I terminated gulp default and ran it again. I removed vendors.min.js and reran gulp default. I'm still seeing minified Angular in vendors.min.js. Ooh ... I guess we are minifying it ourselves even if we're not using their pre-minified version as input ...

chadwhitacre commented 8 years ago

Yeah, there we go ...

screen shot 2015-12-07 at 12 33 43 pm