예제 #1
0
파일: Project.java 프로젝트: sjaddow/kunagi
  public void addTestIssues() {
    Issue iss = null;

    // noobs
    iss = issueDao.postIssue(this, "thiz cr4p don't work, n00bz!!1");
    iss.setDescription("go home, u noobz ..#");

    // eclipse integration
    iss = issueDao.postIssue(this, "I want eclipse integration");
    iss.setDescription(
        "I would be really nice if eclipse commits would be represented in Kunagi! Thank you!");

    // link bug
    iss = issueDao.postIssue(this, "Bug: Links don't work");
    iss.setDescription("When I try to post links to other pages, I get links to the Wiki. WTF?");

    // date crash
    iss = issueDao.postIssue(this, "Crash when using Dates after 2012");
    iss.setDescription(
        "The program crashes whenever I enter dates after 2012. Can't figure out what the problem is though.");
    iss.setAcceptDate(Date.beforeDays(2));
    iss.setUrgent(true);
    iss.setSeverity(scrum.client.issues.Issue.SEVERE);

    // gui bug
    iss = issueDao.postIssue(this, "GUI inconsistency between PB and SB");
    iss.setDescription(
        "The order of Qualities and Tests is different between widgets in the PB and SB. It should be the same.");
    iss.setAcceptDate(Date.beforeDays(35));
    iss.setUrgent(true);
    iss.setSeverity(scrum.client.issues.Issue.MINOR);

    // navi display bug
    iss = issueDao.postIssue(this, "navigation displays wrong current view");
    iss.setDescription(
        "When I open the Whiteboard, \"Sprint Backlog\" is selected in the navigation. Same for other jumps.");
    iss.setAcceptDate(Date.today());
    iss.setUrgent(true);
    iss.setSeverity(scrum.client.issues.Issue.MINOR);
    iss.setIssuerName("Witek");
    iss.setIssuerEmail("*****@*****.**");

    // terrific pb suggestion
    iss = issueDao.postIssue(this, "Product Backlog should be terrific, not amazing");
    iss.setDescription(
        "56% of users want a terrific PB, not an amazing one. We should change that in one of the upcoming releases.");
    iss.setAcceptDate(Date.today());

    // flattr
    iss = issueDao.postIssue(this, "Add a flattr-button");
    iss.setDescription("See [http://flattr.com].");
    iss.setCloseDate(Date.beforeDays(1));

    // thank you
    iss = issueDao.postIssue(this, "I like this software, thank you!");
    iss.setDescription("I'm using Kunagi for my own project now. Thanks for the great work.");
    iss.setCloseDate(Date.today());
  }
예제 #2
0
 @Override
 public void onConvertIssueToStory(GwtConversation conversation, String issueId) {
   Issue issue = issueDao.getById(issueId);
   Requirement story = requirementDao.postRequirement(issue);
   issue.appendToStatement("Created Story " + story.getReference() + " in Product Backlog.");
   issue.setCloseDate(Date.today());
   sendToClients(conversation, story);
   sendToClients(conversation, issue);
   User currentUser = conversation.getSession().getUser();
   postProjectEvent(
       conversation,
       currentUser.getName()
           + " created "
           + story.getReference()
           + " from "
           + issue.getReferenceAndLabel(),
       issue);
   changeDao.postChange(issue, currentUser, "storyId", null, story.getId());
   changeDao.postChange(story, currentUser, "issueId", null, issue.getId());
   subscriptionService.copySubscribers(issue, story);
   subscriptionService.notifySubscribers(
       story, "Story created from " + issue, conversation.getProject(), null);
 }
예제 #3
0
  private void onIssueChanged(GwtConversation conversation, Issue issue, Map properties) {
    User currentUser = conversation.getSession().getUser();

    if (properties.containsKey("closeDate")) {
      if (issue.isClosed()) {
        issue.setCloseDate(Date.today());
        postProjectEvent(
            conversation, currentUser.getName() + " closed " + issue.getReferenceAndLabel(), issue);
        subscriptionService.notifySubscribers(
            issue, "Issue closed", conversation.getProject(), null);
      } else {
        postProjectEvent(
            conversation,
            currentUser.getName() + " reopened " + issue.getReferenceAndLabel(),
            issue);
        subscriptionService.notifySubscribers(
            issue, "Issue reopened", conversation.getProject(), null);
      }
    }

    if (properties.containsKey("ownerId") && issue.isOwnerSet()) {
      if (!issue.isFixed()) {
        postProjectEvent(
            conversation,
            currentUser.getName() + " claimed " + issue.getReferenceAndLabel(),
            issue);
      }

      Release nextRelease = issue.getProject().getNextRelease();
      if (nextRelease != null && issue.isFixReleasesEmpty()) {
        issue.setFixReleases(Collections.singleton(nextRelease));
      }
    }

    if (properties.containsKey("fixDate")) {
      if (issue.isFixed()) {
        postProjectEvent(
            conversation, currentUser.getName() + " fixed " + issue.getReferenceAndLabel(), issue);
      } else {
        postProjectEvent(
            conversation,
            currentUser.getName() + " rejected fix for " + issue.getReferenceAndLabel(),
            issue);
      }
    }

    if (properties.containsKey("urgent")) {
      if (issue.isBug()) {
        Release currentRelease = issue.getProject().getCurrentRelease();
        if (issue.isAffectedReleasesEmpty() && currentRelease != null) {
          issue.setAffectedReleases(Collections.singleton(currentRelease));
        }
      }
    }

    if (properties.containsKey("acceptDate")) {
      if (issue.isIdea() || issue.isBug()) {
        postProjectEvent(
            conversation,
            currentUser.getName() + " accepted " + issue.getReferenceAndLabel(),
            issue);
        subscriptionService.notifySubscribers(
            issue, "Issue accepted", conversation.getProject(), null);
      }
    }

    issue.getProject().updateHomepage(issue, false);
  }