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 new data_resource GenericItem #190

Merged
merged 24 commits into from
Mar 11, 2021

Conversation

marcometz
Copy link
Member

The model GenericItem has all features of all other data_resources.

  • Includes a store for a JSON payload
  • includes filter method by role
  • has an ancresty tree to nest other gerneric_items

The model GenericItem has all features of all other data_resources.
- Includes a store for a JSON payload
- includes filter method by role
- has an ancresty tree to nest other gerneric_items
@marcometz
Copy link
Member Author

ich denke ich werde die verschachtelten Struckturen wieder mit dem has_ancestry Gem umsetzen.

Move all graphqler  query types in an subfolder and namespace all query types
Move all graphql  input types in an subfolder and namespace all input types
- graphql query zum Abrufen verschachtelter Nodes
- graphql Mutation zum anlegen verschachtelter Nodes

Beispiel:
`mutation {
  createGenericItem(
    author: ""
    genericType: "Job"
    title: "JobAngebot 1"
    genericItems: [{title: "Job 2", genericType: "Offer", genericItems: [{title: "C", genericType: "Search" }]}]
    webUrls: ….`
@marcometz
Copy link
Member Author

marcometz commented Feb 17, 2021

  • graphql query zum Abrufen verschachtelter Nodes
  • graphql Mutation zum anlegen verschachtelter Nodes

Beispiel:
mutation { createGenericItem( author: "" genericType: "Job" title: "JobAngebot 1" genericItems: [{title: "Job 2", genericType: "Offer", genericItems: [{title: "C", genericType: "Search" }]}] webUrls: ….

Bildschirmfoto 2021-02-17 um 18 49 56

@marcometz marcometz marked this pull request as ready for review February 17, 2021 17:54
@pwilimzig

This comment has been minimized.

@pwilimzig

This comment has been minimized.

uninitialized constant GenericItem::Company
mutation {
  createGenericItem(
    author: ""
    genericType: "Job"
    payload: { foo: "bar" }
@marcometz

This comment has been minimized.

Copy link
Member

@pwilimzig pwilimzig left a comment

Choose a reason for hiding this comment

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

Für den Moment wäre ich da erst einmal happy, aber es wäre schön, wenn meine Anmerkung hinsichtlich der weiteren Filterkriterien nicht untergeht.

Copy link
Member

@donni106 donni106 left a comment

Choose a reason for hiding this comment

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

heftig. aber geil. so in etwas hab ichs mir auch vorgestellt.
die graphql/json schema dateien hätte ich hier noch vermutet? brauchen wir die doch nicht wirklich? rails graphql:schema:dump

viel spaß mit den (22) comments :D

codeclimate wär bitte auch nochmal durchzugehen, um zu gucken, was davon direkt angewendet werden könnte.

def unique_id
return external_id if external_id.present?

fields = [title, published_at]
Copy link
Member

Choose a reason for hiding this comment

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

hier vllt auch wie bei news, wenn es keinen title gibt, title = content_blocks.first.try(:title)?

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm... wir haben ja ein explizites Attribute title am Model GenericTitle, was bei bei News "eigentlich" nicht haben.
Zumindest greift der unique_id bei news nicht auf das direkte Attribute zurück. Ich glaube hier ist was bei News komisch. Wird dort das direkte Attribute überhaupt verwendet?

Copy link
Member

@donni106 donni106 Feb 22, 2021

Choose a reason for hiding this comment

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

kann ich nicht sagen. im CMS, wenn eine nachricht angelegt wird, kann man title auch nicht direkt eintragen.

app/models/data_resources/generic_item.rb Show resolved Hide resolved
app/models/data_resources/generic_item.rb Outdated Show resolved Hide resolved
app/models/data_resources/generic_item.rb Outdated Show resolved Hide resolved
app/models/data_resources/generic_item.rb Outdated Show resolved Hide resolved
app/graphql/resolvers/generic_item_search.rb Outdated Show resolved Hide resolved
app/graphql/resolvers/generic_item_search.rb Show resolved Hide resolved
app/graphql/resolvers/generic_item_search.rb Show resolved Hide resolved
app/graphql/resolvers/generic_item_search.rb Show resolved Hide resolved
app/graphql/mutations/create_generic_item.rb Show resolved Hide resolved
Filter GenericItems per user and role permissions
Assign GenericItem to one or many categories
Inkl. GraphQL API Anpassungen
@donni106 donni106 linked an issue Feb 23, 2021 that may be closed by this pull request
@donni106 donni106 added enhancement New feature or request urgent This should be worked on with high priority. labels Feb 24, 2021
@donni106 donni106 linked an issue Feb 24, 2021 that may be closed by this pull request
@donni106 donni106 linked an issue Mar 4, 2021 that may be closed by this pull request
GenericItems lassen sich nun aufsteigend und absteigend nach dem Feld publication_date sortiert ausgeben:

- publicationDate_ASC
- publicationDate_DESC
@marcometz

This comment has been minimized.

Die möglichen Sortieroptionen werden nun in allen Resolvern alphabetisch aufgelistet.
@codeclimate
Copy link

codeclimate bot commented Mar 10, 2021

Code Climate has analyzed commit 72fbd5b and detected 317 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 94
Duplication 8
Style 215

View more on Code Climate.

@marcometz marcometz requested a review from donni106 March 10, 2021 13:08
@marcometz marcometz merged commit fd21dad into master Mar 11, 2021
@marcometz marcometz deleted the feature/new-data-resource-genericitem branch March 11, 2021 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request urgent This should be worked on with high priority.
Projects
None yet
3 participants