-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(admin-ui): js in edit revision (DateTime, Reorder, Sortable, ..) #770
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e2164e6
fix: uuid
theus77 c0c6c2c
chore: eslint
theus77 5907f0e
ref: auto open modal
theus77 c7eb1f9
fix: ensure that sortable is loaded
theus77 fb1466d
fix: ensure that dragDirection is computed in _mouseDrag
theus77 973e44b
fix: reorder inside a collection
theus77 e616744
ref: datetime fields.html.twig
theus77 63b2c0e
ref: icontext fields.html.twig
theus77 feecbb8
fix: inputs with input-group
theus77 57bc606
ref: date time field
theus77 31ac909
ref: update revision invalid messages
theus77 fe61963
chore: eslint
theus77 6afdfc7
fix: keep date-picker class
theus77 8acf65c
fix: avoid error on null previous element (+log)
theus77 401d251
fix: avoid error on null previous element (+log)
theus77 95b5d8a
ref: datetime-picker
theus77 f76444c
fix: don't let the JS plugin to parse the ATOM date
theus77 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict' | ||
import queryString from '../helpers/queryString' | ||
import { Modal as BSModal } from 'bootstrap' | ||
|
||
export default class Modal { | ||
constructor () { | ||
this.autoOpenModal() | ||
} | ||
|
||
autoOpenModal () { | ||
const queryStringObject = queryString() | ||
if (queryStringObject.open) { | ||
const modalElement = document.getElementById(`content_type_structure_fieldType${queryStringObject.open}`) | ||
const modal = BSModal.getOrCreateInstance(modalElement) | ||
modal.show() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { TempusDominus } from '@eonasdan/tempus-dominus' | ||
import '@eonasdan/tempus-dominus/src/scss/tempus-dominus.scss' | ||
import ChangeEvent from '../events/changeEvent' | ||
|
||
class Datetime { | ||
#iframes = [] | ||
|
||
load (target) { | ||
const datetimePickers = target.querySelectorAll('.datetime-picker') | ||
for (let i = 0; i < datetimePickers.length; i++) { | ||
const picker = new TempusDominus(datetimePickers[i], { | ||
display: { | ||
buttons: { | ||
today: true, | ||
clear: true, | ||
close: true | ||
} | ||
}, | ||
localization: { | ||
format: datetimePickers[i].dataset.dateFormat, | ||
startOfTheWeek: 1 | ||
}, | ||
restrictions: { | ||
daysOfWeekDisabled: JSON.parse(datetimePickers[i].dataset.dateDaysOfWeekDisabled), | ||
disabledHours: JSON.parse(datetimePickers[i].dataset.dateDisabledHours) | ||
} | ||
}) | ||
if (datetimePickers[i].dataset.dateLocale) { | ||
picker.locale(datetimePickers[i].dataset.dateLocale) | ||
} | ||
datetimePickers[i].addEventListener('change.td', function () { | ||
if (datetimePickers[i].classList.contains('ignore-ems-update')) { | ||
return | ||
} | ||
const event = new ChangeEvent(datetimePickers[i]) | ||
event.dispatch() | ||
}) | ||
} | ||
} | ||
} | ||
|
||
export default Datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
work in progress ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I'll clean it after the refactoring of all FieldTypes