Skip to content

Commit

Permalink
Merge branch 'develop' into fix/1468-dynamic-callback-format
Browse files Browse the repository at this point in the history
  • Loading branch information
delawski authored Jul 22, 2024
2 parents 6267d62 + 159e61f commit c24ec47
Show file tree
Hide file tree
Showing 189 changed files with 8,922 additions and 8,804 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ jobs:
lint:
name: Lint and Test
runs-on: ubuntu-22.04
permissions:
contents: read
packages: read
steps:

- name: Checkout
Expand All @@ -24,6 +27,24 @@ jobs:
php-version: '8.1'
tools: composer:v2

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer packages
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-php-${{ hashFiles( 'composer.lock' ) }}
restore-keys: ${{ runner.os }}-php-

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Install NPM dependencies
run: npm install

Expand All @@ -33,11 +54,11 @@ jobs:
- name: Lint
run: npm run lint

- name: Pull Docker Images
run: docker-compose pull wordpress
- name: Pull custom Docker images
run: docker compose pull wordpress

- name: Test PHP
run: npm run phpunit
- name: Test
run: npm run test

- name: Build
run: npm run build
40 changes: 40 additions & 0 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build and Publish Docker Images

on:
push:
paths:
- '.github/workflows/**'
- 'docker-compose.yml'
- 'docker-compose.build.yml'
- 'local/docker/**'

jobs:

build-and-push-image:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build images
run: docker compose --file docker-compose.build.yml build

- name: Publish images
if: contains( github.ref_name, 'master' )
run: docker buildx bake --file docker-compose.build.yml --push --set '*.platform=linux/amd64,linux/arm64'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
/vendor/
/build/
/dist/
/.vagrant/
/console.log
/phpcs.xml
/stream.zip
/stream-*.zip
npm-debug.log
debug.log
package.lock
.phpunit.result.cache

# Compiled files
ui/js/*.min.js
Expand Down
95 changes: 0 additions & 95 deletions .travis.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"name": "Listen for Stream XDebug",
"type": "php",
"request": "launch",
"port": 9000,
"port": 9003,
"ignore": [
"vendor/"
],
"pathMappings": {
"/var/www/html/wp-content/plugins/stream-src": "${workspaceRoot}",
"/var/www/html/wp-content/plugins/stream": "${workspaceRoot}/build",
"/var/www/html": "${workspaceRoot}/local/public"
"/var/www/html/wp-content/plugins/stream-src": "${workspaceFolder}",
"/var/www/html/wp-content/plugins/stream": "${workspaceFolder}/build",
"/var/www/html": "${workspaceFolder}/local/public"
}
}
]
Expand Down
13 changes: 0 additions & 13 deletions Vagrantfile

This file was deleted.

14 changes: 6 additions & 8 deletions alerts/class-alert-trigger-action.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,14 @@ public function get_display_value( $context = 'normal', $alert = null ) {
if ( empty( $action ) ) {
$action = __( 'performed any action on', 'stream' );
}
} else {
if ( empty( $action ) ) {
} elseif ( empty( $action ) ) {
$action = __( 'Any Action', 'stream' );
} else {
$actions = $this->plugin->connectors->term_labels['stream_action'];
if ( ! empty( $actions[ $action ] ) ) {
$action = $actions[ $action ];
}
$action = ucfirst( $action );
} else {
$actions = $this->plugin->connectors->term_labels['stream_action'];
if ( ! empty( $actions[ $action ] ) ) {
$action = $actions[ $action ];
}
$action = ucfirst( $action );
}

return ucfirst( $action );
Expand Down
4 changes: 1 addition & 3 deletions alerts/class-alert-trigger-context.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,8 @@ public function get_display_value( $context = 'normal', $alert = null ) {
$term_labels = $this->get_terms_labels( 'context' );
if ( ! empty( $term_labels[ $connector ]['children'][ $context ] ) ) {
$context = $term_labels[ $connector ]['children'][ $context ];
} else {
if ( ! empty( $term_labels[ $connector ]['label'] ) ) {
} elseif ( ! empty( $term_labels[ $connector ]['label'] ) ) {
$context = $term_labels[ $connector ]['label'];
}
}
}

Expand Down
10 changes: 5 additions & 5 deletions alerts/class-alert-type-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function alert( $record_id, $recordarr, $alert ) {
$user = get_user_by( 'id', $user_id );

// translators: Placeholder refers to a username (e.g. "administrator").
$message .= sprintf( __( "User:\t%s", 'stream' ), $user->user_login ) . "\n";
$message .= sprintf( __( "User:\t%s", 'stream' ), ! empty( $user->user_login ) ? $user->user_login : __( 'unknown', 'stream' ) ) . "\n";

if ( ! empty( $alert->alert_meta['trigger_context'] ) ) {
$context = $this->plugin->alerts->alert_triggers['context']->get_display_value( 'list_table', $alert );
Expand Down Expand Up @@ -146,26 +146,26 @@ public function display_fields( $alert ) {
echo '<span class="wp_stream_alert_type_description">' . esc_html__( 'Send a notification email to the recipient.', 'stream' ) . '</span>';
echo '<label for="wp_stream_email_recipient"><span class="title">' . esc_html__( 'Recipient', 'stream' ) . '</span>';
echo '<span class="input-text-wrap">';
echo $form->render_field(
$form->render_field(
'text',
array(
'name' => 'wp_stream_email_recipient',
'title' => esc_attr( __( 'Email Recipient', 'stream' ) ),
'value' => $options['email_recipient'],
)
); // Xss ok.
);
echo '</span></label>';

echo '<label for="wp_stream_email_subject"><span class="title">' . esc_html__( 'Subject', 'stream' ) . '</span>';
echo '<span class="input-text-wrap">';
echo $form->render_field(
$form->render_field(
'text',
array(
'name' => 'wp_stream_email_subject',
'title' => esc_attr( __( 'Email Subject', 'stream' ) ),
'value' => $options['email_subject'],
)
); // Xss ok.
);
echo '</span></label>';
}

Expand Down
5 changes: 2 additions & 3 deletions alerts/class-alert-type-highlight.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,15 @@ public function display_fields( $alert ) {
echo '<span class="wp_stream_alert_type_description">' . esc_html__( 'Highlight this alert on the Stream records page.', 'stream' ) . '</span>';
echo '<label for="wp_stream_highlight_color"><span class="title">' . esc_html__( 'Color', 'stream' ) . '</span>';
echo '<span class="input-text-wrap">';
echo $form->render_field(
$form->render_field(
'select',
array(
'name' => 'wp_stream_highlight_color',
'title' => esc_attr( __( 'Highlight Color', 'stream' ) ),
'options' => $this->get_highlight_options(),
'value' => $options['color'],
)
); // Xss ok.
);
echo '</span></label>';
}

Expand Down Expand Up @@ -206,7 +206,6 @@ public function save_fields( $alert ) {
} else {
$alert->alert_meta['color'] = $input_color;
}

}

/**
Expand Down
Loading

0 comments on commit c24ec47

Please sign in to comment.