Merge branch '4.0' into 4

This commit is contained in:
Steve Boyd 2023-03-30 13:51:33 +13:00
commit ec931416e5
16 changed files with 84 additions and 30 deletions

View File

@ -4,13 +4,8 @@ on:
push: push:
pull_request: pull_request:
workflow_dispatch: workflow_dispatch:
# Every Sunday at 12:10pm UTC
schedule:
- cron: '10 12 * * 0'
jobs: jobs:
ci: ci:
name: 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 uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1

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

@ -0,0 +1,16 @@
name: Dispatch CI
on:
# At 12:10 PM UTC, only on Sunday and Monday
schedule:
- cron: '10 12 * * 0,1'
jobs:
dispatch-ci:
name: Dispatch CI
# Only run cron on the silverstripe account
if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
runs-on: ubuntu-latest
steps:
- name: Dispatch CI
uses: silverstripe/gha-dispatch-ci@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.CONFIRMDEL": "Are you sure you want to delete this?",
"GridFieldExtensions.ADD_CLASS": "Add: <i>{classname}</i>",
"GridFieldExtensions.OPEN_SEARCH_FILTER": "Open search and filter",
"GridFieldExtensions.SAVE_PUBLISH": "Save & publish"
});
}

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

@ -0,0 +1,6 @@
{
"GridFieldExtensions.CONFIRMDEL": "Are you sure you want to delete this?",
"GridFieldExtensions.ADD_CLASS": "Add: <i>{classname}</i>",
"GridFieldExtensions.OPEN_SEARCH_FILTER": "Open search and filter",
"GridFieldExtensions.SAVE_PUBLISH": "Save & publish"
}

View File

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

View File

@ -243,7 +243,11 @@
const classes = this.data('classes'); const classes = this.data('classes');
const liHtml = Object.keys(classes).map(className => { const liHtml = Object.keys(classes).map(className => {
const link = hrefTemplate.replace('{class}', 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>`); const listElement = $(`<ul class="grid-field-inline-new--multi-class-list">${liHtml.join('')}</ul>`);
@ -336,7 +340,8 @@
content = '<span class="non-sortable"></span>'; content = '<span class="non-sortable"></span>';
self.addClass('show-filter').find('.grid-field__filter-header').show(); self.addClass('show-filter').find('.grid-field__filter-header').show();
} else { } 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(); self.removeClass('show-filter').find('.grid-field__filter-header').hide();
} }
@ -364,7 +369,7 @@
publish.removeClass('font-icon-tick'); publish.removeClass('font-icon-tick');
publish.addClass('btn-primary'); publish.addClass('btn-primary');
publish.addClass('font-icon-rocket'); 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) { error: function (e) {

View File

@ -1,9 +1,9 @@
de_DE: de_DE:
GridFieldAddExistingSearchHandler.ss: GridFieldAddExistingSearchHandler.ss:
NOITEMS: 'Kein Ergebnis' NOITEMS: 'Kein Ergebnis'
RESULTS: 'Ergebnisse' RESULTS: Ergebnisse
GridFieldExtensions: GridFieldExtensions:
ADD: 'Hinzufügen' ADD: Hinzufügen
ADDEXISTING: 'Bestehenden Eintrag hinzufügen' ADDEXISTING: 'Bestehenden Eintrag hinzufügen'
SEARCH: 'Suche' SEARCH: Suche
SELECTTYPETOCREATE: '(Bitte Typ auswählen)' SELECTTYPETOCREATE: '(Bitte Typ auswählen)'

View File

@ -10,5 +10,7 @@ en:
RESULTS: Results RESULTS: Results
SEARCH: Search SEARCH: Search
SELECTTYPETOCREATE: '(Select type to create)' SELECTTYPETOCREATE: '(Select type to create)'
Symbiote\GridFieldExtensions\Extensions\GridFieldDetailFormItemRequestExtension:
NEW: 'Add new record'
Symbiote\GridFieldExtensions\GridFieldConfigurablePaginator: Symbiote\GridFieldExtensions\GridFieldConfigurablePaginator:
SHOW: Show SHOW: Show

View File

@ -1,9 +1,9 @@
es_ES: es_ES:
GridFieldAddExistingSearchHandler.ss: GridFieldAddExistingSearchHandler.ss:
NOITEMS: 'No hay items.' NOITEMS: 'No hay items.'
RESULTS: 'Resultados' RESULTS: Resultados
GridFieldExtensions: GridFieldExtensions:
ADD: 'Agregar' ADD: Agregar
ADDEXISTING: 'Agregar existente' ADDEXISTING: 'Agregar existente'
SEARCH: 'Buscar' SEARCH: Buscar
SELECTTYPETOCREATE: '(Seleccionar tipo para crear)' SELECTTYPETOCREATE: '(Seleccionar tipo para crear)'

View File

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

View File

@ -1,9 +1,9 @@
fi_FI: fi_FI:
GridFieldAddExistingSearchHandler.ss: GridFieldAddExistingSearchHandler.ss:
NOITEMS: 'Ei kohteita' NOITEMS: 'Ei kohteita'
RESULTS: 'Tulokset' RESULTS: Tulokset
GridFieldExtensions: GridFieldExtensions:
ADD: 'Lisää' ADD: Lisää
ADDEXISTING: 'Lisää olemassa oleva' ADDEXISTING: 'Lisää olemassa oleva'
SEARCH: 'Etsi' SEARCH: Etsi
SELECTTYPETOCREATE: 'Valitse lisättävä tyyppi' SELECTTYPETOCREATE: 'Valitse lisättävä tyyppi'

View File

@ -1,9 +1,9 @@
it_IT: it_IT:
GridFieldAddExistingSearchHandler.ss: GridFieldAddExistingSearchHandler.ss:
NOITEMS: 'Nessun elemento.' NOITEMS: 'Nessun elemento.'
RESULTS: 'Risultati' RESULTS: Risultati
GridFieldExtensions: GridFieldExtensions:
ADD: 'Aggiungi' ADD: Aggiungi
ADDEXISTING: 'Aggiungi esistente' ADDEXISTING: 'Aggiungi esistente'
SEARCH: 'Cerca' SEARCH: Cerca
SELECTTYPETOCREATE: '(Seleziona tipo per creare)' SELECTTYPETOCREATE: '(Seleziona tipo per creare)'

View File

@ -1,9 +1,9 @@
nl_NL: nl_NL:
GridFieldAddExistingSearchHandler.ss: GridFieldAddExistingSearchHandler.ss:
NOITEMS: 'Geen resultaten gevonden.' NOITEMS: 'Geen resultaten gevonden.'
RESULTS: 'Resultaten' RESULTS: Resultaten
GridFieldExtensions: GridFieldExtensions:
ADD: 'Toevoegen' ADD: Toevoegen
ADDEXISTING: 'Bestaande toevoegen' ADDEXISTING: 'Bestaande toevoegen'
SEARCH: 'Zoeken' SEARCH: Zoeken
SELECTTYPETOCREATE: '(Selecteer type om te creeën)' SELECTTYPETOCREATE: '(Selecteer type om te creeën)'

View File

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

View File

@ -1,9 +1,9 @@
sk: sk:
GridFieldAddExistingSearchHandler.ss: GridFieldAddExistingSearchHandler.ss:
NOITEMS: 'Nie sú tu žiadne položky.' NOITEMS: 'Nie sú tu žiadne položky.'
RESULTS: 'Výsledky' RESULTS: Výsledky
GridFieldExtensions: GridFieldExtensions:
ADD: Pridať ADD: Pridať
ADDEXISTING: Pridať existujúci ADDEXISTING: 'Pridať existujúci'
SEARCH: Hľadať SEARCH: Hľadať
SELECTTYPETOCREATE: '(Prosím, vyberte typ)' SELECTTYPETOCREATE: '(Prosím, vyberte typ)'