Giter Club home page Giter Club logo

uiomatic's People

Contributors

benjaminc avatar designagencytom avatar dinc5150 avatar harvzor avatar huzzi avatar isramartinez avatar jeavon avatar marciogoularte avatar martijnverleg avatar mattbrailsford avatar patrickdemooij9 avatar pauldequant avatar plbonneville avatar rasmusfjord avatar skttl avatar timgeyssens avatar tomfulton avatar tomschimmel avatar vertigo093i avatar woodj5134 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uiomatic's Issues

Dropdown doesn't get filled with foreign key. GetAll throws 500 error

Hi Tim, great package !!!
I've been playing with it for a few days and everything worked fine until I tried to setup a property with a foreign key. Not even working with the Example Dog Property Editor. It just throws this error message

{"Message":"An error has occurred.",
"ExceptionMessage":"The 'ObjectContent`1' type failed to serialize the response body
for content type 'application/json; charset=utf-8'.","ExceptionType":
"System.InvalidOperationException","StackTrace":null,"InnerException":
{"Message":"An error has occurred.","ExceptionMessage":"Value cannot be null.\r\n
Parameter name: element","ExceptionType":"System.ArgumentNullException",
"StackTrace":" at System.Attribute.GetCustomAttributes(MemberInfo element,
Type type, Boolean inherit)\r\n at System.Attribute.GetCustomAttribute(MemberInfo
element,Type attributeType, Boolean inherit)\r\n at UIOMatic.Controllers
.PetaPocoObjectController.d__6.MoveNext()\r\n at Newtonsoft.Json
.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer,
IEnumerable values, JsonArrayContract contract, JsonProperty member,
JsonContainerContract collectionContract, JsonProperty containerProperty)\r\n
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter
jsonWriter, Object value, Type objectType)\r\n at Newtonsoft.Json.JsonSerializer.
SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)\r\n
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStream(Type type
, Object value, Stream writeStream, Encoding effectiveEncoding)\r\n
at System.Net.Http.Formatting.JsonMediaTypeFormatter.WriteToStream(Type type,
Object value, Stream writeStream, Encoding effectiveEncoding)\r\n
at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter.WriteToStreamAsync
(Type type, Object value, Stream writeStream, HttpContent content,
TransportContext transportContext, CancellationToken cancellationToken)\r\n---
End of stack trace from previous location where exception was thrown ---\r\n
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification
(Task task)\r\n at System.Web.Http.WebHost.HttpControllerHandler
.d__1b.MoveNext()"}}

Using Umb 7.3.4 and ui-o-matic 1.6.0
Any idea what the problem could be?
Best regards

Section not showing up

I installed UIOmatic in a clean web application and the section is not showing up in the back office. I added a class based on the documentation you provided

Can't submit an empty date/datetime value

An error occured

Error converting value {null} to type 'System.DateTime'. Path 'Birthday', line 1, position 23.

EXCEPTION DETAILS

Newtonsoft.Json.JsonSerializationException: Error converting value {null} to type 'System.DateTime'. Path 'Birthday', line 1, position 23.

Entity Framework?

Any plans on making this work with Entity Framework instead of PetaPoco?

Child loaded before parent is done loading data

The children controllers initialize before the parent controller is done loading the form's data.

You should add a broadcast event to your edit.controller.js:

uioMaticObjectResource.getById($routeParams.id.split("=")[1], $routeParams.id.split("?")[0]).then(function (response) {
                    $scope.object = response.data;

                    $scope.loaded = true;

                    setValues();

                    $scope.$broadcast('ValuesLoaded');
                });

Then add listeners in the dropdown.controller.js, pickers.content.controller.js, and pickers.media.controller.js controllers:

dropdown.controller.js

angular.module("umbraco").controller("UIOMatic.Views.Dropdown",
    function ($scope, uioMaticObjectResource) {
        //example config
        //"{'typeName':'Example.Models.Person, Example', 'valueColumn': 'Id', 'textColumn'='FirstName'}"

        function init() {
            uioMaticObjectResource.getAll($scope.property.Config.typeName, $scope.property.Config.textColumn, "asc").then(function (response) {
                $scope.objects = response.data;
            });
        }

        init();

        $scope.$on('ValuesLoaded', function (event, data) {
            init();
        });
    });

pickers.content.controller.js

angular.module("umbraco").controller("UIOMatic.Views.Pickers.ContentController",
    function ($scope, $routeParams, $http, dialogService, entityResource, iconHelper) {

        function init() {
            if (!$scope.setting) {
                $scope.setting = {};
            }

            var val = parseInt($scope.property.Value);

            if (!isNaN(val) && angular.isNumber(val)) {
                $scope.showQuery = false;

                entityResource.getById(val, "Document").then(function (item) {
                    item.icon = iconHelper.convertFromLegacyIcon(item.icon);
                    $scope.node = item;
                });
            }

            $scope.openContentPicker = function () {
                var d = dialogService.treePicker({
                    section: "content",
                    treeAlias: "content",
                    multiPicker: false,
                    callback: populate
                });
            };

            $scope.clear = function () {
                $scope.id = undefined;
                $scope.node = undefined;
                $scope.property.Value = undefined;
            };

            function populate(item) {
                $scope.clear();
                item.icon = iconHelper.convertFromLegacyIcon(item.icon);
                $scope.node = item;
                $scope.id = item.id;
                $scope.property.Value = item.id;
            }
        };

        init();

        $scope.$on('ValuesLoaded', function (event, data) {
            init();
        });
    });

pickers.media.controller.js

angular.module("umbraco").controller("UIOMatic.Views.Pickers.MediaController",
    function ($scope, $routeParams, dialogService, entityResource, iconHelper) {

        function init() {

            if (!$scope.setting) {
                $scope.setting = {};
            }

            var val = parseInt($scope.property.Value);

            if (!isNaN(val) && angular.isNumber(val)) {
                $scope.showQuery = false;

                entityResource.getById(val, "Media").then(function (item) {
                    item.icon = iconHelper.convertFromLegacyIcon(item.icon);
                    $scope.node = item;
                });
            }

            $scope.openMediaPicker = function () {
                var d = dialogService.treePicker({
                    section: "media",
                    treeAlias: "media",
                    multiPicker: false,
                    callback: populate
                });
            };


            $scope.clear = function () {
                $scope.id = undefined;
                $scope.node = undefined;
                $scope.property.Value = undefined;
            };

            function populate(item) {
                $scope.clear();
                item.icon = iconHelper.convertFromLegacyIcon(item.icon);
                $scope.node = item;
                $scope.id = item.id;
                $scope.property.Value = item.id;
            }
        };

        init();

        $scope.$on('ValuesLoaded', function (event, data) {
            init();
        });

    });

Introduce a Core package

Hi Tim,

We have a specific solution structure at our company, this requires us to define the Models in a seperate Data/Models project. We'd like to use the UIOMatic inside our Umbraco project but when including the UIOMatic package the entire UmbracoCms package is installed, this is not desired.

What do you think of the introducing an UIOMatic.Core project (which only requires UmbracoCms.Core), I've already created some commits https://github.com/ThumNet/UIOMatic/commit/cc7f0531aaad23321a98329ee504a20cbba2de65 and https://github.com/ThumNet/UIOMatic/commit/286981759ef2c96cc05b724d13e2a763ee24ce5f with the suggested change :)

I'm interested in your thoughts on the matter!

Regards,
Jeffrey

Ignored fields still being queried.

I have a model which looks something like:

public class Products : IUIOMaticModel
{
    [UIOMaticIgnoreField]
    [UIOMaticIgnoreFromListView]
    [PrimaryKeyColumn(AutoIncrement = true)]
    public string Id { get; set;}

    [UIOMaticField("Product name", "The name of the product.")]
    public string Name { get; set; }

    [UIOMaticIgnoreFromListView]
    [UIOMaticIgnoreField]
    public int ImagesId { get; set; }

    [UIOMaticIgnoreFromListView]
    [UIOMaticIgnoreField]
    [Ignore]
    public IEnumerable<Image> Images { get; set; }
}

When I run a search for the name of the product in the backoffice of UIOMatic, the following error occurs:

{"Message":"An error has occurred.","ExceptionMessage":"Invalid column name 'Images '.","ExceptionType":"System.Data.SqlClient.SqlException","StackTrace":"   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)\r\n   at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()\r\n   at System.Data.SqlClient.SqlDataReader.get_MetaData()\r\n   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)\r\n   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)\r\n   at System.Data.SqlClient.SqlCommand.ExecuteScalar()\r\n   at StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteScalar() in c:\\Code\\github\\SamSaffron\\MiniProfiler\\StackExchange.Profiling\\Data\\ProfiledDbCommand.cs:line 299\r\n   at Umbraco.Core.Persistence.PetaPocoCommandExtensions.<>c__DisplayClassa.<ExecuteScalarWithRetry>b__9()\r\n   at Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)\r\n   at Umbraco.Core.Persistence.Database.ExecuteScalar[T](String sql, Object[] args)\r\n   at Umbraco.Core.Persistence.Database.Page[T](Int64 page, Int64 itemsPerPage, String sql, Object[] args)\r\n   at Umbraco.Core.Persistence.Database.Page[T](Int64 page, Int64 itemsPerPage, Sql sql)\r\n   at UIOMatic.Controllers.PetaPocoObjectController.GetPaged(String typeName, Int32 itemsPerPage, Int32 pageNumber, String sortColumn, String sortOrder, String searchTerm)\r\n   at UIOMatic.Controllers.ObjectController.GetPaged(String typeName, Int32 itemsPerPage, Int32 pageNumber, String sortColumn, String sortOrder, String searchTerm)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"}

It appears that the Images column is being searched. This property does not exist in the Products table (as the model property is decorated with [Ignore], and is used to assign rows from another database table which has information about images in it. I think this is why the search is erroring.

When UIOMatic creates the SQL statement, does it take into account the ignore attribute?

The ignore attribute I am using comes from the Umbraco.Core.Persistence.IgnoreAttribute.

I am using version 1.7.0 of UIOmatic, and 7.4.1 Umbraco.

Blob support

I played with the very first UIOMatic and now starting to pick where I left after the 2.0 goodness.

In a test db, i have two tables where image is stored in base64 encoded in tableA and byte[](no need for encoding) in another (tableB).

My question is how can I render the image in the ListView for base64 or byte[] for the View section?
Like when user click Tree item A, they see the listview with base64 image, Tree item B click listview shows blob/byte[] image.

I'm picking this up slowly so go easy on me;

[UIOMaticField(Name = "Picture", Description = "Select a picture", View = "file")]
[UIOMaticListViewField(Name = "Picture", View = "image")]
public string Picture { get; set; }
...

V2 Docs need updating

Since there are quite a few differences that need to be documented and of course all the new bits

File picker not working with new install Umbraco 7.4.2

Hi Tim,

I found an issue with the file (media) picker, when using a fresh Umbraco 7.4.2 site.

issue

Steps to reproduce:

  1. Create a new empty Web project
  2. Install-Package UmbracoCms
  3. Install-Package Nibble.Umbraco.UIOMatic
  4. Create the sample People table and Person model
  5. Go to the backoffice and try selecting an image for a person

Research:
I've also forked your solution and upgraded the UmbracoCms package to 7.4.2 and then the issue doesn't occur. After some digging I found that in the Umbraco site another editor is configured, which returns a different value (an object instead of a string).

Fresh install:
editor-imagecropper

Your project upgraded:
editor-uploadfield

Suggested fix:
One solution would be using the image property of the item (which works both cases), but I don't know for sure if this is the best approach
other-property

Commit

Convert template fields to use angular syntax

There are places we ask people to provide a template for a label which is usually in the format

Field1 + " " + Field2

We should change it to support angular syntax

{{Field1}} {{Field2}}

Media Picker on People throws 401

When clicking on the picker to select an image for a poeple object the media picker throws a 401 exception and redirect to login page.

User is still logged in to backoffice.

DateTime picker with time

the date time picker with time, when displaying existing value is displaying incorrect time.

EG
Database record: "2016-08-17 06:00:00.000"
displaying in editor as "2016-08-17 16:00:00"

image

Format in listview

Would be nice to decorate the field attribute with a ex Format="dd-MM-yyyy" to format the columns in the listview. This could of course also be used for numbers etc.

Introduce a provider model for list actions

Just an idea, but a way to have other actions then just delete available in the list view (and folks can plug and play custom ones by just working with a provider model)

Display date in Edit view

When editing a date it displays itself as datetime. When new date is selected it works as expected.
Great package !

Scaffolding date/datetime properties

Seems these get a min date value but then can't save object with those values

An error occured

Could not convert string to DateTime: 0000-12-31 22:00:00. Path 'Birthday', line 1, position 40.

EXCEPTION DETAILS

Newtonsoft.Json.JsonReaderException: Could not convert string to DateTime: 0000-12-31 22:00:00. Path 'Birthday', line 1, position 40.

Replace static "Object List" and "Object Creator" with names of objects?

Hey Tim! Just an idea - when creating or editing an object, some static text is shown in the header:

image

image

I think it might be nice for editors to see the name of the object type they're working with, like so:

image

image

I'm not sure the best way to do this though. There is a name defined in the UIOMaticAttribute, but it's plural. Not sure if it makes sense to work with that, or add another property, for the object name or header text?

I also wonder if it makes sense to think about making the header a textbox with the name of the object, like Umbraco's edit screen does. Ex:
image

UiOMatic not showing up in the backoffice

Hi Tim,

I installed the nuget package but unfortunately it is not showing up in the backoffice. Not getting any console errors or tracelog errors. We are using UaaS, but this current issue happens on my local version (cloned from UaaS). The current Umbraco version is 7.4.3. Also want to note that I have the Umbraco website in one project, and all of the models/controllers/etc. in another project (using strongly typed views). That other project only had the Umbraco core binaries, but the nuget dependencies downloaded Umbraco CMS 7.4.1 (which I then upgraded to 7.4.3).

Any ideas what might be happening here, or what else I can try?

Best,
Ryan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.