Giter Site home page Giter Site logo

nova-comments's People

Contributors

adammparker avatar brandonferens avatar centgart avatar chrillep avatar dependabot[bot] avatar eugenefvdm avatar pasxel 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

Watchers

 avatar  avatar  avatar

nova-comments's Issues

Error when comment without commentable_type

when comment is created by general form https://big.local/resources/comments/new
i get this error when calling index https://big.local/resources/comments

db looks like this: https://www.dropbox.com/s/xslhxw2h219994u/Screenshot%202020-07-26%2016.10.59.png?dl=0

error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'nova_comments.' in 'where clause' (SQL: select * from nova_comments where nova_comments. = 0 limit 1) {"userId":37,"exception":"[object] (Illuminate\\Database\\QueryException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'nova_comments.' in 'where clause' (SQL: select * from `nova_comments` where `nova_comments`. = 0 limit 1) at /Users/behrangalavi/PhpstormProjects/big-erp-laravel/doc_root/vendor/laravel/framework/src/Illuminate/Database/Connection.php:671)

feat req: use markdownfield for comments

Being able to use markdown would just add clarity / ability to create better comments

Textarea::make('comment')
->alwaysShow()
->hideFromIndex(),

 Markdown::make('comment') 
     ->alwaysShow() 
     ->hideFromIndex(), 

ref:

Markdown Field

The Markdown field provides a WYSIWYG Markdown editor for its underlying Eloquent attribute. Typically, this field will correspond to a TEXT column in your database. The Markdown field will store the raw Markdown text within the associated database column:

use Laravel\Nova\Fields\Markdown;

Markdown::make('Biography'),

By default, Markdown fields will not display their content when viewing a resource's detail page. Instead, the content will be hidden behind a "Show Content" link that will reveal the field's content when clicked. You may specify that the Markdown field should always display its content by calling the alwaysShow method on the field itself:

Markdown::make('Biography')->alwaysShow(),

The Markdown field uses the league/commonmark package to parse Markdown content. By default, it uses a parsing strategy similar to GitHub Flavoured Markdown, which does not allow certain HTML within the Markdown content. However, you can change the parsing strategy using the preset method. Currently, the following built-in presets are default, commonmark, and zero:

Markdown::make('Biography')->preset('commonmark'),

Using the preset method, you may register and use custom preset implementations:

use Illuminate\Support\Str;
use Laravel\Nova\Fields\Markdown;
use Laravel\Nova\Fields\Markdown\MarkdownPreset;

Markdown::make('Biography')->preset('github', new class implements MarkdownPreset {
    /**
     * Convert the given content from markdown to HTML.
     *
     * @param  string  $content
     * @return string
     */
    public function convert(string $content)
    {
        return Str::of($content)->markdown([
            'html_input' => 'strip',
        ]);
    }
}),

Link to commenter should follow nova path, but always goes to /nova

In the nova config you can set the path for nova itself:

`/*
|--------------------------------------------------------------------------
| Nova Path
|--------------------------------------------------------------------------
|
| This is the URI path where Nova will be accessible from. Feel free to
| change this path to anything you like. Note that this URI will not
| affect Nova's internal API routes which aren't exposed to users.
|
*/

'path' => '/',`

But this isn't taken into account for the following line of code, could this please be changed?

`commenterUrl() {
let commenterId = _.find(this.comment.fields, { attribute: 'commenter' }).belongsToId;

            return `/nova/resources/users/${commenterId}`;
        },`

Commenter doesn't work

The Commenter resource tool loads no comments with a 409 and 404s on submitting a new comment.

Loading makes a request to http://127.0.0.1:8000/nova-api/comments?page=1&orderBy=created_at&orderByDirection=desc&viaResource=issues&viaResourceId=4&viaRelationship=comments&relationshipType=hasMany and throws Symfony\Component\HttpKernel\Exception\HttpException at \vendor\laravel\framework\src\Illuminate\Foundation\Application.php:1116
https://flareapp.io/share/J7oj2odP?error=J7oj2odP&owner_token=Z9rRtT9iV2S0HkeKk60A6GngRV1udzCF#F60L1116

Submitting a new comment 404s on http://127.0.0.1:8000/nova-api/comments

I installed as follows:

composer require kirschbaum-development/nova-comments
php artisan migrate

use Commentable; in my model and new Commenter(), in the fields function of the Nova resource.

The CommentsPanel works, but it's not worth having this package just for that, especially as there's no image/attachment functionality.

Compatible with Nova 2.0.9 ? Composer error

I get a composer error when trying to install this with Nova (2.0.9):

`โœ— composer require kirschbaum-development/nova-comments
Using version ^1.0 for kirschbaum-development/nova-comments
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- kirschbaum-development/nova-comments 1.0.1 requires laravel/nova ^2.0 -> no matching package found.
- kirschbaum-development/nova-comments 1.0.0 requires laravel/nova ^2.0 -> no matching package found.
- Installation request for kirschbaum-development/nova-comments ^1.0 -> satisfiable by kirschbaum-development/nova-comments[1.0.0, 1.0.1].`

Support for Nova v4.x

Since this repository hasn't been updated since March 2020, and current version does not support Laravel Nova v4.x, I've forked the repo and made necessary changes.

Primary change: fixed Comment Resource to match the new Nova 4 signature with NovaRequest instead of Request
Description of the major changes from Nova 4: https://nova.laravel.com/docs/4.0/upgrade.html#nova-request

My fork of nova-comments with support for Nova 4: https://github.com/amukhin-cyberhull/nova-comments

displayInNavigation

Hi,
First, thans yo tou guys :)

I need to understand, why are you displaying comment ressource in sidebar navigation ?
If we can fast adding comments in other resources details, why is this useful in nav ?

Im in case where i need to remove comment resource from navigation sideba and i can't overide your comment nova resource. Or im i missing somethink ?

ReferenceError: _ is not defined

Added comments are not showing. I can see in browser console error ReferenceError: _ is not defined.
Package version: 4.0.0
Laravel: 9.31
Laravel Nova: 4.15.1

Looks like problem with lodash importing.

Steps for reproducing:

  1. composer require kirschbaum-development/nova-comments
  2. Run migration: php artisan migrate
  3. Adding use Commentable; to Model.
  4. Adding to Nova resource :
public function fields(Request $request)
    {
        return [
            // ...
            HasMany::make('Comments', 'comments', Comment::class)
                ->hideFromDetail()
                ->hideFromIndex(),
            Commenter::make(),
          //
          ];
  1. Go to Resource and add any comment.
  2. As a result, Comments block will be empty and browser console shows ReferenceError: _ is not defined

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.