Exemplo n.º 1
0
 public GroupResourcesController(ILinkHelper linkHelper, ISecurityHelper securityHelper, IResourceRepository resourceRepository, IGroupRepository groupRepository, IWebJobController webJobController, ISystemSettingsRepository settingsRepository, IVolatileStorageController volatileStorageController)
 {
     _linkHelper                = linkHelper;
     _resourceRepository        = resourceRepository;
     _securityHelper            = securityHelper;
     _groupRepository           = groupRepository;
     _groupRepository           = groupRepository;
     _webJobController          = webJobController;
     _settingsRepository        = settingsRepository;
     _volatileStorageController = volatileStorageController;
 }
Exemplo n.º 2
0
 public GroupResourcesController(ILinkHelper linkHelper, ISecurityHelper securityHelper, IResourceRepository resourceRepository, IGroupRepository groupRepository, IWebJobController webJobController, ISystemSettingsRepository settingsRepository, IVolatileStorageController volatileStorageController)
 {
     _linkHelper = linkHelper;
     _resourceRepository = resourceRepository;
     _securityHelper = securityHelper;
     _groupRepository = groupRepository;
     _groupRepository = groupRepository;
     _webJobController = webJobController;
     _settingsRepository = settingsRepository;
     _volatileStorageController = volatileStorageController;
 }
        public FooterViewModel(
            IFooterConfiguration configuration,
            IUserContext userContext,
            ILinkCollection linkCollection = null,
            ILinkHelper linkHelper         = null,
            IUrlHelper urlHelper           = null,
            bool useLegacyStyles           = false)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }

            _linkCollection = new LinkCollection();

            _linkCollection = linkCollection ?? new LinkCollection();
            _linkHelper     = linkHelper ?? new LinkHelper(_linkCollection);
            _urlHelper      = urlHelper ?? new UrlHelper();
            UseLegacyStyles = useLegacyStyles;

            AddOrUpdateLink(new Help(_urlHelper.GetPath(configuration.ManageApprenticeshipsBaseUrl, "service/help"), GetLinkClass()));
            AddOrUpdateLink(new Feedback(SurveyHRef, GetLinkClass()));
            AddOrUpdateLink(new Privacy(_urlHelper.GetPath(userContext, configuration.ManageApprenticeshipsBaseUrl, "privacy", "service"), GetLinkClass()));
            if (userContext?.HashedAccountId == null)
            {
                AddOrUpdateLink(new Cookies(_urlHelper.GetPath(configuration.ManageApprenticeshipsBaseUrl, "cookieConsent"), GetLinkClass()));
            }
            else
            {
                AddOrUpdateLink(new Cookies(_urlHelper.GetPath(userContext, configuration.ManageApprenticeshipsBaseUrl, "cookieConsent"), GetLinkClass()));
            }
            AddOrUpdateLink(new BuiltBy(BuiltByHRef, GetLinkClass()));
            AddOrUpdateLink(new OpenGovernmentLicense(OpenGovernmentLicenseHRef, GetLinkClass()));
            AddOrUpdateLink(new OpenGovernmentLicenseV3(OpenGovernmentLicenseHRef, GetLinkClass()));
            AddOrUpdateLink(new CrownCopyright(CrownCopyrightHRef, UseLegacyStyles ? "" : "govuk-footer__link govuk-footer__copyright-logo"));
        }
 public HomeController([NotNull] ILogger<HomeController> logger, [NotNull] ILinkHelper linkHelper)
 {
     _logger = logger;
     _link = linkHelper;
 }
Exemplo n.º 5
0
 public ApiHomeController(ILinkHelper linkHelper)
 {
     _linkHelper = linkHelper;
 }
Exemplo n.º 6
0
 public PageScraper(IPageDataProvider dataProvider, ILinkHelper linkhelper)
 {
     _dataProvider = dataProvider;
     _linkhelper   = linkhelper;
 }
        public HeaderViewModel(
            IHeaderConfiguration configuration,
            IUserContext userContext,
            ILinkCollection linkCollection = null,
            ILinkHelper linkHelper         = null,
            IUrlHelper urlHelper           = null,
            bool useLegacyStyles           = false)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }
            UserContext = userContext ?? throw new ArgumentNullException("userContext");

            _linkCollection = linkCollection ?? new LinkCollection();
            _linkHelper     = linkHelper ?? new LinkHelper(_linkCollection);
            _urlHelper      = urlHelper ?? new UrlHelper();
            UseLegacyStyles = useLegacyStyles;

            MenuIsHidden = false;
            SelectedMenu = "home";

            // Header links
            AddOrUpdateLink(new GovUk(GovUkHref, isLegacy: UseLegacyStyles));
            AddOrUpdateLink(new ManageApprenticeships(configuration.ManageApprenticeshipsBaseUrl, UseLegacyStyles ? "" : "govuk-header__link govuk-header__link--service-name"));
            AddOrUpdateLink(new Help(_urlHelper.GetPath(configuration.ManageApprenticeshipsBaseUrl, "service/help"), UseLegacyStyles ? "" : "das-user-navigation__link"));
            if (configuration.SignOutUrl != null)
            {
                AddOrUpdateLink(new SignOut(configuration.SignOutUrl.IsAbsoluteUri ? configuration.SignOutUrl?.AbsoluteUri : configuration.SignOutUrl.OriginalString, UseLegacyStyles ? "" : "das-user-navigation__link"));
            }
            AddOrUpdateLink(new SignIn(_urlHelper.GetPath(configuration.ManageApprenticeshipsBaseUrl, "service/signIn"), UseLegacyStyles ? "" : "das-user-navigation__link"));

            // User menu - drop down menu link
            AddOrUpdateLink(new YourAccounts(_urlHelper.GetPath(configuration.ManageApprenticeshipsBaseUrl, "service/accounts"), UseLegacyStyles ? "sub-menu-item" : "das-user-navigation__sub-menu-link"));
            AddOrUpdateLink(new RenameAccount(_urlHelper.GetPath(userContext, configuration.ManageApprenticeshipsBaseUrl, "rename"), UseLegacyStyles ? "sub-menu-item" : "das-user-navigation__sub-menu-link"));

            var returnUrl = configuration.ChangePasswordReturnUrl?.AbsoluteUri ?? _urlHelper.GetPath(configuration.ManageApprenticeshipsBaseUrl, "service/password/change");

            AddOrUpdateLink(new ChangePassword(_urlHelper.GetPath(configuration.AuthenticationAuthorityUrl?.Replace("/identity", ""), $"account/changepassword?clientId={configuration.ClientId}&returnurl={System.Net.WebUtility.UrlEncode(returnUrl)}"), UseLegacyStyles ? "sub-menu-item" : "das-user-navigation__sub-menu-link"));

            returnUrl = configuration.ChangeEmailReturnUrl?.AbsoluteUri ?? _urlHelper.GetPath(configuration.ManageApprenticeshipsBaseUrl, "service/email/change");
            AddOrUpdateLink(new ChangeEmail(_urlHelper.GetPath(configuration.AuthenticationAuthorityUrl?.Replace("/identity", ""), $"account/changeemail?clientId={configuration.ClientId}&returnurl={System.Net.WebUtility.UrlEncode(returnUrl)}"), UseLegacyStyles ? "sub-menu-item" : "das-user-navigation__sub-menu-link"));

            AddOrUpdateLink(new NotificationSettings(_urlHelper.GetPath(configuration.ManageApprenticeshipsBaseUrl, "settings/notifications"), UseLegacyStyles ? "sub-menu-item" : "das-user-navigation__sub-menu-link"));

            // Main navigation links
            AddOrUpdateLink(new Home(_urlHelper.GetPath(userContext, configuration.ManageApprenticeshipsBaseUrl, "teams"), UseLegacyStyles ? "" : "das-navigation__link", isLegacy: UseLegacyStyles));
            AddOrUpdateLink(new Finance(_urlHelper.GetPath(userContext, configuration.EmployerFinanceBaseUrl, "finance"), UseLegacyStyles ? "" : "das-navigation__link", isLegacy: UseLegacyStyles));
            AddOrUpdateLink(new Recruitment(_urlHelper.GetPath(userContext, configuration.EmployerRecruitBaseUrl), UseLegacyStyles ? "" : "das-navigation__link", isLegacy: UseLegacyStyles));

            if (string.IsNullOrEmpty(configuration.EmployerCommitmentsV2BaseUrl))
            {
                AddOrUpdateLink(new Apprentices(_urlHelper.GetPath(userContext, configuration.EmployerCommitmentsBaseUrl, "apprentices/home"), UseLegacyStyles ? "" : "das-navigation__link", isLegacy: UseLegacyStyles));
            }
            else
            {
                AddOrUpdateLink(new Apprentices(_urlHelper.GetPath(userContext, configuration.EmployerCommitmentsV2BaseUrl, string.Empty, ""), UseLegacyStyles ? "" : "das-navigation__link", isLegacy: UseLegacyStyles));
            }

            AddOrUpdateLink(new YourTeam(_urlHelper.GetPath(userContext, configuration.ManageApprenticeshipsBaseUrl, "teams/view"), UseLegacyStyles ? "" : "das-navigation__link", isLegacy: UseLegacyStyles));

            AddOrUpdateLink(new YourOrganisations(_urlHelper.GetPath(userContext, configuration.ManageApprenticeshipsBaseUrl, "agreements"), UseLegacyStyles ? "" : "das-navigation__link", isLegacy: UseLegacyStyles));
            AddOrUpdateLink(new PayeSchemes(_urlHelper.GetPath(userContext, configuration.ManageApprenticeshipsBaseUrl, "schemes"), UseLegacyStyles ? "" : "das-navigation__link", isLegacy: UseLegacyStyles));
        }
Exemplo n.º 8
0
 public ApiHomeController(ILinkHelper linkHelper)
 {
     _linkHelper = linkHelper;
 }
Exemplo n.º 9
0
 public HomeController([NotNull] ILogger <HomeController> logger, [NotNull] ILinkHelper linkHelper)
 {
     _logger = logger;
     _link   = linkHelper;
 }
Exemplo n.º 10
0
 public Settings(ILinkHelper linkHelper, ISystemSettingsRepository settingsRepository)
 {
     _linkHelper         = linkHelper;
     _settingsRepository = settingsRepository;
 }
 public RestCollectionGenerator(ILinkHelper linkHelper)
 {
     this.linkHelper = linkHelper;
 }
Exemplo n.º 12
0
 public PageScraper(IPageDataProvider dataProvider, ILinkHelper linkhelper)
 {
     _dataProvider = dataProvider;
     _linkhelper = linkhelper;
 }
Exemplo n.º 13
0
 public Settings(ILinkHelper linkHelper, ISystemSettingsRepository settingsRepository)
 {
     _linkHelper = linkHelper;
     _settingsRepository = settingsRepository;
 }
Exemplo n.º 14
0
 public CatalogController(ILoggerFactory loggerFactory, ILinkHelper linkHelper, ICatalogService catalogSvc)
     : base(loggerFactory.CreateLogger("CatalogController"))
 {
     _catalogSvc = catalogSvc;
     _linkHelper = linkHelper;
 }