Compare commits
31 Commits
Author | SHA1 | Date |
---|---|---|
Guy Sartorelli | d851ce562c | |
Steve Boyd | 018ab87515 | |
Guy Sartorelli | d34c92dba7 | |
Guy Sartorelli | c84d8afa7a | |
Tom Oude Rengerink | 78fa8ba747 | |
Guy Sartorelli | 62734535a0 | |
Guy Sartorelli | 5ed8c95fda | |
Guy Sartorelli | 377dc1ef93 | |
Robin | 1637e78ea1 | |
Guy Sartorelli | 9c70b0175b | |
Loz Calver | e7d7178719 | |
Guy Sartorelli | 1e5a1e8056 | |
Guy Sartorelli | 47171ee4c2 | |
Sabina Talipova | a2ea473369 | |
Steve Boyd | 829cacff0b | |
Guy Sartorelli | 1284046e10 | |
Steve Boyd | 665d23170b | |
Steve Boyd | f2adec35d3 | |
Sabina Talipova | 504b3bd822 | |
Steve Boyd | 89a7301b67 | |
Guy Sartorelli | 6d46483e32 | |
Guy Sartorelli | bb6c0396f1 | |
Guy Sartorelli | bd783a4a24 | |
Steve Boyd | 17f92d08ba | |
Maxime Rainville | 49a607d747 | |
Steve Boyd | 5566b05c9d | |
Guy Sartorelli | b0addcb5bd | |
Maxime Rainville | d5d438c5cc | |
josephlewisnz | 2928504b3c | |
josephlewisnz | 8e77095de0 | |
josephlewisnz | 07c97e45b2 |
|
@ -0,0 +1 @@
|
|||
<!-- Blank templates are for use by maintainers only! If you aren't a maintainer, please go back and pick one of the issue templates. -->
|
|
@ -0,0 +1,72 @@
|
|||
name: 🪳 Bug Report
|
||||
description: Tell us if something isn't working the way it's supposed to
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
We strongly encourage you to [submit a pull request](https://docs.silverstripe.org/en/contributing/code/) which fixes the issue.
|
||||
Bug reports which are accompanied with a pull request are a lot more likely to be resolved quickly.
|
||||
- type: input
|
||||
id: affected-versions
|
||||
attributes:
|
||||
label: Module version(s) affected
|
||||
description: |
|
||||
What version of _this module_ have you reproduced this bug on?
|
||||
Run `composer info` to see the specific version of each module installed in your project.
|
||||
If you don't have access to that, check inside the help menu in the bottom left of the CMS.
|
||||
placeholder: x.y.z
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: A clear and concise description of the problem
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: how-to-reproduce
|
||||
attributes:
|
||||
label: How to reproduce
|
||||
description: |
|
||||
⚠️ This is the most important part of the report ⚠️
|
||||
Without a way to easily reproduce your issue, there is little chance we will be able to help you and work on a fix.
|
||||
- Please, take the time to show us some code and/or configuration that is needed for others to reproduce the problem easily.
|
||||
- If the bug is too complex to reproduce with some short code samples, please reproduce it in a public repository and provide a link to the repository along with steps for setting up and reproducing the bug using that repository.
|
||||
- If part of the bug includes an error or exception, please provide a full stack trace.
|
||||
- If any user interaction is required to reproduce the bug, please add an ordered list of steps that are required to reproduce it.
|
||||
- Be as clear as you can, but don't miss any steps out. Simply saying "create a page" is less useful than guiding us through the steps you're taking to create a page, for example.
|
||||
placeholder: |
|
||||
|
||||
#### Code sample
|
||||
```php
|
||||
|
||||
```
|
||||
|
||||
#### Reproduction steps
|
||||
1.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: possible-solution
|
||||
attributes:
|
||||
label: Possible Solution
|
||||
description: |
|
||||
*Optional: only if you have suggestions on a fix/reason for the bug*
|
||||
Please consider [submitting a pull request](https://docs.silverstripe.org/en/contributing/code/) with your solution! It helps get faster feedback and greatly increases the chance of the bug being fixed.
|
||||
- type: textarea
|
||||
id: additional-context
|
||||
attributes:
|
||||
label: Additional Context
|
||||
description: "*Optional: any other context about the problem: log messages, screenshots, etc.*"
|
||||
- type: checkboxes
|
||||
id: validations
|
||||
attributes:
|
||||
label: Validations
|
||||
description: "Before submitting the issue, please make sure you do the following:"
|
||||
options:
|
||||
- label: Check that there isn't already an issue that reports the same bug
|
||||
required: true
|
||||
- label: Double check that your reproduction steps work in a fresh installation of [`silverstripe/installer`](https://github.com/silverstripe/silverstripe-installer) (with any code examples you've provided)
|
||||
required: true
|
|
@ -0,0 +1,35 @@
|
|||
name: 🚀 Feature Request
|
||||
description: Submit a feature request (but only if you're planning on implementing it)
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Please only submit feature requests if you plan on implementing the feature yourself.
|
||||
See the [contributing code documentation](https://docs.silverstripe.org/en/contributing/code/#make-or-find-a-github-issue) for more guidelines about submitting feature requests.
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Description
|
||||
description: A clear and concise description of the new feature, and why it belongs in core
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
id: more-info
|
||||
attributes:
|
||||
label: Additional context or points of discussion
|
||||
description: |
|
||||
*Optional: Any additional context, points of discussion, etc that might help validate and refine your idea*
|
||||
- type: checkboxes
|
||||
id: validations
|
||||
attributes:
|
||||
label: Validations
|
||||
description: "Before submitting the issue, please confirm the following:"
|
||||
options:
|
||||
- label: You intend to implement the feature yourself
|
||||
required: true
|
||||
- label: You have read the [contributing guide](https://docs.silverstripe.org/en/contributing/code/)
|
||||
required: true
|
||||
- label: You strongly believe this feature should be in core, rather than being its own community module
|
||||
required: true
|
||||
- label: You have checked for existing issues or pull requests related to this feature (and didn't find any)
|
||||
required: true
|
|
@ -0,0 +1,8 @@
|
|||
blank_issues_enabled: true
|
||||
contact_links:
|
||||
- name: Security Vulnerability
|
||||
url: https://docs.silverstripe.org/en/contributing/issues_and_bugs/#reporting-security-issues
|
||||
about: ⚠️ We do not use GitHub issues to track security vulnerability reports. Click "open" on the right to see how to report security vulnerabilities.
|
||||
- name: Support Question
|
||||
url: https://www.silverstripe.org/community/
|
||||
about: We use GitHub issues only to discuss bugs and new features. For support questions, please use one of the support options available in our community channels.
|
|
@ -0,0 +1,39 @@
|
|||
<!--
|
||||
Thanks for contributing, you're awesome! ⭐
|
||||
|
||||
Please read https://docs.silverstripe.org/en/contributing/code/ if you haven't contributed to this project recently.
|
||||
-->
|
||||
## Description
|
||||
<!--
|
||||
Please describe expected and observed behaviour, and what you're fixing.
|
||||
For visual fixes, please include tested browsers and screenshots.
|
||||
-->
|
||||
|
||||
## Manual testing steps
|
||||
<!--
|
||||
Include any manual testing steps here which a reviewer can perform to validate your pull request works correctly.
|
||||
Note that this DOES NOT replace unit or end-to-end tests.
|
||||
-->
|
||||
|
||||
## Issues
|
||||
<!--
|
||||
List all issues here that this pull request fixes/resolves.
|
||||
If there is no issue already, create a new one! You must link your pull request to at least one issue.
|
||||
-->
|
||||
- #
|
||||
|
||||
## Pull request checklist
|
||||
<!--
|
||||
PLEASE check each of these to ensure you have done everything you need to do!
|
||||
If there's something in this list you need help with, please ask so that we can assist you.
|
||||
-->
|
||||
- [ ] The target branch is correct
|
||||
- See [picking the right version](https://docs.silverstripe.org/en/contributing/code/#picking-the-right-version)
|
||||
- [ ] All commits are relevant to the purpose of the PR (e.g. no debug statements, unrelated refactoring, or arbitrary linting)
|
||||
- Small amounts of additional linting are usually okay, but if it makes it hard to concentrate on the relevant changes, ask for the unrelated changes to be reverted, and submitted as a separate PR.
|
||||
- [ ] The commit messages follow our [commit message guidelines](https://docs.silverstripe.org/en/contributing/code/#commit-messages)
|
||||
- [ ] The PR follows our [contribution guidelines](https://docs.silverstripe.org/en/contributing/code/)
|
||||
- [ ] Code changes follow our [coding conventions](https://docs.silverstripe.org/en/contributing/coding_conventions/)
|
||||
- [ ] This change is covered with tests (or tests aren't necessary for this change)
|
||||
- [ ] Any relevant User Help/Developer documentation is updated; for impactful changes, information is added to the changelog for the intended release
|
||||
- [ ] CI is green
|
|
@ -4,13 +4,8 @@ on:
|
|||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
# Every Sunday at 12:10pm UTC
|
||||
schedule:
|
||||
- cron: '10 12 * * 0'
|
||||
|
||||
jobs:
|
||||
ci:
|
||||
name: CI
|
||||
# Only run cron on the symbiote account
|
||||
if: (github.event_name == 'schedule' && github.repository_owner == 'symbiote') || (github.event_name != 'schedule')
|
||||
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
name: Dispatch CI
|
||||
|
||||
on:
|
||||
# At 8:40 PM UTC, only on Sunday and Monday
|
||||
schedule:
|
||||
- cron: '40 20 * * 0,1'
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
dispatch-ci:
|
||||
name: Dispatch CI
|
||||
# Only run cron on the symbiote account
|
||||
if: (github.event_name == 'schedule' && github.repository_owner == 'symbiote') || (github.event_name != 'schedule')
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
steps:
|
||||
- name: Dispatch CI
|
||||
uses: silverstripe/gha-dispatch-ci@v1
|
|
@ -0,0 +1,22 @@
|
|||
name: Merge-up
|
||||
|
||||
on:
|
||||
# At 8:40 PM UTC, only on Thursday
|
||||
schedule:
|
||||
- cron: '40 20 * * 4'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: {}
|
||||
|
||||
jobs:
|
||||
merge-up:
|
||||
name: Merge-up
|
||||
# Only run cron on the symbiote account
|
||||
if: (github.event_name == 'schedule' && github.repository_owner == 'symbiote') || (github.event_name != 'schedule')
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
steps:
|
||||
- name: Merge-up
|
||||
uses: silverstripe/gha-merge-up@v1
|
|
@ -0,0 +1,15 @@
|
|||
[main]
|
||||
host = https://www.transifex.com
|
||||
|
||||
[o:silverstripe:p:silverstripe-gridfieldextensions:r:master]
|
||||
file_filter = lang/<lang>.yml
|
||||
source_file = lang/en.yml
|
||||
source_lang = en
|
||||
type = YML
|
||||
|
||||
[o:silverstripe:p:silverstripe-gridfieldextensions:r:master-js]
|
||||
file_filter = client/lang/src/<lang>.json
|
||||
source_file = client/lang/src/en.json
|
||||
source_lang = en
|
||||
type = KEYVALUEJSON
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
// This file was generated by silverstripe/tx-translator from client/lang/src/en.json.
|
||||
// See https://github.com/silverstripe/silverstripe-tx-translator for details
|
||||
if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') {
|
||||
if (typeof(console) !== 'undefined') { // eslint-disable-line no-console
|
||||
console.error('Class ss.i18n not defined'); // eslint-disable-line no-console
|
||||
}
|
||||
} else {
|
||||
ss.i18n.addDictionary('en', {
|
||||
"GridFieldExtensions.ADD_CLASS": "Add: <i>{classname}</i>",
|
||||
"GridFieldExtensions.CONFIRMDEL": "Are you sure you want to delete this?",
|
||||
"GridFieldExtensions.OPEN_SEARCH_FILTER": "Open search and filter",
|
||||
"GridFieldExtensions.SAVE_PUBLISH": "Save & publish"
|
||||
});
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
// This file was generated by silverstripe/tx-translator from client/lang/src/eo.json.
|
||||
// See https://github.com/silverstripe/silverstripe-tx-translator for details
|
||||
if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') {
|
||||
if (typeof(console) !== 'undefined') { // eslint-disable-line no-console
|
||||
console.error('Class ss.i18n not defined'); // eslint-disable-line no-console
|
||||
}
|
||||
} else {
|
||||
ss.i18n.addDictionary('eo', {
|
||||
"GridFieldExtensions.ADD_CLASS": "Aldoni: <i>{classname}</i>",
|
||||
"GridFieldExtensions.CONFIRMDEL": "Ĉu vi certas ke vi volas forigi tion?",
|
||||
"GridFieldExtensions.OPEN_SEARCH_FILTER": "Malfermi serĉon kaj filtrilon",
|
||||
"GridFieldExtensions.SAVE_PUBLISH": "Konservi kaj publikigi"
|
||||
});
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
// This file was generated by silverstripe/tx-translator from client/lang/src/nl_NL.json.
|
||||
// See https://github.com/silverstripe/silverstripe-tx-translator for details
|
||||
if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') {
|
||||
if (typeof(console) !== 'undefined') { // eslint-disable-line no-console
|
||||
console.error('Class ss.i18n not defined'); // eslint-disable-line no-console
|
||||
}
|
||||
} else {
|
||||
ss.i18n.addDictionary('nl_NL', {
|
||||
"GridFieldExtensions.ADD_CLASS": "Toevoegen: <i>{classname}</i>",
|
||||
"GridFieldExtensions.CONFIRMDEL": "Weet je zeker dat je dit wil verwijderen?",
|
||||
"GridFieldExtensions.OPEN_SEARCH_FILTER": "Open zoeken en filteren",
|
||||
"GridFieldExtensions.SAVE_PUBLISH": "Opslaan & Publiceren"
|
||||
});
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
// This file was generated by silverstripe/tx-translator from client/lang/src/sk.json.
|
||||
// See https://github.com/silverstripe/silverstripe-tx-translator for details
|
||||
if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') {
|
||||
if (typeof(console) !== 'undefined') { // eslint-disable-line no-console
|
||||
console.error('Class ss.i18n not defined'); // eslint-disable-line no-console
|
||||
}
|
||||
} else {
|
||||
ss.i18n.addDictionary('sk', {
|
||||
"GridFieldExtensions.ADD_CLASS": "Pridať: <i>{classname}</i>",
|
||||
"GridFieldExtensions.CONFIRMDEL": "Naozaj to chcete odstrániť?",
|
||||
"GridFieldExtensions.OPEN_SEARCH_FILTER": "Otvorte vyhľadávanie a filter",
|
||||
"GridFieldExtensions.SAVE_PUBLISH": "Uložiť a zverejniť"
|
||||
});
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
// This file was generated by silverstripe/tx-translator from client/lang/src/sl.json.
|
||||
// See https://github.com/silverstripe/silverstripe-tx-translator for details
|
||||
if (typeof(ss) === 'undefined' || typeof(ss.i18n) === 'undefined') {
|
||||
if (typeof(console) !== 'undefined') { // eslint-disable-line no-console
|
||||
console.error('Class ss.i18n not defined'); // eslint-disable-line no-console
|
||||
}
|
||||
} else {
|
||||
ss.i18n.addDictionary('sl', {
|
||||
"GridFieldExtensions.ADD_CLASS": "Dodaj: <i>{classname}</i>",
|
||||
"GridFieldExtensions.CONFIRMDEL": "Res želite to izbrisati?",
|
||||
"GridFieldExtensions.OPEN_SEARCH_FILTER": "Prikaži iskalnik in filtre",
|
||||
"GridFieldExtensions.SAVE_PUBLISH": "Shrani in objavi"
|
||||
});
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"GridFieldExtensions.ADD_CLASS": "Add: <i>{classname}</i>",
|
||||
"GridFieldExtensions.CONFIRMDEL": "Are you sure you want to delete this?",
|
||||
"GridFieldExtensions.OPEN_SEARCH_FILTER": "Open search and filter",
|
||||
"GridFieldExtensions.SAVE_PUBLISH": "Save & publish"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"GridFieldExtensions.ADD_CLASS": "Aldoni: <i>{classname}</i>",
|
||||
"GridFieldExtensions.CONFIRMDEL": "Ĉu vi certas ke vi volas forigi tion?",
|
||||
"GridFieldExtensions.OPEN_SEARCH_FILTER": "Malfermi serĉon kaj filtrilon",
|
||||
"GridFieldExtensions.SAVE_PUBLISH": "Konservi kaj publikigi"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"GridFieldExtensions.ADD_CLASS": "Toevoegen: <i>{classname}</i>",
|
||||
"GridFieldExtensions.CONFIRMDEL": "Weet je zeker dat je dit wil verwijderen?",
|
||||
"GridFieldExtensions.OPEN_SEARCH_FILTER": "Open zoeken en filteren",
|
||||
"GridFieldExtensions.SAVE_PUBLISH": "Opslaan & Publiceren"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"GridFieldExtensions.ADD_CLASS": "Pridať: <i>{classname}</i>",
|
||||
"GridFieldExtensions.CONFIRMDEL": "Naozaj to chcete odstrániť?",
|
||||
"GridFieldExtensions.OPEN_SEARCH_FILTER": "Otvorte vyhľadávanie a filter",
|
||||
"GridFieldExtensions.SAVE_PUBLISH": "Uložiť a zverejniť"
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"GridFieldExtensions.ADD_CLASS": "Dodaj: <i>{classname}</i>",
|
||||
"GridFieldExtensions.CONFIRMDEL": "Res želite to izbrisati?",
|
||||
"GridFieldExtensions.OPEN_SEARCH_FILTER": "Prikaži iskalnik in filtre",
|
||||
"GridFieldExtensions.SAVE_PUBLISH": "Shrani in objavi"
|
||||
}
|
|
@ -35,7 +35,8 @@
|
|||
],
|
||||
"expose": [
|
||||
"css",
|
||||
"javascript"
|
||||
"javascript",
|
||||
"client/lang"
|
||||
]
|
||||
},
|
||||
"replace": {
|
||||
|
|
|
@ -215,7 +215,7 @@
|
|||
|
||||
}
|
||||
.grid-field-inline-new--multi-class-list a {
|
||||
color: #FFF;
|
||||
color: #FFF !important;
|
||||
display: block;
|
||||
margin: 5px -10px;
|
||||
padding: 0 10px;
|
||||
|
|
|
@ -106,6 +106,17 @@ class Item extends DataObject {
|
|||
}
|
||||
```
|
||||
|
||||
### Versioning
|
||||
By default `GridFieldOrderableRows` will handle versioning but won't automatically publish any records. The user will need to go into each record and publish them manually which could get cumbersome for large lists.
|
||||
|
||||
You can configure the list to automatically publish a record if the record is the latest version and is already published. This won't publish any records which have draft changes.
|
||||
|
||||
```php
|
||||
$orderable = GridFieldOrderableRows::create()->setRepublishLiveRecords(true);
|
||||
```
|
||||
|
||||
There are caveats with both approaches so consideration should be made for which approach best suits the requirements.
|
||||
|
||||
**Please NOTE:** There is a limitation when using `GridFieldOrderableRows` on unsaved data objects; namely, that it doesn't work as without data being saved, the list of related objects has no context. Please check `$this->ID` before adding the `GridFieldOrderableRows` component to the grid field config (or even, before adding the gridfield at all).
|
||||
|
||||
Configurable Paginator
|
||||
|
|
|
@ -243,7 +243,11 @@
|
|||
const classes = this.data('classes');
|
||||
const liHtml = Object.keys(classes).map(className => {
|
||||
const link = hrefTemplate.replace('{class}', className);
|
||||
return `<li><a href="${link}">Add: <i>${classes[className]}</i></a></li>`;
|
||||
const linkText = ss.i18n.inject(
|
||||
ss.i18n._t('GridFieldExtensions.ADD_CLASS', 'Add: <i>{classname}</i>'),
|
||||
{classname: classes[className]}
|
||||
);
|
||||
return `<li><a href="${link}">${linkText}</a></li>`;
|
||||
});
|
||||
|
||||
const listElement = $(`<ul class="grid-field-inline-new--multi-class-list">${liHtml.join('')}</ul>`);
|
||||
|
@ -336,7 +340,8 @@
|
|||
content = '<span class="non-sortable"></span>';
|
||||
self.addClass('show-filter').find('.grid-field__filter-header').show();
|
||||
} else {
|
||||
content = '<button type="button" title="Open search and filter" name="showFilter" class="btn btn-secondary font-icon-search btn--no-text btn--icon-large grid-field__filter-open"></button>';
|
||||
const contentTitle = ss.i18n._t('GridFieldExtensions.OPEN_SEARCH_FILTER', 'Open search and filter');
|
||||
content = `<button type="button" title="${contentTitle}" name="showFilter" class="btn btn-secondary font-icon-search btn--no-text btn--icon-large grid-field__filter-open"></button>`;
|
||||
self.removeClass('show-filter').find('.grid-field__filter-header').hide();
|
||||
}
|
||||
|
||||
|
@ -364,7 +369,7 @@
|
|||
publish.removeClass('font-icon-tick');
|
||||
publish.addClass('btn-primary');
|
||||
publish.addClass('font-icon-rocket');
|
||||
publish.find('.btn__title').html('Save & publish');
|
||||
publish.find('.btn__title').html(ss.i18n._t('GridFieldExtensions.SAVE_PUBLISH', 'Save & publish'));
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
de_DE:
|
||||
GridFieldAddExistingSearchHandler.ss:
|
||||
NOITEMS: 'Kein Ergebnis'
|
||||
RESULTS: 'Ergebnisse'
|
||||
RESULTS: Ergebnisse
|
||||
GridFieldExtensions:
|
||||
ADD: 'Hinzufügen'
|
||||
ADD: Hinzufügen
|
||||
ADDEXISTING: 'Bestehenden Eintrag hinzufügen'
|
||||
SEARCH: 'Suche'
|
||||
SEARCH: Suche
|
||||
SELECTTYPETOCREATE: '(Bitte Typ auswählen)'
|
||||
|
|
|
@ -10,5 +10,7 @@ en:
|
|||
RESULTS: Results
|
||||
SEARCH: Search
|
||||
SELECTTYPETOCREATE: '(Select type to create)'
|
||||
Symbiote\GridFieldExtensions\Extensions\GridFieldDetailFormItemRequestExtension:
|
||||
NEW: 'Add new record'
|
||||
Symbiote\GridFieldExtensions\GridFieldConfigurablePaginator:
|
||||
SHOW: Show
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
eo:
|
||||
GridFieldExtensions:
|
||||
ADD: Aldoni
|
||||
ADDEXISTING: 'Aldoni ekzistantan'
|
||||
BACK: Antaŭa
|
||||
CURRENT: (aktuala)
|
||||
NOITEMS: 'Mankas elementoj'
|
||||
Next: Sekva
|
||||
PREVIOUS: Antaŭa
|
||||
RESULTS: Rezultoj
|
||||
SEARCH: Serĉi
|
||||
SELECTTYPETOCREATE: '(Elektu tipon kreotan)'
|
||||
Symbiote\GridFieldExtensions\Extensions\GridFieldDetailFormItemRequestExtension:
|
||||
NEW: 'Aldoni novan rikordon'
|
||||
Symbiote\GridFieldExtensions\GridFieldConfigurablePaginator:
|
||||
SHOW: Vidigi
|
|
@ -1,9 +1,9 @@
|
|||
es_ES:
|
||||
GridFieldAddExistingSearchHandler.ss:
|
||||
NOITEMS: 'No hay items.'
|
||||
RESULTS: 'Resultados'
|
||||
RESULTS: Resultados
|
||||
GridFieldExtensions:
|
||||
ADD: 'Agregar'
|
||||
ADD: Agregar
|
||||
ADDEXISTING: 'Agregar existente'
|
||||
SEARCH: 'Buscar'
|
||||
SEARCH: Buscar
|
||||
SELECTTYPETOCREATE: '(Seleccionar tipo para crear)'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
et_EE:
|
||||
GridFieldAddExistingSearchHandler.ss:
|
||||
NOITEMS: 'Kirjed puuduvad.'
|
||||
RESULTS: 'Tulemused'
|
||||
RESULTS: Tulemused
|
||||
GridFieldExtensions:
|
||||
ADD: Lisa
|
||||
ADDEXISTING: 'Lisa olemasolev'
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
fi_FI:
|
||||
GridFieldAddExistingSearchHandler.ss:
|
||||
NOITEMS: 'Ei kohteita'
|
||||
RESULTS: 'Tulokset'
|
||||
RESULTS: Tulokset
|
||||
GridFieldExtensions:
|
||||
ADD: 'Lisää'
|
||||
ADD: Lisää
|
||||
ADDEXISTING: 'Lisää olemassa oleva'
|
||||
SEARCH: 'Etsi'
|
||||
SEARCH: Etsi
|
||||
SELECTTYPETOCREATE: 'Valitse lisättävä tyyppi'
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
it_IT:
|
||||
GridFieldAddExistingSearchHandler.ss:
|
||||
NOITEMS: 'Nessun elemento.'
|
||||
RESULTS: 'Risultati'
|
||||
RESULTS: Risultati
|
||||
GridFieldExtensions:
|
||||
ADD: 'Aggiungi'
|
||||
ADD: Aggiungi
|
||||
ADDEXISTING: 'Aggiungi esistente'
|
||||
SEARCH: 'Cerca'
|
||||
SEARCH: Cerca
|
||||
SELECTTYPETOCREATE: '(Seleziona tipo per creare)'
|
||||
|
|
|
@ -1,9 +1,19 @@
|
|||
nl_NL:
|
||||
GridFieldAddExistingSearchHandler.ss:
|
||||
NOITEMS: 'Geen resultaten gevonden.'
|
||||
RESULTS: 'Resultaten'
|
||||
RESULTS: Resultaten
|
||||
GridFieldExtensions:
|
||||
ADD: 'Toevoegen'
|
||||
ADD: Toevoegen
|
||||
ADDEXISTING: 'Bestaande toevoegen'
|
||||
SEARCH: 'Zoeken'
|
||||
BACK: Terug
|
||||
CURRENT: (huidige)
|
||||
NOITEMS: 'Er zijn geen items.'
|
||||
Next: Volgende
|
||||
PREVIOUS: Vorige
|
||||
RESULTS: Resultaten
|
||||
SEARCH: Zoeken
|
||||
SELECTTYPETOCREATE: '(Selecteer type om te creeën)'
|
||||
Symbiote\GridFieldExtensions\Extensions\GridFieldDetailFormItemRequestExtension:
|
||||
NEW: 'Nieuw item maken'
|
||||
Symbiote\GridFieldExtensions\GridFieldConfigurablePaginator:
|
||||
SHOW: Toon
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
ru_RU:
|
||||
GridFieldAddExistingSearchHandler.ss:
|
||||
NOITEMS: 'Нет элементов.'
|
||||
RESULTS: 'Результаты'
|
||||
RESULTS: Результаты
|
||||
GridFieldExtensions:
|
||||
ADD: 'Добавить'
|
||||
ADD: Добавить
|
||||
ADDEXISTING: 'Добавить существующий'
|
||||
SEARCH: 'Поиск'
|
||||
SEARCH: Поиск
|
||||
SELECTTYPETOCREATE: '(Выберите тип для создания)'
|
||||
|
|
16
lang/sk.yml
16
lang/sk.yml
|
@ -1,9 +1,19 @@
|
|||
sk:
|
||||
GridFieldAddExistingSearchHandler.ss:
|
||||
NOITEMS: 'Nie sú tu žiadne položky.'
|
||||
RESULTS: 'Výsledky'
|
||||
RESULTS: Výsledky
|
||||
GridFieldExtensions:
|
||||
ADD: Pridať
|
||||
ADDEXISTING: Pridať existujúci
|
||||
ADDEXISTING: 'Pridať existujúci'
|
||||
BACK: Späť
|
||||
CURRENT: (aktuálny)
|
||||
NOITEMS: 'Nie sú k dispozícii žiadne položky.'
|
||||
Next: Ďalší
|
||||
PREVIOUS: Predchádzajúci
|
||||
RESULTS: Výsledky
|
||||
SEARCH: Hľadať
|
||||
SELECTTYPETOCREATE: '(Prosím, vyberte typ)'
|
||||
SELECTTYPETOCREATE: '(Vyberte typ na vytvorenie)'
|
||||
Symbiote\GridFieldExtensions\Extensions\GridFieldDetailFormItemRequestExtension:
|
||||
NEW: 'Pridať nový záznam'
|
||||
Symbiote\GridFieldExtensions\GridFieldConfigurablePaginator:
|
||||
SHOW: Zobraziť
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
sl:
|
||||
GridFieldExtensions:
|
||||
ADD: Dodaj
|
||||
ADDEXISTING: 'Dodaj obstoječe'
|
||||
BACK: Nazaj
|
||||
CURRENT: (trenutno)
|
||||
NOITEMS: 'Ni nobenih elementov.'
|
||||
Next: Naslednja
|
||||
PREVIOUS: Prejšnja
|
||||
RESULTS: Rezultati
|
||||
SEARCH: Iskanje
|
||||
SELECTTYPETOCREATE: '(Izberite tip, ki ga želite ustvariti)'
|
||||
Symbiote\GridFieldExtensions\Extensions\GridFieldDetailFormItemRequestExtension:
|
||||
NEW: 'Dodaj zapis'
|
||||
Symbiote\GridFieldExtensions\GridFieldConfigurablePaginator:
|
||||
SHOW: Prikaži
|
|
@ -0,0 +1,16 @@
|
|||
sv:
|
||||
GridFieldExtensions:
|
||||
ADD: 'Lägg till'
|
||||
ADDEXISTING: 'Lägg till existerande'
|
||||
BACK: Tillbaka
|
||||
CURRENT: (befintliga)
|
||||
NOITEMS: 'Hittade ingen data.'
|
||||
Next: Nästa
|
||||
PREVIOUS: Föregående
|
||||
RESULTS: Resultat
|
||||
SEARCH: Sök
|
||||
SELECTTYPETOCREATE: '(Välj för att skapa)'
|
||||
Symbiote\GridFieldExtensions\Extensions\GridFieldDetailFormItemRequestExtension:
|
||||
NEW: 'Lägg till ny rad'
|
||||
Symbiote\GridFieldExtensions\GridFieldConfigurablePaginator:
|
||||
SHOW: Visa
|
|
@ -94,7 +94,7 @@ class GridFieldAddExistingSearchHandler extends RequestHandler
|
|||
|
||||
public function doSearch($data, $form)
|
||||
{
|
||||
$list = $this->context->getQuery($data, false, false, $this->getSearchList());
|
||||
$list = $this->context->getQuery($data, false, null, $this->getSearchList());
|
||||
$list = $list->subtract($this->grid->getList());
|
||||
$list = PaginatedList::create($list, $this->request);
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ use SilverStripe\ORM\DataList;
|
|||
use SilverStripe\ORM\DataObject;
|
||||
use SilverStripe\ORM\DataObjectInterface;
|
||||
use SilverStripe\ORM\ManyManyList;
|
||||
use SilverStripe\ORM\ManyManyThroughList;
|
||||
|
||||
/**
|
||||
* Allows inline editing of grid field records without having to load a separate
|
||||
|
@ -165,7 +166,7 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
|||
}
|
||||
}
|
||||
|
||||
if ($list instanceof ManyManyList) {
|
||||
if ($list instanceof ManyManyList || $list instanceof ManyManyThroughList) {
|
||||
$extra = array_intersect_key($form->getData() ?? [], (array) $list->getExtraFields());
|
||||
}
|
||||
|
||||
|
@ -250,7 +251,7 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements
|
|||
}
|
||||
}
|
||||
|
||||
if (!$field && $list instanceof ManyManyList) {
|
||||
if (!$field && ($list instanceof ManyManyList || $list instanceof ManyManyThroughList)) {
|
||||
$extra = $list->getExtraFields();
|
||||
|
||||
if ($extra && array_key_exists($col, $extra ?? [])) {
|
||||
|
|
|
@ -82,6 +82,15 @@ class GridFieldOrderableRows extends RequestHandler implements
|
|||
*/
|
||||
protected $extraSortFields = null;
|
||||
|
||||
/**
|
||||
* If the items in the list are versioned and this is set to true, then
|
||||
* we will check to see if the version we're sorting is the latest published
|
||||
* version and if so then we will re-publish the item.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
protected $republishLiveRecords = false;
|
||||
|
||||
/**
|
||||
* The number of the column containing the reorder handles
|
||||
*
|
||||
|
@ -147,6 +156,28 @@ class GridFieldOrderableRows extends RequestHandler implements
|
|||
return $this->extraSortFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $republishLiveRecords
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getRepublishLiveRecords()
|
||||
{
|
||||
return $this->republishLiveRecords;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see $republishLiveRecords
|
||||
*
|
||||
* @param boolean $bool
|
||||
* @return GridFieldOrderableRows $this
|
||||
*/
|
||||
public function setRepublishLiveRecords($bool)
|
||||
{
|
||||
$this->republishLiveRecords = $bool;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks to see if the relationship list is for a type of many_many
|
||||
*
|
||||
|
@ -365,6 +396,13 @@ class GridFieldOrderableRows extends RequestHandler implements
|
|||
if ($list instanceof DataList) {
|
||||
$classname = $list->dataClass();
|
||||
if ($defaultSort = Config::inst()->get($classname, 'default_sort')) {
|
||||
if (is_array($defaultSort)) {
|
||||
$defaultSortArray = [];
|
||||
foreach ($defaultSort as $column => $direction) {
|
||||
$defaultSortArray[] = "\"$column\" $direction";
|
||||
}
|
||||
$defaultSort = implode(', ', $defaultSortArray);
|
||||
}
|
||||
// Append the default sort to the end of the sort string
|
||||
// This may result in redundancy... but it seems to work
|
||||
$sortterm .= ($sortterm ? ', ' : '') . $defaultSort;
|
||||
|
@ -418,7 +456,10 @@ class GridFieldOrderableRows extends RequestHandler implements
|
|||
$this->httpError(400);
|
||||
}
|
||||
|
||||
Controller::curr()->getResponse()->addHeader('X-Status', rawurlencode('Records reordered.'));
|
||||
Controller::curr()->getResponse()->addHeader(
|
||||
'X-Status',
|
||||
rawurlencode(_t(__CLASS__ . '.REORDERED', 'Records reordered.'))
|
||||
);
|
||||
return $grid->FieldHolder();
|
||||
}
|
||||
|
||||
|
@ -628,7 +669,15 @@ class GridFieldOrderableRows extends RequestHandler implements
|
|||
|
||||
if ($record->$sortField != $newSortValue) {
|
||||
$record->$sortField = $newSortValue;
|
||||
|
||||
// We need to do this before writing otherwith isLiveVersion() will always be false
|
||||
$shouldRepublish = $this->getRepublishLiveRecords() && $record->isLiveVersion();
|
||||
|
||||
// Write our staged record and publish if required
|
||||
$record->write();
|
||||
if ($shouldRepublish) {
|
||||
$record->copyVersionToStage(Versioned::DRAFT, Versioned::LIVE, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ use Symbiote\GridFieldExtensions\Tests\Stub\ThroughDefinerVersioned;
|
|||
use Symbiote\GridFieldExtensions\Tests\Stub\ThroughIntermediary;
|
||||
use Symbiote\GridFieldExtensions\Tests\Stub\TitleObject;
|
||||
use Symbiote\GridFieldExtensions\Tests\Stub\TitleSortedObject;
|
||||
use Symbiote\GridFieldExtensions\Tests\Stub\TitleArraySortedObject;
|
||||
use Symbiote\GridFieldExtensions\Tests\Stub\ThroughIntermediaryVersioned;
|
||||
|
||||
/**
|
||||
|
@ -53,6 +54,7 @@ class GridFieldOrderableRowsTest extends SapphireTest
|
|||
ThroughBelongs::class,
|
||||
TitleObject::class,
|
||||
TitleSortedObject::class,
|
||||
TitleArraySortedObject::class,
|
||||
ThroughDefinerVersioned::class,
|
||||
ThroughIntermediaryVersioned::class,
|
||||
ThroughBelongsVersioned::class,
|
||||
|
@ -332,6 +334,17 @@ class GridFieldOrderableRowsTest extends SapphireTest
|
|||
$this->assertSame(['B', 'A', 'C'], $sortedList->column('Iden'));
|
||||
}
|
||||
|
||||
|
||||
public function testGetManipulatedDataWithDefaultSortArray()
|
||||
{
|
||||
$sortedList = $this->getTitleSortedListForManipuatedData(TitleArraySortedObject::class, [
|
||||
['Title' => 'X', 'Iden' => 'C', 'OtherSort' => 3],
|
||||
['Title' => 'Z', 'Iden' => 'A', 'OtherSort' => 2],
|
||||
['Title' => 'Z', 'Iden' => 'B', 'OtherSort' => 1],
|
||||
]);
|
||||
$this->assertSame(['C', 'B', 'A'], $sortedList->column('Iden'));
|
||||
}
|
||||
|
||||
private function getTitleSortedListForManipuatedData(string $dataClass, array $data): DataList
|
||||
{
|
||||
$list = new DataList($dataClass);
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace Symbiote\GridFieldExtensions\Tests\Stub;
|
||||
|
||||
use SilverStripe\Dev\TestOnly;
|
||||
use SilverStripe\ORM\DataObject;
|
||||
|
||||
class TitleArraySortedObject extends DataObject implements TestOnly
|
||||
{
|
||||
private static $db = [
|
||||
'Title' => 'Varchar',
|
||||
'Iden' => 'Varchar',
|
||||
'OtherSort' => 'Int'
|
||||
];
|
||||
|
||||
private static array $default_sort = [
|
||||
'Title' => 'ASC',
|
||||
'OtherSort' => 'ASC',
|
||||
];
|
||||
|
||||
private static $table_name = 'TitleArraySortedObject';
|
||||
}
|
Loading…
Reference in New Issue