Esempio n. 1
0
        private void refreshToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (_selectedTask == null || string.IsNullOrEmpty(_selectedTask.ID))
            {
                return;
            }
            Story story;

            if (!_data.Stories.TryGetValue(_selectedTask.ID, out story))
            {
                return;
            }

            try
            {
                Cursor.Current = Cursors.WaitCursor;

                Story updated = Rally.QueryStory(_selectedTask.ID);
                story.SetObject(updated.Object);

                _graph.DrawStory(story, _selectedTask);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Esempio n. 2
0
        private void resizeWeekToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Story story;

            if (!_data.Stories.TryGetValue(_selectedTask.ID, out story))
            {
                return;
            }

            story.Tags.Clear();

            if (sender == week1ToolStripMenuItem)
            {
                story.Tags.Add("week1");
            }
            else if (sender == week2ToolStripMenuItem)
            {
                story.Tags.Add("week2");
            }
            else if (sender == week3ToolStripMenuItem)
            {
                story.Tags.Add("week3");
            }
            else if (sender == week1ToWeek2ToolStripMenuItem)
            {
                story.Tags.Add("week1");
                story.Tags.Add("week2");
            }
            else if (sender == week2ToWeek3ToolStripMenuItem)
            {
                story.Tags.Add("week2");
                story.Tags.Add("week3");
            }

            try
            {
                Cursor.Current = Cursors.WaitCursor;
                Story updated = Rally.UpdateStoryTag(_selectedTask.ID, story.Tags);
                if (story != null)
                {
                    story.SetObject(updated.Object);
                    //_graph.SetStoryLength(story, _selectedTask);
                }
                else
                {
                    MessageBox.Show("Failed to update Rally");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Esempio n. 3
0
        private void buttonLogin_Click(object sender, EventArgs e)
        {
            try
            {
                Rally.Initialize(textBoxUser.Text, textBoxPass.Text, RallyServer);

                groupBox1.Enabled = false;
                groupBox2.Enabled = tabControl1.Enabled = buttonPlot.Enabled = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Esempio n. 4
0
        private void PlotRelease()
        {
            string portfolio;

            if (!_portfolios.TryGetValue(comboBoxGroup.Text, out portfolio))
            {
                return;
            }

            _data             = new RallyData();
            _data.ProjectName = string.Empty;

            Cursor.Current = Cursors.WaitCursor;

            Query query = new Query("Release.Name", Query.Operator.Equals, textBoxRelease.Text);

            if (!string.IsNullOrEmpty(textBoxMilestone.Text))
            {
                query = query.And(new Query("MileStones.Name", Query.Operator.Contains, textBoxMilestone.Text));
            }
            _data.Sagas = Rally.QuerySagaFeatures(query, portfolio);

            progressBar.Value = 40;
            _data.Stories     = Rally.QueryStories(_data.Sagas.Keys, Query.Operator.Equals, "SagaFeature.ObjectUUID", string.Empty);
            Rally.QueryPredecessors(_data.Stories.Values);
            progressBar.Value = 80;
            _data.Iterations  = Rally.QueryIterations(_data.Stories.Values);
            progressBar.Value = 90;

            foreach (var story in _data.Stories.Values)
            {
                RallyData.AssociateIteration(story, _data.Iterations);
                RallyData.AssociateSaga(story, _data.Sagas);
            }

            Form1 form = new Form1();

            form.Text = portfolio;
            form.Initialize(_data, dateTimePicker1.Value);
            form.Draw(new Filter());
            form.Show();

            progressBar.Value = 0;
            Cursor.Current    = Cursors.Default;
        }
Esempio n. 5
0
        private void PlotPeople()
        {
            List <string> ppl = FileReader.OpenPeopleFile(textBoxPeople.Text);

            if (ppl.Count <= 0)
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;

            _data             = new RallyData();
            _data.ProjectName = string.Empty;

            List <string> uuids = Rally.QueryUsers(ppl);

            Dictionary <string, Story> tasks = Rally.QueryTasks(uuids, Query.Operator.Equals, "Owner.ObjectUUID", textBoxRelease.Text);

            progressBar.Value = 20;
            _data.Stories     = Rally.QueryStories(uuids, Query.Operator.Equals, "Owner.ObjectUUID", textBoxRelease.Text);

            foreach (var item in tasks)
            {
                _data.Stories.Add(item.Key, item.Value);
            }

            progressBar.Value = 40;
            _data.Iterations  = Rally.QueryIterations(_data.Stories.Values);
            progressBar.Value = 80;

            foreach (Story story in _data.Stories.Values)
            {
                RallyData.AssociateIteration(story, _data.Iterations);
            }

            Form1 form = new Form1();

            form.Text = Path.GetFileName(textBoxPeople.Text);
            form.Initialize(_data, dateTimePicker1.Value);
            form.DrawPeople(ppl);
            form.Show();

            progressBar.Value = 0;
            Cursor.Current    = Cursors.Default;
        }
Esempio n. 6
0
        private void moveIterationMenuItem_Click(object sender, EventArgs e)
        {
            var item = sender as ToolStripMenuItem;

            if (item == null)
            {
                return;
            }
            var iteration = item.Tag as Iteration;

            if (iteration == null)
            {
                return;
            }

            try
            {
                Cursor.Current = Cursors.WaitCursor;
                Story story = Rally.UpdateStoryIteration(_selectedTask.ID, iteration.Object);
                if (story != null)
                {
                    Story existing;
                    if (_data.Stories.TryGetValue(_selectedTask.ID, out existing))
                    {
                        existing.SetObject(story.Object);
                        existing.SetIteration(iteration);
                        _graph.DrawStory(existing, _selectedTask);
                    }
                }
                else
                {
                    MessageBox.Show("Failed to update Rally");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Esempio n. 7
0
        private void PlotFile()
        {
            List <string> formattedIDs = FileReader.OpenSagaFeatureFile(textBoxFile.Text);

            if (formattedIDs.Count <= 0)
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;

            _data             = new RallyData();
            _data.ProjectName = string.Empty;
            _data.Sagas       = Rally.QuerySagaFeatures(Rally.GenerateQuery(formattedIDs, "FormattedID"), string.Empty);
            progressBar.Value = 20;
            _data.Stories     = Rally.QueryStories(_data.Sagas.Keys, Query.Operator.Equals, "SagaFeature.ObjectUUID", string.Empty);
            progressBar.Value = 40;
            _data.Iterations  = Rally.QueryIterations(_data.Stories.Values);
            Rally.QueryPredecessors(_data.Stories.Values);

            progressBar.Value = 60;

            List <string> storyIDs = Story.GetObjectIDs(Story.GetLeafs(_data.Stories.Values));

            _data.Tasks = Rally.QueryTasks(storyIDs, Query.Operator.Equals, "WorkProduct.ObjectUUID", string.Empty);

            progressBar.Value = 80;

            _data.ReleaseDate = Rally.QueryReleaseDate(string.Empty, textBoxRelease.Text);

            _data.Initialize(dateTimePicker1.Value);
            _data.SagasOrder = formattedIDs;

            Form1 form = new Form1();

            form.Text = Path.GetFileName(textBoxFile.Text);
            form.Initialize(_data, dateTimePicker1.Value);
            form.Draw(new Filter());
            form.Show();

            progressBar.Value = 0;
            Cursor.Current    = Cursors.Default;
        }
Esempio n. 8
0
        private void predecessorItem_Click(object sender, EventArgs e)
        {
            if (_selectedTask == null)
            {
                return;
            }
            ToolStripMenuItem item = sender as ToolStripMenuItem;

            if (item == null)
            {
                return;
            }

            item.Checked = !item.Checked;   // toggle

            Story story;

            if (!_data.Stories.TryGetValue(_selectedTask.ID, out story))
            {
                return;
            }
            SagaFeature saga;

            if (!_data.Sagas.TryGetValue(story.SagaFeatureUUID, out saga))
            {
                return;
            }

            List <string> list = new List <string>();

            foreach (ToolStripMenuItem entry in setPredecessorToolStripMenuItem.DropDownItems)
            {
                if (entry.Checked)
                {
                    list.Add(entry.Text);
                }
            }

            try
            {
                Cursor.Current = Cursors.WaitCursor;
                Story updated = Rally.UpdateStoryPredecessors(_selectedTask.ID, list);
                if (updated != null)
                {
                    story.SetObject(updated.Object);
                    Rally.QueryPredecessors(story);
                    _graph.SetPredecessors(saga);
                }
                else
                {
                    MessageBox.Show("Failed to update Rally");
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                Cursor.Current = Cursors.Default;
            }
        }
Esempio n. 9
0
        private void PlotProject()
        {
            string projectOID;

            if (!_projectOIDs.TryGetValue(comboBoxProject.Text, out projectOID))
            {
                return;
            }
            string projectName = Rally.QueryProjectName(projectOID);

            if (string.IsNullOrEmpty(projectName))
            {
                return;
            }

            Cursor.Current = Cursors.WaitCursor;

            _data             = new RallyData();
            _data.ProjectName = projectName;
            List <Story>  orphans;
            List <string> sfUUIDs = Rally.QuerySagaFeatureUUIDsFromStories(projectOID, textBoxRelease.Text, out orphans);

            progressBar.Value = 20;
            _data.Sagas       = Rally.QuerySagaFeatures(Rally.GenerateQuery(sfUUIDs, "ObjectUUID"), string.Empty);
            progressBar.Value = 40;
            _data.Stories     = Rally.QueryStories(sfUUIDs, Query.Operator.Equals, "SagaFeature.ObjectUUID", string.Empty);
            Rally.QueryPredecessors(_data.Stories.Values);
            progressBar.Value = 80;

            _data.Iterations = Rally.QueryIterations(_data.Stories.Values);

            // this will populate tasks
            List <string> storyIDs = Story.GetObjectIDs(Story.GetLeafs(_data.Stories.Values, projectName));

            _data.Tasks = Rally.QueryTasks(storyIDs, Query.Operator.Equals, "WorkProduct.ObjectUUID", string.Empty);

            progressBar.Value = 90;

            _data.ReleaseDate = Rally.QueryReleaseDate(projectOID, textBoxRelease.Text);

            if (orphans.Count > 0)
            {
                SagaFeature sf = new SagaFeature {
                    ObjectUUID = "0", FormattedID = "0", Name = "Orphaned Stories"
                };
                sf.Stories.AddRange(orphans);
                _data.Sagas.Add("0", sf);
            }

            _data.Initialize(dateTimePicker1.Value);

            Form1 form = new Form1();

            form.Text = comboBoxProject.Text;
            form.Initialize(_data, dateTimePicker1.Value);
            form.Draw(new Filter());
            form.Show();

            progressBar.Value = 0;
            Cursor.Current    = Cursors.Default;
        }