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

HicServices / RDMP / 9859858140

09 Jul 2024 03:24PM UTC coverage: 56.679% (-0.2%) from 56.916%
9859858140

push

github

JFriel
update

10912 of 20750 branches covered (52.59%)

Branch coverage included in aggregate %.

30965 of 53135 relevant lines covered (58.28%)

7908.05 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 Rdmp.Core.ReusableLibraryCode;
9
using Rdmp.Core.ReusableLibraryCode.Checks;
10
using Rdmp.Core.ReusableLibraryCode.DataAccess;
11

12
namespace Rdmp.Core.Ticketing;
13

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

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

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

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

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

47
    public TicketingReleaseabilityEvaluation GetDataReleaseabilityOfTicket(string masterTicket, string requestTicket,
48
        string releaseTicket, out string reason, out Exception exception)
49
    {
50
        reason = null;
×
51
        exception = null;
×
52
        // No restrictions on releasability
53
        return TicketingReleaseabilityEvaluation.Releaseable;
×
54
    }
55

56
    public string GetProjectFolderName(string masterTicket) =>
57
        UsefulStuff.RegexThingsThatAreNotNumbersOrLettersOrUnderscores.Replace(masterTicket, "");
×
58
}
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