Skip to content
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

Add ability to input values for license and creator for every chart #794

Closed
vytisbulkevicius opened this issue Apr 7, 2021 · 4 comments · Fixed by #799 or #803
Closed

Add ability to input values for license and creator for every chart #794

vytisbulkevicius opened this issue Apr 7, 2021 · 4 comments · Fixed by #799 or #803
Assignees
Labels
enhancement Request to improve or optimize an existing feature or functionality in the project released Indicate that an issue has been resolved and released in a particular version of the product.

Comments

@vytisbulkevicius
Copy link
Contributor

Description:

Schema.org @dataset is added to the chart if the Title and description are filled: https://vertis.d.pr/qdMpO5

Schema on the page - https://vertis.d.pr/QZQp4r

This works fine, however, when checking on Google structure data testing tool, there are warnings about adding two optional/recommended properties (license and creator):
https://vertis.d.pr/vbFu9u

There are many optional properties - https://developers.google.com/search/docs/data-types/dataset#dataset
However, warnings are thrown only for license and creator.

This doesn't break schema but as these are only 2 properties throwing warnings maybe we can add fields to the plugin's UI and allow users to input values for these 2 properties?

Alternatives:

An alternative is to use a filter and modify the string of Schema, for example to add license (to all charts):
add_filter( 'visualizer_schema', function( $schema, $chart_id ) {
			$schema = str_replace('
			}', ',
			  "license":"https://urlicense.com"
			}', $schema);

		return $schema;
	}, 10, 2 );

Or per chart -

add_filter( 'visualizer_schema', function( $schema, $chart_id ) {
if ($chart_id = 13) {
$schema = '{
"@context":"https://schema.org/",
"@type":"Dataset",
"name":"Title of your chart that will replace what is set in Visualizer",
"description":"Description of your chart that will replace description set in Chart settings",
"license":"https://creativecommons.org/publicdomain/zero/1.0/"
}';
}
return $schema;
}, 10, 2 );

For users that have many charts, this is not a very practical approach.

Ticket - https://secure.helpscout.net/conversation/1468413923/272924/

@vytisbulkevicius vytisbulkevicius added the enhancement Request to improve or optimize an existing feature or functionality in the project label Apr 7, 2021
@girishpanchal30
Copy link
Contributor

@vytisbulkevicius As per the requirement, we have added 2 new fields (Creator and License) in chart settings. Now the warnings are disspeared.

QA steps

  1. You need to create a new chart or you need to edit the existing chart.
  2. Go to the Settings tab from the right-hand side for the open chart.
  3. Open/Expand General Settings from Settings tab.
  4. Expand the Title & Description fields to enter values for the chart.
  5. Expand additional new fields License & Creator fields and add the value to it.
  6. Click to Create chart / Save chart for adding/updating value of the chart.

We have a question for the following chats.

  1. Gauge
  2. Timeline
  3. Polar Area
  4. Radar/Spider
  5. Geo
  6. Table

Is there any reason you haven't added the description field in settings for all the above charts?

We will not able to add (Creator and License) fields for all the above charts because the description field is required to validate chart schema.

To fix the above issue, we need to add a description field for all the charts.

@girishpanchal30 girishpanchal30 linked a pull request May 3, 2021 that will close this issue
@selul
Copy link
Contributor

selul commented May 4, 2021

@girishkrishaweb if the description field is required to validate it, we can add it.

@girishpanchal30
Copy link
Contributor

Ok sure. Let me add it. @selul

@selul selul linked a pull request May 25, 2021 that will close this issue
@selul selul mentioned this issue May 25, 2021
selul added a commit that referenced this issue May 25, 2021
#### Fixes: 
- Fix compatibility with 3rd party plugins which use the same js library as Visualizer #801 
- Fix fatal error when a new chart is created on PHP 8 #795 
- Chart doesn't get refreshed automatically when the JSON endpoint is used as the data source
 
#### Features: 
- Adds option to add schema.org Dataset for license and creator #794
pirate-bot pushed a commit that referenced this issue May 25, 2021
##### [Version 3.5.1](v3.5.0...v3.5.1) (2021-05-25)

- Fix compatibility with 3rd party plugins which use the same js library as Visualizer [#801](#801)
- Fix fatal error when a new chart is created on PHP 8 [#795](#795)
- Chart doesn't get refreshed automatically when the JSON endpoint is used as the data source

#### Features:
- Adds option to add schema.org Dataset for license and creator [#794](#794)
@pirate-bot
Copy link
Contributor

🎉 This issue has been resolved in version 3.5.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request to improve or optimize an existing feature or functionality in the project released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants