Skip to content

Commit 4fe03fb

Browse files
authored
Merge pull request #15 from dubinc/feature/svn-deploys
Feature/svn deploys
2 parents cae4708 + 877a4a8 commit 4fe03fb

7 files changed

Lines changed: 39 additions & 44 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ jobs:
8989
- name: Upload artifact
9090
uses: actions/upload-artifact@v4
9191
with:
92-
name: dubinc-plugin
93-
path: dubinc.zip
92+
name: dubinc
93+
path: /tmp/dubinc
9494
retention-days: 30

assets/js/admin/dubco-meta-box.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ window.jQuery(document).ready(function ($) {
6161
}
6262
} catch (error) {
6363
console.error(error);
64-
$('#dubco_error').addClass('error').text(error).show();
64+
$('#dubco_error').addClass('error').text(error?.message || error).show();
6565
} finally {
6666
$(this).text(wp.i18n.__('Update', 'dubinc'));
6767
}

assets/js/editor/components/dubco-side-panel.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ const MetaBox = ({ postStatus, metaFields, setMetaFields, postId }) => {
3030
const [error, setError] = useState('');
3131
const [isLoading, setIsLoading] = useState(false);
3232

33-
const { _dubco_short_url, _dubco_short_url_id, _dubco_short_url_error } =
34-
metaFields;
33+
const { _dubco_short_url, _dubco_short_url_id, _dubco_short_url_error } = metaFields;
3534

3635
useEffect(() => {
3736
if (_dubco_short_url) {
@@ -120,9 +119,7 @@ const MetaBox = ({ postStatus, metaFields, setMetaFields, postId }) => {
120119
)}
121120
</div>
122121
{error && <Notice status="error">{error}</Notice>}
123-
<AnalitycsLink
124-
shortLink={_dubco_short_url}
125-
/>
122+
<AnalitycsLink shortLink={_dubco_short_url} />
126123
</>
127124
)}
128125
{!_dubco_short_url && (

dist/js/editor.asset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '5605b62c6a63015b5f7b');
1+
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-components', 'wp-compose', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-plugins'), 'version' => '25e82788ac7ce4ccbfb3');

dist/js/editor.js

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

includes/classes/Rest/Links.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function register_routes() {
2727

2828
register_rest_route(
2929
'dubco/v1',
30-
'/links/(?P<id>[a-zA-Z0-9]+)',
30+
'/links/(?P<id>[a-zA-Z0-9_]+)',
3131
[
3232
'methods' => WP_REST_Server::EDITABLE,
3333
'callback' => [ $this, 'update_link' ],
@@ -61,7 +61,6 @@ public function create_link( $request ) {
6161
}
6262

6363
public function update_link( $request ) {
64-
// Handle PATCH request to update an existing link
6564
$id = $request->get_param( 'id' );
6665
$params = $request->get_params();
6766

@@ -86,7 +85,6 @@ public function update_link( $request ) {
8685
}
8786

8887
public function permissions_check( $request ) {
89-
// Check if the user has permission to perform the action
9088
return current_user_can( 'edit_posts' );
9189
}
9290
}

package.json

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
{
2-
"name": "dubinc",
3-
"version": "1.0.0",
4-
"scripts": {
5-
"start": "npm run watch",
6-
"watch": "10up-toolkit watch --port=5010 --hot",
7-
"build": "10up-toolkit build",
8-
"format-js": "10up-toolkit format-js",
9-
"lint-js": "10up-toolkit lint-js",
10-
"lint-style": "10up-toolkit lint-style",
11-
"lint-php": "./vendor/bin/phpcs ./includes --standard=ruleset.xml",
12-
"fix-php": "./vendor/bin/phpcbf ./includes --standard=ruleset.xml",
13-
"test": "10up-toolkit test-unit-jest",
14-
"clean-dist": "rm -rf ./dist"
15-
},
16-
"engines": {
17-
"node": ">=18.0.0"
18-
},
19-
"devDependencies": {
20-
"10up-toolkit": "^6.2.0"
21-
},
22-
"dependencies": {
23-
"prop-types": "^15.7.2"
24-
},
25-
"10up-toolkit": {
26-
"entry": {
27-
"admin": "./assets/js/admin/admin.js",
28-
"frontend": "./assets/js/frontend/frontend.js",
29-
"shared": "./assets/js/shared/shared.js",
30-
"editor": "./assets/js/editor/index.js"
2+
"name": "dubinc",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"start": "npm run watch",
6+
"watch": "10up-toolkit watch --port=5010",
7+
"build": "10up-toolkit build",
8+
"format-js": "10up-toolkit format-js",
9+
"lint-js": "10up-toolkit lint-js",
10+
"lint-style": "10up-toolkit lint-style",
11+
"lint-php": "./vendor/bin/phpcs ./includes --standard=ruleset.xml",
12+
"fix-php": "./vendor/bin/phpcbf ./includes --standard=ruleset.xml",
13+
"test": "10up-toolkit test-unit-jest",
14+
"clean-dist": "rm -rf ./dist"
15+
},
16+
"engines": {
17+
"node": ">=18.0.0"
18+
},
19+
"devDependencies": {
20+
"10up-toolkit": "^6.2.0"
21+
},
22+
"dependencies": {
23+
"prop-types": "^15.7.2"
24+
},
25+
"10up-toolkit": {
26+
"entry": {
27+
"admin": "./assets/js/admin/admin.js",
28+
"frontend": "./assets/js/frontend/frontend.js",
29+
"shared": "./assets/js/shared/shared.js",
30+
"editor": "./assets/js/editor/index.js"
31+
}
3132
}
32-
}
33-
}
33+
}

0 commit comments

Comments
 (0)