/// <summary>
        /// View Status for codelists
        /// </summary>
        /// <param name="org">The org</param>
        /// <returns>The view</returns>
        public IActionResult Status(string org)
        {
            AltinnStudioViewModel model = new AltinnStudioViewModel();

            model.CommitInfo = new CommitInfo()
            {
                Org = org, Repository = "codelists"
            };

            if (!string.IsNullOrEmpty(org))
            {
                model.RepositoryContent = _sourceControl.Status(org, "codelists");
            }

            return(View(model));
        }
Example #2
0
        /// <summary>
        /// clone a repository.
        /// </summary>
        /// <param name="org">Unique identifier of the organisation responsible for the app.</param>
        /// <param name="app">Application identifier which is unique within an organisation.</param>
        /// <returns>The home app token page or the clone page.</returns>
        public IActionResult Clone(string org, string app)
        {
            AltinnStudioViewModel model = new AltinnStudioViewModel();
            string token = _sourceControl.GetAppToken();

            if (!string.IsNullOrEmpty(token))
            {
                _sourceControl.CloneRemoteRepository(org, app);
            }
            else
            {
                return(Redirect("/Home/AppToken"));
            }

            return(RedirectToAction("Index", new { org, app }));
        }
        public IActionResult Index(string org, string service)
        {
            AltinnStudioViewModel model = new AltinnStudioViewModel();

            model.Service = service;
            model.Org     = org;

            if (_sourceControl.IsLocalRepo(org, service))
            {
                model.IsLocalRepo       = true;
                model.ServiceEditions   = _repository.GetEditions(org, service);
                model.RepositoryContent = _sourceControl.Status(org, service);
                _sourceControl.FetchRemoteChanges(org, service);
                model.CommitsBehind = _sourceControl.CheckRemoteUpdates(org, service);
            }

            return(View(model));
        }
Example #4
0
        /// <summary>
        /// The index action which will list basic information about the app, as well as
        /// all possible operations on the app.
        /// </summary>
        /// <param name="org">Unique identifier of the organisation responsible for the app.</param>
        /// <param name="app">Application identifier which is unique within an organisation.</param>
        /// <returns>A view with basic information and all available operations.</returns>
        public IActionResult Index(string org, string app)
        {
            ModelMetadata metadata = _repository.GetModelMetadata(org, app);
            IList <ServicePackageDetails> packageDetails = _repository.GetServicePackages(org, app);
            AltinnStudioViewModel         model          = new AltinnStudioViewModel();

            model.Service         = app;
            model.Org             = org;
            model.ServiceMetadata = metadata;

            if (_sourceControl.IsLocalRepo(org, app))
            {
                model.IsLocalRepo       = true;
                model.RepositoryContent = _sourceControl.Status(org, app);
                _sourceControl.FetchRemoteChanges(org, app);
                model.CommitsBehind = _sourceControl.CheckRemoteUpdates(org, app);
            }

            ViewBag.HasCreatedResources = _repository.GetLanguages(org, app).Any();
            ViewBag.HasSetConfiguration = _repository.GetConfiguration(org, app, "basic.json") != null;
            ViewBag.PackageDetails      = packageDetails;

            return(View(model));
        }