Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kjetilhau committed Oct 4, 2024
1 parent ae752f3 commit 2092890
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 86 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Data;
using System.Net.Mime;
using System.Net.Mime;
using Equinor.ProjectExecutionPortal.Application.Queries.ContextTypes.GetContextTypes;
using Equinor.ProjectExecutionPortal.Domain.Common.Exceptions;
using Equinor.ProjectExecutionPortal.WebApi.Authorization;
Expand All @@ -8,8 +7,6 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace Equinor.ProjectExecutionPortal.WebApi.Controllers
{
[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ namespace Equinor.ProjectExecutionPortal.WebApi.ViewModels.ContextType
{
public class ApiContextType
{
public ApiContextType() { }
public ApiContextType()
{ }

public ApiContextType(ContextTypeDto contextTypeDto)
{
Type = contextTypeDto.ContextTypeKey;
}

public string Type { get; set; }


}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Fusion.Integration.Apps.Abstractions.Models;

namespace Equinor.ProjectExecutionPortal.WebApi.ViewModels.FusionApp;

public class ApiFusionApp
{
public ApiFusionApp()
{ }

public ApiFusionApp(App fusionApp)
{
AppKey = fusionApp.AppKey;
DisplayName = fusionApp.DisplayName;
Description = fusionApp.Description;
Type = fusionApp.Type;
IsPinned = fusionApp.IsPinned;
TemplateSource = fusionApp.TemplateSource;
Category = fusionApp.Category != null ? new ApiFusionAppCategory(fusionApp.Category) : null;
Build = fusionApp.Build != null ? new ApiFusionAppVersion(fusionApp.Build) : null;
}

public string AppKey { get; set; } = null!;
public string DisplayName { get; set; } = null!;
public string? Description { get; set; } = null!;
public string? Type { get; set; } = null!;
public string? Version { get; set; }
public bool? IsPinned { get; set; }
public string? TemplateSource { get; set; }
public ApiFusionAppCategory? Category { get; set; }
public ApiFusionAppVersion? Build { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Fusion.Integration.Apps.Abstractions.Models;

namespace Equinor.ProjectExecutionPortal.WebApi.ViewModels.FusionApp
{
public class ApiFusionAppCategory
{
public ApiFusionAppCategory()
{ }

public ApiFusionAppCategory(AppCategory fusionAppCategory)
{
Id = fusionAppCategory.Id;
Name = fusionAppCategory.Name;
DisplayName = fusionAppCategory.DisplayName;
Color = fusionAppCategory.Color;
DefaultIcon = fusionAppCategory.DefaultIcon;
SortOrder = fusionAppCategory.SortOrder;
}

public Guid Id { get; set; }
public string Name { get; set; } = null!;
public string DisplayName { get; set; } = null!;
public string Color { get; set; } = null!;
public string DefaultIcon { get; set; } = null!;
public short SortOrder { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using Fusion.Integration.Apps.Abstractions.Models;

namespace Equinor.ProjectExecutionPortal.WebApi.ViewModels.FusionApp
{
public class ApiFusionAppVersion
{
public ApiFusionAppVersion()
{ }

public ApiFusionAppVersion(AppVersion fusionAppVersion)
{
Version = fusionAppVersion.Version;
EntryPoint = fusionAppVersion.EntryPoint;
Tags = fusionAppVersion.Tags;
Tag = fusionAppVersion.Tag;
AssetPath = fusionAppVersion.AssetPath;
ConfigUrl = fusionAppVersion.ConfigUrl;
}

public string Version { get; set; } = null!;
public string EntryPoint { get; set; } = null!;
public List<string>? Tags { get; set; }
public string? Tag { get; set; }
public string? AssetPath { get; set; }
public string? ConfigUrl { get; set; }
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Equinor.ProjectExecutionPortal.Application.Queries.OnboardedApps;
using Equinor.ProjectExecutionPortal.WebApi.ViewModels.ContextType;
using Equinor.ProjectExecutionPortal.WebApi.ViewModels.FusionApp;

namespace Equinor.ProjectExecutionPortal.WebApi.ViewModels.OnboardedApp
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Equinor.ProjectExecutionPortal.Application.Queries.Portals;
using Equinor.ProjectExecutionPortal.WebApi.ViewModels.ContextType;
using Equinor.ProjectExecutionPortal.WebApi.ViewModels.OnboardedApp;
using Equinor.ProjectExecutionPortal.WebApi.ViewModels.FusionApp;

namespace Equinor.ProjectExecutionPortal.WebApi.ViewModels.PortalApp
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Equinor.ProjectExecutionPortal.Application.Queries.Portals;
using Equinor.ProjectExecutionPortal.WebApi.ViewModels.OnboardedApp;
using Equinor.ProjectExecutionPortal.WebApi.ViewModels.FusionApp;

namespace Equinor.ProjectExecutionPortal.WebApi.ViewModels.PortalApp
{
Expand Down

0 comments on commit 2092890

Please sign in to comment.