• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

HicServices / RDMP / 9872049015

10 Jul 2024 09:54AM UTC coverage: 56.678% (+0.003%) from 56.675%
9872049015

push

github

web-flow
Task/rdmp-1  Update Ticketing System (#1870)

* add initial ticketing update

* fix patch

* interim

* allow blanks

* pass statuses around

* update tests

* add image

* add resources

* tidy up

* tidy up

* fix build

* add icon

* add image

* fix test

* add changelog

* fix error not poping

* add missing line

* fix typo

* tidy up

10913 of 20752 branches covered (52.59%)

Branch coverage included in aggregate %.

17 of 25 new or added lines in 6 files covered. (68.0%)

1 existing line in 1 file now uncovered.

30976 of 53155 relevant lines covered (58.27%)

7852.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/Rdmp.Core/Ticketing/SimpleTicketingSystem.cs
1
// Copyright (c) The University of Dundee 2018-2019
2
// This file is part of the Research Data Management Platform (RDMP).
3
// RDMP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
4
// RDMP is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
5
// You should have received a copy of the GNU General Public License along with RDMP. If not, see <https://www.gnu.org/licenses/>.
6

7
using System;
8
using System.Collections.Generic;
9
using Rdmp.Core.Curation;
10
using Rdmp.Core.ReusableLibraryCode;
11
using Rdmp.Core.ReusableLibraryCode.Checks;
12
using Rdmp.Core.ReusableLibraryCode.DataAccess;
13

14
namespace Rdmp.Core.Ticketing;
15

16
/// <summary>
17
/// Simple implementation of an RDMP ticketing system.  Opens a browser
18
/// at the Url + ticket name.  Has no validation restrictions based on
19
/// ticket states.
20
/// </summary>
21
public class SimpleTicketingSystem : ICheckable, ITicketingSystem
22
{
23
    protected IDataAccessCredentials Credentials { get; set; }
×
24
    protected string Url { get; set; }
×
25

26
    protected SimpleTicketingSystem(TicketingSystemConstructorParameters parameters)
×
27
    {
28
        Credentials = parameters.Credentials;
×
29
        Url = parameters.Url;
×
30
    }
×
31

32
    public void Check(ICheckNotifier notifier)
33
    {
34
        // all ticket names are valid
35
    }
×
36

37
    public bool IsValidTicketName(string ticketName) =>
38
        // all ticket names are valid
39
        true;
×
40

41
    public void NavigateToTicket(string ticketName)
42
    {
43
        // if the user has added a URL just append the ticket name to it
44
        // and open e.g. "www.myticketing?q=" + "HDD-123"
45
        if (!string.IsNullOrWhiteSpace(Url))
×
46
            UsefulStuff.OpenUrl(Url + ticketName);
×
47
    }
×
48

49
    public TicketingReleaseabilityEvaluation GetDataReleaseabilityOfTicket(string masterTicket, string requestTicket,
50
        string releaseTicket, List<TicketingSystemReleaseStatus> acceptedStatuses, out string reason, out Exception exception)
51
    {
52
        reason = null;
×
53
        exception = null;
×
54
        // No restrictions on releasability
55
        return TicketingReleaseabilityEvaluation.Releaseable;
×
56
    }
57

58
    public string GetProjectFolderName(string masterTicket) =>
59
        UsefulStuff.RegexThingsThatAreNotNumbersOrLettersOrUnderscores.Replace(masterTicket, "");
×
60

61
    public List<string> GetAvailableStatuses()
62
    {
NEW
63
        return new List<string>();
×
64
    }
65
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc