Skip to content

Commit

Permalink
sequential row (index) plugin (#384)
Browse files Browse the repository at this point in the history
* add basic idea

* add debug info

* Thai language translation (#378)

* partial translation of thai localization

* fully thai translation

* Update Module.php

* fix sorting, add sorting relation hint.

* concept for beforeListFind callable (#382)

* concept for beforeListFind callable

* add test

* add changelog

* Update CHANGELOG.md

* fix issue with after find values (#388)

* fix issue with after find values

* add changelog, test and className update

* not found error

* prepare for release

* Update BaseFileSystemStorageTest.php (#390)

Replaced / to DIRECTORY_SEPARATOR for passing tests on Windows

* skip if pool identifier does not exists. (#392)

* skip if pool identifier does not exists.

* add changelog and since

* fix test

* add where condition

* handle plugin objects within i18n fallback value (#398)

* handle plugin objects within i18n fallback value

* add since, update changelog

* newline...

* run in seperate process

* fix test

* add whiteliste (#402)

* add whiteliste

* update code

* add unit test

* add audience and issuer properties

* Use ngRestFind() instead (#403)

* Use ngRestFind() insstead

* add changelog

* New Tag Delete Active Window (#399)

* add test and basic concept

* add hint and form

* run in seperate

* fix test

* add success delete teste

* add error test

* attach window to model

* add delete

* improve ui view

* tests

* add translations

* Update admin.php (#405)

* Update admin.php

* Update admin.php

* Update admin.php

* add missing translations

* add opcache reset

* Use ngRestFind() for API delete action. (#406)

* ngrest find and delete

* add not found exception test

* ngrest raw input/output plugin (#407)

* add raw plugin

* add changelog and "test"

* add update to "test"

* add bootstrap tests

* remove redundant execution of queue jobs (#396)

* remove redundant execution of queue jobs (there is another in bootstrap yet)

* run queue job in bootstrap for non admin context too

* add changelog

* use model as fixture

* prepare for release

* espace aws delete hint message

* escape translation word

* Bootstrap Queue CLI Commands (#410)

* bootstrap cli command

* fix admin queue name

* use luya bootstrap method

* lock file with latest version

* Update CHANGELOG.md

* lock file

* add default option for retryable jobs

* update error message in queue log

* use error in exec event

* ensure error exists

* Disable Queue (#413)

* Update Module.php

* add changelog and fix

* Travis with php 7.4 (#416)

* Block Preview styling

* Tooltip preview fix #246

* Date plugin with custom format

* Changelog for #270

* Refactored namespace using

* Connection lost handling

* Unit test fixed close #229

* CONNECTION_ID only available in mysql

* Block Preview styling

* Tooltip preview fix #246

* travis tests with php 7.4

* clean up dist

* user friendly exception (#412)

* user friendly exception

* improve message

* add test

* change cache behavior

* Update Module.php

* fix issue with title length when large error messages appear

* use luya select for ngrest filters (#419)

* use luya select for ngrest filters

* add syntax error test

* changelog

* fix changelog

* ensure group value is rendered trough plugins (#420)

* ensure group value is rendered trough plugins

* add changelog

* lazy load certain methods (#422)

* lazy load certain methods

* add tests

* add test

* add tests

* remove unused code

* check for scalar (#423)

* check for scalar

* add test

* phpdoc

* this closes #415

* prepare for release

* typos

* active buttons fix (#424)

* active buttons fix

* Update CHANGELOG.md

* Update ConfigTest.php

* Update ConfigTest.php

* echarts update closes #428

* fix bug with color plugin, closes #426

* remove deprecated function can #429

* remove deprecated method test

* add readonly option (#430)

* add readonly option

* add test

* add missing changelog

* add docs and grouped index

* add changelog
  • Loading branch information
nadar authored Dec 19, 2019
1 parent 986c8f5 commit 00f23ae
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ In order to read more about upgrading and BC breaks have a look at the [UPGRADE

### Added

+[#264](https://github.com/luyadev/luya-module-admin/issues/264) Added new `readonly` option to NgRest Plugins which will render the list value in update scope.
+ [#380](https://github.com/luyadev/luya-module-admin/issues/380) New `index` ngrest plugins in order to generate a sequential row numbering in list views.
+ [#264](https://github.com/luyadev/luya-module-admin/issues/264) Added new `readonly` option to NgRest Plugins which will render the list value in update scope.

### Fixed

Expand Down
42 changes: 42 additions & 0 deletions src/ngrest/plugins/Index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace luya\admin\ngrest\plugins;

/**
* Generate a Sequential Number for each Row.
*
* In order to use the Index plugin it might be recommend to attach the attribute to a root attribute, as no value needs
* to be bound to the attribute:
*
* ```php
* public function ngRestExtraAttributeTypes()
* {
* return [
* 'id.index' => ['index'],
* ];
* }
* ```
*
* NgRestScope list config:
*
* ```php
* [['list'], ['id.index']],
* ```
*
* @author Basil Suter <basil@nadar.io>
* @since 3.0.0
*/
class Index extends Angular
{
/**
* @var string If {{config.groupBy}} is enabled, use the internal index, otherwise multiple with current page.
*/
public $template = '
<span ng-show="config.groupBy">
{{ $index + 1}}
</span>
<span ng-show="!config.groupBy">
{{1+((pager.currentPage-1) * pager.perPage)+$index}}
</div>
';
}

0 comments on commit 00f23ae

Please sign in to comment.