Skip to content

Commit 663c6b3

Browse files
author
Marco Pereirinha
committed
Merge branch 'develop' into feature/hide-connection-string
2 parents e1d0869 + d1f841f commit 663c6b3

7 files changed

Lines changed: 551 additions & 302 deletions

File tree

css/cloudinary.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 517 additions & 291 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@
146146
"terser-webpack-plugin": "^4.2.3",
147147
"tippy.js": "^6.3.1",
148148
"typescript": "^4.0.5",
149-
"webpack": "^5.76.0",
149+
"webpack": "^5.94.0",
150150
"webpack-cli": "^4.2.0",
151151
"webpackbar": "^5.0.2"
152152
},

php/class-dashboard.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ public function no_assets() {
6060
* @return array
6161
*/
6262
public function register_settings( $pages ) {
63+
64+
$plugin = $this->plugin;
65+
6366
$pages['dashboard'] = array(
6467
'page_title' => __( 'Cloudinary Dashboard', 'cloudinary' ),
6568
'menu_title' => __( 'Dashboard', 'cloudinary' ),
@@ -154,7 +157,7 @@ public function register_settings( $pages ) {
154157
'cld-toggle',
155158
'hidden',
156159
),
157-
'title' => __( 'View errored assets', 'cloudinary' ),
160+
'title' => __( 'View errored assets', 'cloudinary' ),
158161
),
159162
),
160163
array(
@@ -183,7 +186,7 @@ public function register_settings( $pages ) {
183186
'cld-toggle',
184187
'hidden',
185188
),
186-
'title' => __( 'Retry sync assets with errors', 'cloudinary' ),
189+
'title' => __( 'Retry sync assets with errors', 'cloudinary' ),
187190
),
188191
),
189192
),
@@ -357,7 +360,11 @@ public function register_settings( $pages ) {
357360
),
358361
array(
359362
'type' => 'panel',
360-
'title' => __( 'Plan details', 'cloudinary' ),
363+
'title' => function () use ( $plugin ) {
364+
$cloud_name = $plugin->components['connect']->get_cloud_name();
365+
/* Translators: placeholder is the Cloudinary cloud name. */
366+
return sprintf( __( 'Plan details for @%s', 'cloudinary' ), esc_html( $cloud_name ) );
367+
},
361368
array(
362369
'type' => 'plan_details',
363370
),

php/traits/trait-params.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,15 @@ protected function set_param_array( $parts, $param, $value ) {
5353
return $new;
5454
}
5555

56-
if ( '' === $key ) {
57-
$new[] = $value;
56+
if ( is_array( $new ) ) {
57+
if ( '' === $key ) {
58+
$new[] = $value;
59+
} else {
60+
$new[ $key ] = $value;
61+
}
5862
} else {
59-
$new[ $key ] = $value;
63+
// There's likely a problem here, as we're setting an array key on a non-array.
64+
$new = array();
6065
}
6166
// @TODO: I took ksort out, need to check that it doesn't have any problems being.
6267

src/css/components/ui/_ui-components.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
font-size: $size-panel-description;
5858
}
5959

60+
.cloudname {
61+
font-style: italic;
62+
}
63+
6064
.button:not(.wp-color-result) {
6165
background-color: $color-cld-blue;
6266
color: #fff;

ui-definitions/settings-sidebar.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,17 @@
2020
'type' => 'panel',
2121
'title' => __( 'Account status', 'cloudinary' ),
2222
'description' => function () {
23-
$data = get_plugin_instance()->settings->get_value( 'last_usage' );
23+
$plugin = get_plugin_instance();
24+
$data = $plugin->settings->get_value( 'last_usage' );
25+
$cloud_name = $plugin->components['connect']->get_cloud_name();
2426

25-
return $data['plan'];
27+
ob_start();
28+
?>
29+
<?php echo esc_html( $data['plan'] ); ?>
30+
<br />
31+
<span class="cld-ui-description-cloudname cloudname">@<?php echo esc_html( $cloud_name ); ?></span>
32+
<?php
33+
return ob_get_clean();
2634
},
2735
'collapsible' => 'open',
2836
array(
@@ -65,7 +73,6 @@
6573

6674
/* translators: %s is the percentage optimized. */
6775
return sprintf( __( '%s Optimized', 'cloudinary' ), $percentage );
68-
6976
},
7077
'collapsible' => 'closed',
7178
array(

0 commit comments

Comments
 (0)