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

[WIP] Setcontent refactor #303

Closed
wants to merge 13 commits into from

Conversation

stryxx
Copy link
Collaborator

@stryxx stryxx commented Feb 1, 2019

No description provided.

@bobdenotter
Copy link
Member

bobdenotter commented Feb 1, 2019

@xiaohutai Could you also take a look at this? :-)

See also #194

@stryxx stryxx changed the title A concept of... [WIP] A concept of... Feb 1, 2019
src/Twig/Node/SetcontentNode.php Outdated Show resolved Hide resolved
src/Storage/Query/Query.php Outdated Show resolved Hide resolved
@JarJak JarJak changed the title [WIP] A concept of... [WIP] Setcontent refactor Feb 14, 2019
@stryxx stryxx changed the base branch from master to feature/related-content February 26, 2019 13:42
src/Entity/Content.php Outdated Show resolved Hide resolved
src/Repository/ContentRepository.php Outdated Show resolved Hide resolved
@JarJak
Copy link
Member

JarJak commented Feb 27, 2019

@stryxx rebase to master

@stryxx stryxx changed the base branch from feature/related-content to master February 28, 2019 06:59
@JarJak
Copy link
Member

JarJak commented Mar 1, 2019

Checklist copied from #116. API won't be 100% the same, but functionality should be kept.

Basic

  • {contenttype}
  • {contenttype}/first/{number}
  • {contenttype}/last/{number}
  • {contenttype}/random/{number}
  • random is not going to work with Doctrine ORM queries, see answer on Stack Oveflow for info.
    • ⚠️ An alternative is to make a special Twig function/filter to handle random records.
  • {contenttype}/{id}
  • {contenttype}/{slug}

WHERE

  • {key}: {value}
  • {key}: {operator}{value} where operator is one of % < > <= >=
    • ⚠️ Currently the operations will not work for numbers/dates/etc. because of JSON-encoded values.
  • author: {id} replaces ownerid from Bolt 3

WHERE advanced

  • {key}: {value1} || {value2} or {key}: {value1} && {value2}
  • "{key1} ||| {key2}": "{value1} ||| {value2}"
  • {key}: '>now' and other special datetime selectors (e.g. now, today, yesterday, last year, next thursday).

Special

  • limit {number}
  • orderby {field} or orderby -{field}
    • ⚠️ This works for fields that have only a single value (think of it as a column)
    • Multiple sortorders (comma-separated)
  • returnsingle
  • printquery
    • ⚠️ Currently shows DQL. Let's see if we can show a runnable query instead.

Advanced

Pagination and Search are not implemented yet.

  • allowpaging
  • {contenttype}/search/{num} where filter: {term}
  • {ct1},{ct2},{ctN}/search/{num} where filter: {term}

Misc

  • Implementations for locales, taxonomies and relationships.
  • Proper integration with Config + ContentType data (such as max results per page).

@stryxx stryxx changed the title [WIP] Setcontent refactor Setcontent refactor Mar 1, 2019
@@ -61,11 +61,19 @@ class Field implements Translatable
public $name;

/**
* @ORM\Column(type="json")
* @ORM\Column(type="string", length=4294967295)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type=text or json_array

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

* @Groups({"put"})
* @Gedmo\Translatable
*
* @var string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's store it in model as array

}
}

$expressions[] = call_user_func_array([$expr, 'orX'], $orExpressions);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

closures


private function getFieldOperation(string $fieldName): array
{
$exploded = explode('_', $fieldName);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use SPACE as separator here?

"@*@": "@*@"
}
"""

Scenario: As a user I fetch contents in JSON+LD format
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why jsonld has been deleted?

@JarJak JarJak added 🎩 refactor topic: Content topic: DX Improving code quality, tests coverage, making codebase more intuitive labels Mar 3, 2019
@JarJak JarJak added this to the Bolt 4 alpha 3 milestone Mar 3, 2019
@stryxx stryxx changed the title Setcontent refactor [WIP] Setcontent refactor Mar 27, 2019
@bobdenotter
Copy link
Member

@stryxx Gentle nudge.. Any progress on this PR? :-)

@stryxx stryxx closed this Jun 24, 2019
@stryxx stryxx deleted the refactor/setcontent-for-front branch June 24, 2019 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎩 refactor topic: Content topic: DX Improving code quality, tests coverage, making codebase more intuitive
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants