Git Product home page Git Product logo

nova-indicator-field's People

Contributors

kitbs 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  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

nova-indicator-field's Issues

Works with INT field values?

I have a integer field in the database that indicate the status, and only see a blank field in the nova resource.

I used as:

Indicator::make('status')
                ->labels(
                    [
                        '0'   => 'Pendiente',
                        '1'   => 'En proceso',
                        '2'   => 'Completa',
                        '3'   => 'Cerrada',
                        '4'   => 'Vencida',
                        '100' => 'Eliminada',
                        '101' => 'Sin Proveedores',
                    ]
                ),

Also I try:

Indicator::make('status')
                ->labels(
                    [
                        0   => 'Pendiente',
                        1   => 'En proceso',
                        2   => 'Completa',
                        3   => 'Cerrada',
                        4   => 'Vencida',
                        100 => 'Eliminada',
                        101 => 'Sin Proveedores',
                    ]
                ),

and only get this:
image

Add custom colors

How to i can add custom colors?

Indicator::make('Status')
    ->colors([
        'banned' => '#a466bd',
        'active' => '#a2c617',
        'invited' => '#e92919',
        'inactive' => '#000000',
    ])

Doesn’t work with model accessors

I’ve a table with a renewal date field (timestamp) and what to show a status. If the renewal date field has expired then I want to display fact. Here’s my code - but it just shows a dash and no label on the index view.

// Model

public function membershipStatusAttribute() {
	if ($this->renewal_date < now()) {
		return 'expired';
	} else {
		return 'valid';
	}
}

// Nova resource

Indicator::make('membership_status')
	->labels([
		'expired' => 'Expired',
		'valid' => 'Valid',
	])->colors([
		'expired' => 'red',
		'valid' => 'green',
	]),

nova version 4?

Is this very helpful package abandoned??
nova 4.2.3
laravel 8

Use for Boolean Fields

Hi all

The Indicator Field seems not work for a boolean field, as I guess it's not it's intended behaviour. However, it would be great if this would work with boolean fields, too, as I think boolean fields in Nova lack of options to customize.

I can make it work with boolean with a computed field:

Indicator::make('Some Bool', function () {
    return (int) $this->someBool;
})->labels([
    0 => 'inactive'
    1 => 'active'
])

but this takes away "sortable". Is there a better place to cast the boolean?

Cannot read property 'hasOwnProperty' of undefined

Default Text or Select field working but not Indicator

Text::make('Status')
Indicator::make('Status')
  ->labels([
    'a' => 'Active',
]),

Same error even doing:

Indicator::make('Status')->withoutLabels()

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.