Skip to content

Commit 69c255c

Browse files
committed
Add constants class
1 parent 42b14a5 commit 69c255c

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

src/Our.Umbraco.GraphQL/Constants.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace Our.Umbraco.GraphQL
2+
{
3+
public class Constants
4+
{
5+
public const string ProductName = "Our.Umbraco.GraphQL";
6+
}
7+
}

src/Our.Umbraco.GraphQL/Events/MigrationEventHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class MigrationEventHandler : ApplicationEventHandler
2020
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
2121
{
2222
// Update the version number as we deploy new DB changes to run any new Migrations
23-
ApplyMigrations(applicationContext, "GraphQL", new SemVersion(1, 0, 0));
23+
ApplyMigrations(applicationContext, Constants.ProductName, new SemVersion(0, 1, 0));
2424
}
2525

2626
private void ApplyMigrations(ApplicationContext applicationContext, string productName, SemVersion targetVersion)

src/Our.Umbraco.GraphQL/Migrations/CreateInitialTables.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace Our.Umbraco.GraphQL.Migrations
1111
{
12-
[Migration("1.0.0", 1, "GraphQL")]
12+
[Migration("0.1.0", 1, Constants.ProductName)]
1313
public class CreateInitialTables : MigrationBase
1414
{
1515
public const string accountsTableName = "Accounts";

src/Our.Umbraco.GraphQL/Types/ComplexGraphTypeOfIPublishedContentExtensions.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
using GraphQL;
22
using GraphQL.Types;
33
using Our.Umbraco.GraphQL.ValueResolvers;
4-
using Umbraco.Core;
54
using Umbraco.Core.Models;
65
using Umbraco.Core.Models.PublishedContent;
7-
using Umbraco.Web;
86

97
namespace Our.Umbraco.GraphQL.Types
108
{
@@ -20,8 +18,8 @@ public static ComplexGraphType<IPublishedContent> AddUmbracoContentPropeties(
2018
foreach (var property in contentType.CompositionPropertyTypes)
2119
{
2220
//TODO: black/whitelist properties
23-
if (property.PropertyEditorAlias == Constants.PropertyEditors.ListViewAlias ||
24-
property.PropertyEditorAlias == Constants.PropertyEditors.FolderBrowserAlias ||
21+
if (property.PropertyEditorAlias == global::Umbraco.Core.Constants.PropertyEditors.ListViewAlias ||
22+
property.PropertyEditorAlias == global::Umbraco.Core.Constants.PropertyEditors.FolderBrowserAlias ||
2523
property.Alias.StartsWith("umbracoMember"))
2624
{
2725
continue;

src/Our.Umbraco.GraphQL/ValueResolvers/GridValueResolver.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using Our.Umbraco.GraphQL.Types;
3-
using Umbraco.Core;
43
using Umbraco.Core.Models.PublishedContent;
54

65
namespace Our.Umbraco.GraphQL.ValueResolvers
@@ -14,7 +13,7 @@ public override Type GetGraphQLType(PublishedPropertyType propertyType)
1413

1514
public override bool IsConverter(PublishedPropertyType propertyType)
1615
{
17-
return propertyType.PropertyEditorAlias == Constants.PropertyEditors.GridAlias;
16+
return propertyType.PropertyEditorAlias == global::Umbraco.Core.Constants.PropertyEditors.GridAlias;
1817
}
1918
}
2019
}

0 commit comments

Comments
 (0)