Compare commits

...

27 Commits

Author SHA1 Message Date
Guy Sartorelli d851ce562c
Merge pull request #395 from creative-commoners/pulls/3/manual-workflows
MNT Upaded scheduled workflows on default branch
2024-05-23 11:56:27 +12:00
Steve Boyd 018ab87515 MNT Upaded scheduled workflows on default branch 2024-05-22 16:36:45 +12:00
Guy Sartorelli d34c92dba7
Merge branch '3.6' into 3 2024-02-27 13:44:19 +13:00
Guy Sartorelli c84d8afa7a
TLN Update translations (#381) 2024-02-07 16:15:40 +13:00
Tom Oude Rengerink 78fa8ba747
ENH Make toast message "Records reordered." localisable (#321)
Co-authored-by: Tom Oude Rengerink <tom@cube.nl>
2024-01-24 11:41:14 +13:00
Guy Sartorelli 62734535a0
MNT Run module-standardiser (#377) 2023-12-21 16:33:13 +13:00
Guy Sartorelli 5ed8c95fda
Merge branch '3.6' into 3 2023-12-19 13:58:41 +13:00
Guy Sartorelli 377dc1ef93
Merge pull request #358 from Sitetools/link_color_fix
Make link color white.
2023-12-19 13:57:29 +13:00
Robin 1637e78ea1
Make link color white. 2023-12-19 13:54:08 +13:00
Guy Sartorelli 9c70b0175b
Merge branch '3.6' into 3 2023-08-30 10:18:58 +12:00
Loz Calver e7d7178719
Merge pull request #372 from creative-commoners/pulls/3.6/manymanythrough-editablecolumns
FIX Allow editing extra fields from ManyManyThroughList.
2023-08-21 09:06:49 +01:00
Guy Sartorelli 1e5a1e8056
ENH Update translations (#373) 2023-08-21 13:21:15 +12:00
Guy Sartorelli 47171ee4c2
FIX Allow editing extra fields from ManyManyThroughList. 2023-08-21 09:02:42 +12:00
Sabina Talipova a2ea473369
MNT Replaced SearchContext::getQuery limit param with null (#367) 2023-07-05 17:20:56 +12:00
Steve Boyd 829cacff0b Merge branch '3.6' into 3 2023-06-16 12:22:25 +12:00
Guy Sartorelli 1284046e10
Merge pull request #365 from creative-commoners/pulls/3.6/tx-1686725015
ENH Update translations
2023-06-15 10:06:20 +12:00
Steve Boyd 665d23170b ENH Update translations 2023-06-14 18:43:35 +12:00
Steve Boyd f2adec35d3 Merge branch '3.6' into 3 2023-05-31 14:31:33 +12:00
Sabina Talipova 504b3bd822
Merge pull request #364 from creative-commoners/pulls/3.6/tx-1685417567
ENH Update translations
2023-05-31 11:29:33 +12:00
Steve Boyd 89a7301b67 ENH Update translations 2023-05-30 15:32:47 +12:00
Guy Sartorelli 6d46483e32
Merge branch '3.6' into 3 2023-04-06 10:41:11 +12:00
Guy Sartorelli bb6c0396f1
Merge branch '3.5' into 3.6 2023-04-06 10:40:35 +12:00
Guy Sartorelli bd783a4a24
Merge pull request #361 from creative-commoners/pulls/3.5/arrays
FIX Handle arrays in default_sort
2023-04-06 10:39:18 +12:00
Steve Boyd 17f92d08ba FIX Handle arrays in default_sort 2023-04-06 10:30:12 +12:00
Maxime Rainville 49a607d747
Merge pull request #360 from creative-commoners/pulls/3/dispatch-ci
MNT Use gha-dispatch-ci
2023-03-23 12:04:25 +13:00
Steve Boyd 5566b05c9d MNT Use gha-dispatch-ci 2023-03-21 12:05:45 +13:00
Guy Sartorelli b0addcb5bd
ENH Update translations (#359) 2023-03-09 14:53:24 +13:00
39 changed files with 466 additions and 36 deletions

1
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -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. -->

72
.github/ISSUE_TEMPLATE/1_bug_report.yml vendored Normal file
View File

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

View File

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

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -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.

39
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

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

View File

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

21
.github/workflows/dispatch-ci.yml vendored Normal file
View File

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

22
.github/workflows/merge-up.yml vendored Normal file
View File

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

15
.tx/config Normal file
View File

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

14
client/lang/en.js Normal file
View File

@ -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"
});
}

14
client/lang/eo.js Normal file
View File

@ -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"
});
}

14
client/lang/nl_NL.js Normal file
View File

@ -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"
});
}

14
client/lang/sk.js Normal file
View File

@ -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ť"
});
}

14
client/lang/sl.js Normal file
View File

@ -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"
});
}

6
client/lang/src/en.json Normal file
View File

@ -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"
}

6
client/lang/src/eo.json Normal file
View File

@ -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"
}

View File

@ -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"
}

6
client/lang/src/sk.json Normal file
View File

@ -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ť"
}

6
client/lang/src/sl.json Normal file
View File

@ -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"
}

View File

@ -35,7 +35,8 @@
],
"expose": [
"css",
"javascript"
"javascript",
"client/lang"
]
},
"replace": {

View File

@ -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;

View File

@ -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) {

View File

@ -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)'

View File

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

16
lang/eo.yml Normal file
View File

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

View File

@ -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)'

View File

@ -1,7 +1,7 @@
et_EE:
GridFieldAddExistingSearchHandler.ss:
NOITEMS: 'Kirjed puuduvad.'
RESULTS: 'Tulemused'
RESULTS: Tulemused
GridFieldExtensions:
ADD: Lisa
ADDEXISTING: 'Lisa olemasolev'

View File

@ -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'

View File

@ -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)'

View File

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

View File

@ -1,9 +1,9 @@
ru_RU:
GridFieldAddExistingSearchHandler.ss:
NOITEMS: 'Нет элементов.'
RESULTS: 'Результаты'
RESULTS: Результаты
GridFieldExtensions:
ADD: 'Добавить'
ADD: Добавить
ADDEXISTING: 'Добавить существующий'
SEARCH: 'Поиск'
SEARCH: Поиск
SELECTTYPETOCREATE: '(Выберите тип для создания)'

View File

@ -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ť

16
lang/sl.yml Normal file
View File

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

16
lang/sv.yml Normal file
View File

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

View File

@ -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);

View File

@ -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 ?? [])) {

View File

@ -396,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;
@ -449,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();
}

View File

@ -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);

View File

@ -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';
}