Week 14, Day Last day of our RGSoC
Today is the last day of our RGSoC, excited but also a little bit sad. It was so nice experience to LEARN BY DOING at RGSoC.
Last day, i continue to implement the initiaitve with modal dialog approach, as before i failed to make the cancel and submit button work. So based on previous experiperience on implementing alert on removing support, i impelemt edit initiaitve. At the beginning, i also have problem on cancela and update button, as they both save the changed content. Then i google but haven't found solution. Then i went to ember js irc channel to ask, locks gave me hint on using rollback menthod. Then i google again and tried some times. Finally it work.
Below is code
app/templates/edit.js
.edit h5 Initiative title {{input value=title}} h5 Initiative description {{input value=description}}
.update button click="update" Update
.cancel button click="cancel" Cancel
app/controllers/edit.js
import Ember from 'ember';
var EditController = Ember.ObjectController.extend({
actions: { cancel: function() { this.get('model').rollback(); return this.send('closeEdit'); },
update: function() { return this.send('closeEdit'); } }
});
export default EditController;
app/routes/intiative.js
openEdit: function(edit, model) { this.controllerFor(edit).set('model', model); return this.render(edit, { into: 'initiative', outlet: 'edit' }); },
closeEdit: function() { return this.disconnectOutlet({ outlet: 'edit', parentView: 'initiative' }); },
templates/initiative.emblem
.edit_button a click="openEdit 'edit' model" Edit Initiative h5 =outlet edit
This is what i did, now wait for Oliver's feedback. The other thing is Cathy and i will take particicpate in Helsinki challengand also some workshops at Helsinki.
***
As for me, Cathy, I have two outstanding PRs to finish up. One is from some time ago regarding posting a new initiative to an existing issue. I had used controllers to store the an issueExists flag for the existing issue, which got passed to the template of the new initiative form. Then I could know whether or not the issue already exists and could display only the part of the form that relates to the initiative, otherwise, both issue and initiative parts of the form are displayed. I read that controllers can be used to store information about the current state of the app, so this approach seemed reasonable to me. However, Oliver thinks this is not intuitive and he suggested keeping everything related to the issue (including making a new initiative for an issue) under the Issues resource, this way no parameters have to be stored on controllers for use in other routes. I spent several hours trying to get this to work, but ultimately got stuck when transitioning to the new initiative route nested under issue. I could not get the model hook for the initiative model (undefined), and after some reading it I discovered that child routes don't inherit params from their parent resources. So, since initiative was not nested under initiatives (that would make two initiatives resources in two different places, which confuses the app), I reasoned that this approach is not viable.
That said, perhaps I am overlooking something about accessing the model hooks, so now I am waiting to hear Oliver's feedback. Suspense!!
The next PR involves some styling for the delete suggestion button. Oliver wants the delete link to be "discoverable"--that is, it only appears when the user hovers over the suggestion title. I will look at that now.
As Qian said, we are just so happy to have participated in RGSoC and can't believe it's already over. The program has given us so much knowledge and we are planning to move forward with more apps. I also will have a small Rails project to do for a real client, starting tomorrow, which makes me nervous but also quite excited!!
<3 <3 <3











