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

Refactor / update (wip) #1

Merged
merged 18 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# For more information about the properties used in this file,
# please see the EditorConfig documentation:
# http://editorconfig.org

[*]
charset = utf-8
end_of_line = lf
Expand All @@ -10,8 +6,15 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[{*.yml,*.json}]
[*.md]
trim_trailing_whitespace = false

[*.{yml,js,json,css,scss,eslintrc,feature}]
indent_size = 2
indent_style = space

[package.json]
indent_size = 2

[{*.ss}]
indent_style = tab
[composer.json]
indent_size = 4
14 changes: 12 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,12 @@
# Auto detect text files and perform LF normalization
* text=auto
/tests export-ignore
/docs export-ignore
/client/src export-ignore
/.editorconfig export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.php-cs-fixer.dist.php export-ignore
/phpunit.xml.dist export-ignore
/.waratah export-ignore
/code-of-conduct.md export-ignore
/CONTRIBUTING.md export-ignore
/README.md export-ignore
13 changes: 13 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: CI

on:
pull_request: null

jobs:
Silverstripe:
name: 'Silverstripe (bundle)'
uses: nswdpc/ci-files/.github/workflows/[email protected]
PHPStan:
name: 'PHPStan (analyse)'
uses: nswdpc/ci-files/.github/workflows/[email protected]
needs: Silverstripe
17 changes: 5 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
Thumbs.db
web.config
.log
.buildpath
.project
.settings
.idea
/client/node_modules
/vendor/
.DS_Store
._.DS_Store
.codekit
.sublime-*
.sass-cache
prepros.cfg
/.php-cs-fixer.cache
/public/
/composer.lock
node_modules
69 changes: 0 additions & 69 deletions .scrutinizer.yml

This file was deleted.

File renamed without changes.
83 changes: 18 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,35 @@
# Silverstripe embed

[![ko-fi](https://www.ko-fi.com/img/donate_sm.png)](https://ko-fi.com/E1E5HWRR)

Adds embed and video a dataobject along with dataextension to apply embed to existing objects.
This module adds embed functionality to data objects

## Installation
Composer is the recommended way of installing SilverStripe modules.

The only supported method of installing this module is via composer:

```
composer require gorriecoe/silverstripe-embed
```

## Requirements

- silverstripe/framework ^4.0
- silverstripe/framework ^5

## Maintainers

- [Gorrie Coe](https://github.com/gorriecoe)
+ PD web team
+ Original maintainer: Gorrie Coe


## Usage
Relationship to Embed Dataobjects
```php
use gorriecoe\Embed\Models\Embed;

class ClassName extends DataObject
{
private static $has_one = [
'Embed' => Embed::class,
'Video' => Video::class
];

public function getCMSFields()
{
...
$fields->addFieldsToTab(
'Main',
[
HasOneButtonField::create(
'Embed',
'Embed',
$this
),
HasOneButtonField::create(
'Video',
'Video',
$this
)
]
);
...
}
}

```
Update current DataObject to be Embeddable with DataExtension
```php
use gorriecoe\Embed\Extensions\Embeddable;

class ClassName extends DataObject
{
private static $extensions = [
Embeddable::class,
];

/**
* List the allowed included embed types. If null all are allowed.
* @var array
*/
private static $allowed_embed_types = [
'video',
'photo'
];

/**
* Defines tab to insert the embed fields into.
* @var string
*/
private static $embed_tab = 'Main';
}
See [documentation for usage](./docs/en/001_index.md).

```
## Legacy

Copyright: see [LICENSE.md](./LICENSE.md), with additions and improvements

This is a fork of Gorrie Coe's [embed module](https://github.com/gorriecoe/silverstripe-embed). We have maintained the following link from the original module:

[![ko-fi](https://www.ko-fi.com/img/donate_sm.png)](https://ko-fi.com/E1E5HWRR)

[Further information](https://github.com/elliot-sawyer/silverstripe-link/issues/31).
2 changes: 1 addition & 1 deletion _config/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
Name: embedconfig
Name: nswdpc-silverstripe-embed
---
1 change: 1 addition & 0 deletions code-of-conduct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
When having discussions about this module in issues or pull request please adhere to the [SilverStripe Community Code of Conduct](https://docs.silverstripe.org/en/contributing/code_of_conduct).
73 changes: 51 additions & 22 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,54 @@
{
"name": "gorriecoe/silverstripe-embed",
"description": "Adds embed and video a dataobject along with dataextension to apply embed to existing objects.",
"type": "silverstripe-vendormodule",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Gorrie Coe",
"email": "[email protected]"
"name": "nswdpc/silverstripe-embed",
"description": "Adds embed functionality to data objects.",
"type": "silverstripe-vendormodule",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Gorrie Coe",
"email": "[email protected]",
"role": "Original author"
},
{
"name": "PD web team",
"role": "Maintainer"
}
],
"keywords": [
"silverstripe",
"cms",
"embed"
],
"homepage": "http://github.com/nswdpc/silverstripe-embed",
"require": {
"embed/embed": "^4.4",
"silverstripe/framework": "^5",
"silverstripe/asset-admin": "^2"
},
"require-dev": {
"cambis/silverstripe-rector": "^0.5.1",
"phpunit/phpunit": "^9.5",
"syntro/silverstripe-phpstan": "^5",
"nswdpc/ci-files": "^1"
},
"repositories": [
{
"type": "git",
"url": "https://github.com/nswdpc/ci-files.git"
}
],
"autoload": {
"psr-4": {
"NSWDPC\\Embed\\": "src/",
"NSWDPC\\Embed\\Tests\\": "tests/"
}
},
"config": {
"allow-plugins": {
"composer/installers": true,
"silverstripe/recipe-plugin": true,
"silverstripe/vendor-plugin": true,
"phpstan/extension-installer": true
}
}
],
"keywords": [
"silverstripe",
"cms",
"embed"
],
"homepage": "http://github.com/gorriecoe/silverstripe-embed",
"require": {
"silverstripe/framework": "^4",
"gorriecoe/silverstripe-htmltag": "^1.0"
},
"extra": {
"installer-name": "embed"
}
}
Loading