Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • project/private_message
  • issue/private_message-3102091
  • issue/private_message-3184577
  • issue/private_message-3186067
  • issue/private_message-3095101
  • issue/private_message-3164669
  • issue/private_message-3203419
  • issue/private_message-2942602
  • issue/private_message-3095232
  • issue/private_message-3216927
  • issue/private_message-3217509
  • issue/private_message-3232483
  • issue/private_message-3226703
  • issue/private_message-3231433
  • issue/private_message-3137648
  • issue/private_message-3094213
  • issue/private_message-3156194
  • issue/private_message-3183628
  • issue/private_message-3231711
  • issue/private_message-3142633
  • issue/private_message-3042276
  • issue/private_message-3236702
  • issue/private_message-3239279
  • issue/private_message-3239575
  • issue/private_message-3281258
  • issue/private_message-3243139
  • issue/private_message-3195730
  • issue/private_message-3184550
  • issue/private_message-3041599
  • issue/private_message-3179135
  • issue/private_message-3029461
  • issue/private_message-3245298
  • issue/private_message-3250059
  • issue/private_message-3261287
  • issue/private_message-3221475
  • issue/private_message-3261292
  • issue/private_message-3050359
  • issue/private_message-3249348
  • issue/private_message-3248258
  • issue/private_message-3082478
  • issue/private_message-3265901
  • issue/private_message-3300046
  • issue/private_message-2947762
  • issue/private_message-3321802
  • issue/private_message-3051300
  • issue/private_message-3207855
  • issue/private_message-3099166
  • issue/private_message-3344346
  • issue/private_message-3297889
  • issue/private_message-3261083
  • issue/private_message-3151941
  • issue/private_message-3317985
  • issue/private_message-3285143
  • issue/private_message-3337185
  • issue/private_message-3337186
  • issue/private_message-3337189
  • issue/private_message-3322900
  • issue/private_message-2977313
  • issue/private_message-3333001
  • issue/private_message-3337216
  • issue/private_message-3088743
  • issue/private_message-3337221
  • issue/private_message-3337222
  • issue/private_message-3343726
  • issue/private_message-3337224
  • issue/private_message-3339976
  • issue/private_message-3297888
  • issue/private_message-3355273
  • issue/private_message-3356586
  • issue/private_message-3378251
  • issue/private_message-3391546
  • issue/private_message-3381016
  • issue/private_message-3412209
  • issue/private_message-3414396
  • issue/private_message-3204985
  • issue/private_message-3043898
  • issue/private_message-3384791
  • issue/private_message-3121606
  • issue/private_message-3035510
  • issue/private_message-3337240
  • issue/private_message-3417386
  • issue/private_message-3183523
  • issue/private_message-3386742
  • issue/private_message-3322629
  • issue/private_message-3322625
  • issue/private_message-3417433
  • issue/private_message-3241221
  • issue/private_message-3417449
  • issue/private_message-3417461
  • issue/private_message-3271454
  • issue/private_message-3417457
  • issue/private_message-3417644
  • issue/private_message-3417654
  • issue/private_message-3417705
  • issue/private_message-3417731
  • issue/private_message-3417742
  • issue/private_message-3417747
  • issue/private_message-3417751
  • issue/private_message-3417752
  • issue/private_message-3212104
  • issue/private_message-3427223
  • issue/private_message-3365542
  • issue/private_message-3424499
  • issue/private_message-3432140
  • issue/private_message-3439400
  • issue/private_message-3454771
  • issue/private_message-3456956
  • issue/private_message-3464363
  • issue/private_message-3464371
  • issue/private_message-3470070
  • issue/private_message-3470072
  • issue/private_message-3470928
  • issue/private_message-3475462
  • issue/private_message-2987189
  • issue/private_message-3477667
  • issue/private_message-3477873
  • issue/private_message-3478456
  • issue/private_message-3054106
  • issue/private_message-3479391
  • issue/private_message-3417748
  • issue/private_message-3480219
  • issue/private_message-3482103
  • issue/private_message-3482504
  • issue/private_message-3482630
  • issue/private_message-2971692
  • issue/private_message-3484561
  • issue/private_message-3484828
  • issue/private_message-3484854
  • issue/private_message-3485607
  • issue/private_message-3486915
  • issue/private_message-3487175
  • issue/private_message-3482416
  • issue/private_message-3487689
  • issue/private_message-3487705
  • issue/private_message-3487770
  • issue/private_message-3488097
  • issue/private_message-3484915
  • issue/private_message-3488247
  • issue/private_message-3488508
  • issue/private_message-3487692
  • issue/private_message-3484246
  • issue/private_message-3488863
  • issue/private_message-3486047
  • issue/private_message-3489091
  • issue/private_message-3489205
  • issue/private_message-3490037
  • issue/private_message-3490119
  • issue/private_message-3490456
  • issue/private_message-3489224
  • issue/private_message-3490346
  • issue/private_message-3490816
  • issue/private_message-3491252
  • issue/private_message-3491271
  • issue/private_message-3492177
  • issue/private_message-3492289
  • issue/private_message-3331865
  • issue/private_message-3497800
  • issue/private_message-3499154
  • issue/private_message-3499926
  • issue/private_message-3501083
  • issue/private_message-3501286
  • issue/private_message-3501694
  • issue/private_message-3502128
  • issue/private_message-3502140
  • issue/private_message-3502159
  • issue/private_message-3502162
  • issue/private_message-3502180
  • issue/private_message-3502186
  • issue/private_message-3502190
  • issue/private_message-3502496
  • issue/private_message-3504372
  • issue/private_message-3512770
  • issue/private_message-3513969
173 results
Show changes
Commits on Source (28)
Showing
with 214 additions and 114 deletions
......@@ -6,6 +6,7 @@ privatemessagenotification
# Third-party technologies
Blackfire
mailsystem
xhprof
# Contributor names and usernames
......@@ -27,3 +28,6 @@ edutrul
heddn
phjou
sylchuk
# Test strings
Aerosmith
name: ddev-drupal-contrib
repository: ddev/ddev-drupal-contrib
version: 1.0.0-rc22
install_date: "2024-10-28T09:48:30+02:00"
version: 1.0.0-rc23
install_date: "2025-01-15T14:35:04+02:00"
project_files:
- commands/web/eslint
- commands/web/expand-composer-json
......
......@@ -12,11 +12,9 @@ if "$DDEV_DOCROOT/core/node_modules/.bin/eslint" --version >/dev/null ; then
test -e .prettierrc.json || ln -s $DDEV_DOCROOT/core/.prettierrc.json .
test -e .prettierignore || echo '*.yml' > .prettierignore
# Change directory to the project root folder
# cd "$DDEV_DOCROOT/modules/custom/$DDEV_SITENAME" || exit
# Anticipating https://github.com/ddev/ddev-drupal-contrib/pull/81
cd "$DDEV_DOCROOT/modules/custom/${DDEV_SITENAME//-/_}" || exit
"$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/node_modules/.bin/eslint" --no-error-on-unmatched-pattern --ignore-pattern="*.es6.js" --resolve-plugins-relative-to=$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core --ext=.js,.yml . "$@"
"$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/node_modules/.bin/eslint" --config="../../../core/.eslintrc.passing.json" --no-error-on-unmatched-pattern --ignore-pattern="*.es6.js" --resolve-plugins-relative-to=$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core --ext=.js,.yml . "$@"
else
echo "eslint is not available. You may need to 'ddev yarn --cwd $DDEV_DOCROOT/core install'"
echo "eslint is not available. You may need to 'ddev exec \"cd $DDEV_DOCROOT/core && yarn install\"'"
exit 1
fi
......@@ -10,5 +10,12 @@
export _WEB_ROOT=$DDEV_DOCROOT
cd "$DDEV_COMPOSER_ROOT" || exit
curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/scripts/expand_composer_json.php
if [[ ! -f composer.json ]]; then
echo "{}" > composer.json
_ddev_drupal_contrib_empty_composer=true
fi
php expand_composer_json.php "$DDEV_SITENAME"
rm -f expand_composer_json.php
if [ "$_ddev_drupal_contrib_empty_composer" = true ]; then
rm -f composer.json
fi
......@@ -12,4 +12,4 @@ if ! command -v phpcbf >/dev/null; then
exit 1
fi
test -e phpcs.xml.dist || curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/assets/phpcs.xml.dist
phpcbf -s --report-full --report-summary --report-source web/modules/custom "$@"
phpcbf -s --report-full --report-summary --report-source $DDEV_DOCROOT/modules/custom "$@"
......@@ -12,4 +12,4 @@ if ! command -v phpcs >/dev/null; then
exit 1
fi
test -e phpcs.xml.dist || curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/assets/phpcs.xml.dist
phpcs -s --report-full --report-summary --report-source web/modules/custom --ignore=*/.ddev/* "$@"
phpcs -s --report-full --report-summary --report-source $DDEV_DOCROOT/modules/custom --ignore=*/.ddev/* "$@"
......@@ -5,7 +5,6 @@
## Description: Run phpstan inside the web container
## Usage: phpstan [flags] [args]
## Example: "ddev phpstan" or "ddev phpstan -n"
## ProjectTypes: drupal,drupal8,drupal9,drupal10
## ExecRaw: true
if ! command -v phpstan >/dev/null; then
......@@ -13,6 +12,8 @@ if ! command -v phpstan >/dev/null; then
exit 1
fi
test -e phpstan.neon || curl -OL https://git.drupalcode.org/project/gitlab_templates/-/raw/default-ref/assets/phpstan.neon
# See https://git.drupalcode.org/project/gitlab_templates/-/commit/a107b7f1f79af12e0b09f70be47b68e3f69b4504
sed -i 's/BASELINE_PLACEHOLDER/phpstan-baseline.neon/g' phpstan.neon
# Add an empty baseline file to ensure it exists.
test -e phpstan-baseline.neon || touch phpstan-baseline.neon
phpstan analyse $DDEV_DOCROOT/modules/custom "$@"
......@@ -7,12 +7,11 @@
## Example: "ddev stylelint"
## ExecRaw: true
# Changed to follow https://github.com/ddev/ddev-drupal-contrib/pull/83
if $DDEV_DOCROOT/core/node_modules/.bin/stylelint --version >/dev/null ; then
# Change directory to the project root folder
cd "$DDEV_DOCROOT/modules/custom/${DDEV_SITENAME//-/_}" || exit
"$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/node_modules/.bin/stylelint" --color --config "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/.stylelintrc.json" "./**/*.css" "$@"
# Change directory to the project root folder
cd "$DDEV_DOCROOT/modules/custom/${DDEV_SITENAME//-/_}" || exit
"$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/node_modules/.bin/stylelint" --color --config "$DDEV_COMPOSER_ROOT/$DDEV_DOCROOT/core/.stylelintrc.json" "./**/*.css" "$@"
else
echo "stylelint is not available. You may need to 'ddev yarn --cwd $DDEV_DOCROOT/core install'"
echo "stylelint is not available. You may need to 'ddev exec \"cd $DDEV_DOCROOT/core && yarn install\"'"
exit 1
fi
#ddev-generated
## Command provided by https://github.com/ddev/ddev-drupal-contrib
web_environment:
# If desired, override to a different version of Drupal core in via the project's DDEV config
- DRUPAL_CORE=^10
# To change the Drupal core version, see the README:
# https://github.com/ddev/ddev-drupal-contrib/blob/main/README.md#changing-the-drupal-core-version
- DRUPAL_CORE=^11
- SIMPLETEST_DB=mysql://db:db@db/db
- SIMPLETEST_BASE_URL=http://web
- BROWSERTEST_OUTPUT_DIRECTORY=/tmp
......
......@@ -3,8 +3,8 @@
/.gitattributes
/.prettierignore
/.prettierrc.json
/phpcs.xml.dist
/phpstan-baseline.neon
/phpstan.neon
/recipes/
/vendor/
/web/
......@@ -22,11 +22,15 @@
"drupal/message_notify": "^1.0"
},
"require-dev": {
"drupal/coder": "8.3.26",
"drupal/rules": "^4.0",
"drush/drush": "^12.5 || ^13"
"drupal/symfony_mailer_lite": "^2.0",
"drush/drush": "^12.5 || ^13.3"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"php-http/discovery": true,
"tbachert/spi": true
}
......
......@@ -26,6 +26,10 @@ private_message.settings:
ban_mode:
type: string
label: 'The blocking mode.'
constraints:
Choice:
- passive
- active
ban_message:
type: string
label: 'The message to show to the user when they are blocked.'
......
.private-message-dimmer {
position: absolute;
top: 0;
left: 0;
display: none;
width: 100%;
height: 100%;
background-color: #000;
}
.private-message-dimmer {
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
background-color: #000;
display: none;
}
#thread-members-display-container {
position: relative;
}
#thread-members-display-container + * {
clear: both;
}
#thread-members-display-container #pm-members-autocomplete-results-wrapper {
position: absolute;
}
#thread-members-display-container .private-message-member-display-item {
float: left;
margin: 2px 4px 1em;
background-color: #e4e4e4;
}
#thread-members-display-container
.private-message-member-display-item
.pm-username {
float: left;
padding: 4px 7px 4px 3px;
}
#thread-members-display-container
.private-message-member-display-item
.pm-username-remove-link {
display: block;
float: left;
padding: 4px 4px 5px;
cursor: pointer;
border-left: dotted black 1px;
}
#thread-members-display-container #thread-members-input {
margin-bottom: 0;
}
#thread-members-display-container .pm-autocomplete-search-result {
display: block;
height: 100%;
}
#thread-members-display-container .invalid-username {
color: #f00;
font-weight: bold;
}
#thread-members-display-container {
position:relative;
&+ * {
clear:both;
}
#pm-members-autocomplete-results-wrapper {
position:absolute;
}
.private-message-member-display-item {
background-color:#E4E4E4;
margin:2px 4px 1em;
float:left;
.pm-username{
float:left;
padding: 4px 7px 4px 3px;
}
.pm-username-remove-link{
border-left:dotted black 1px;
padding:4px 4px 5px;
display:block;
float:left;
cursor:pointer;
}
}
#thread-members-input {
margin-bottom:0;
}
.pm-autocomplete-search-result {
display:block;
height:100%;
}
.invalid-username {
color:#FF0000;
font-weight:bold;
}
}
......@@ -71,12 +71,3 @@
border-bottom: none;
font-size: 0.8em;
}
#private-message-page #private-message-thread-dimmer {
position: absolute;
top: 0;
left: 0;
display: none;
width: 100%;
height: 100%;
background-color: #000;
}
......@@ -62,14 +62,4 @@
}
}
}
#private-message-thread-dimmer {
position:absolute;
top:0;
left:0;
height:100%;
width:100%;
background-color:#000;
display:none;
}
}
\ No newline at end of file
}
/**
* @file
* Adds JavaScript functionality to the dimmer.
*/
((Drupal) => {
/**
* Handles the "Dimmer" functionality.
*/
Drupal.PrivateMessageDimmer = {
dimmerClass: 'private-message-dimmer',
fader: null,
/**
* Shows the dimmer.
*
* @param {HTMLElement} element
* The element where the dimmer will be added.
*/
showDimmer(element) {
let dimmer = this.getDimmer();
if (!dimmer) {
dimmer = document.createElement('div');
dimmer.classList.add(this.dimmerClass);
element.appendChild(dimmer);
this.fader = new Drupal.PrivateMessageFader(dimmer);
}
if (this.fader) {
this.fader.fadeTo(500, 0.8);
}
},
/**
* Hides the dimmer.
*/
hideDimmer() {
if (!this.fader) {
return;
}
this.fader.fadeOut(500);
},
/**
* Gets dimmer.
*
* @return {HTMLElement}
* The dimmer element, if found.
*/
getDimmer() {
return document.querySelector(`.${this.dimmerClass}`);
},
};
})(Drupal);
/**
* @file
* Adds JavaScript functionality for fader.
*/
((Drupal) => {
/**
* Handles the "Fader" functionality.
*/
class PrivateMessageFader {
constructor(element) {
this.element = element;
this.queue = Promise.resolve();
}
/**
* Shows the element.
*/
_ensureVisible() {
const style = getComputedStyle(this.element);
if (style.display === 'none') {
this.element.style.display = '';
if (getComputedStyle(this.element).display === 'none') {
this.element.style.display = 'block';
}
}
}
/**
* Creates a Promise-based animation.
*
* @param {number} duration
* Duration
* @param {function} callback
* Callback function.
*
* @return {Promise<unknown>}
* Promise.
*/
static _animate(duration, callback) {
return new Promise((resolve) => {
const startTime = performance.now();
const animate = (time) => {
const elapsedTime = time - startTime;
const progress = Math.min(elapsedTime / duration, 1);
callback(progress);
if (progress < 1) {
requestAnimationFrame(animate);
} else {
resolve();
}
};
requestAnimationFrame(animate);
});
}
/**
* Fades to a specific opacity
*
* @param {number} duration
* Duration.
* @param {number} targetOpacity
* Target opacity.
*/
fadeTo(duration, targetOpacity) {
this.queue = this.queue.then(() => {
this._ensureVisible();
const startOpacity = parseFloat(getComputedStyle(this.element).opacity);
return PrivateMessageFader._animate(duration, (progress) => {
this.element.style.opacity =
startOpacity + progress * (targetOpacity - startOpacity);
});
});
}
/**
* Fades out to opacity 0 and hide the element
*
* @param {number} duration
* Duration.
*/
fadeOut(duration) {
this.queue = this.queue.then(() => {
const startOpacity = parseFloat(getComputedStyle(this.element).opacity);
return PrivateMessageFader._animate(duration, (progress) => {
this.element.style.opacity = startOpacity - progress * startOpacity;
if (progress === 1) {
this.element.style.display = 'none';
}
});
});
}
}
Drupal.PrivateMessageFader = PrivateMessageFader;
})(Drupal);