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

Dynamic path pages #119

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft

Conversation

laudibert
Copy link
Contributor

@laudibert laudibert commented Apr 23, 2020

Working on PR for #115

First step into dealing with n to n relationships. The app now allows you to have path variables within pages "id".

For now, a field of type url has to be shown within a row/card to be able to navigate to the sub-resource (with the help of dataTransformof course). The problem is that the url type will make it that the link will open a new tab, this could be fixed by adding a new type like path or internalUrl that could generate a link that does not open in another tab.

However, it feels like this sort of access to sub-resources could also be done through a button like customActionsdo, what do you think ? The only weird thing being that accessing sub-resources is quite standard in RESTfull APIs and not custom. And the button would be a link to another page rather than a form or an API call.

Also, now sub-resources pages are in the same place than other pages but it feels like they could be in a different array like subResourcesPages or something. For now the implementation does not require them to be separated but in the end they might end up having special properties like the fact that they will never be shown in the menu for example ? And also that their title and description should be able to be built dynamically with the name/label of the parent resource. For example for "id": "classroom/:id/students" would have a title like "title": "Students of ${classroomName}". This kind of feature does not make sense for a "root" resource though. Thus separating pages and sub-resources pages.

What do you think ?

P.S. Sorry for the long text 😅

@dsternlicht
Copy link
Owner

Working on PR for #115

First step into dealing with n to n relationships. The app now allows you to have path variables within pages "id".

For now, a field of type url has to be shown within a row/card to be able to navigate to the sub-resource (with the help of dataTransformof course). The problem is that the url type will make it that the link will open a new tab, this could be fixed by adding a new type like path or internalUrl that could generate a link that does not open in another tab.

However, it feels like this sort of access to sub-resources could also be done through a button like customActionsdo, what do you think ? The only weird thing being that accessing sub-resources is quite standard in RESTfull APIs and not custom. And the button would be a link to another page rather than a form or an API call.

Also, now sub-resources pages are in the same place than other pages but it feels like they could be in a different array like subResourcesPages or something. For now the implementation does not require them to be separated but in the end they might end up having special properties like the fact that they will never be shown in the menu for example ? And also that their title and description should be able to be built dynamically with the name/label of the parent resource. For example for "id": "classroom/:id/students" would have a title like "title": "Students of ${classroomName}". This kind of feature does not make sense for a "root" resource though. Thus separating pages and sub-resources pages.

What do you think ?

P.S. Sorry for the long text 😅

I agree, it shouldn't be part of the customActions object, but a new type of display field as you suggested. Either an internalUrl or path types.

As for where sub resources should be placed, I think that it would make sense to have in the same level as pages, with their own property subPages || resourcePages || entityPages.

Another option is to have them in both page level, right next to customActions, as well as in the app level, and then if there's an internal link, look for a reference in the page level, and if doesn't exists, go to the app level.

Is that make sense? WDYT?

@laudibert
Copy link
Contributor Author

laudibert commented Apr 23, 2020

Oh you mean like this:

export interface IConfigPage {
  name: string
  id: string
  description: string
  requestHeaders: any
  methods: IConfigMethods
  subResources: IConfigSubResourcePage[]
  customActions: IConfigCustomAction[]
  customLabels: ICustomLabels
}

export interface IConfigSubResourcePage extends IConfigPage {
  parentResource: any
}

Actually that would be great yes. It makes more sense, would make a "sub-menu" feature possible and also allow going deep in the sub-resources like classrooms/:id/students/:studentId/books.

@laudibert
Copy link
Contributor Author

I guess it's more about doing a "detailPage" that can be reached through a standard button under the Action column with a 🔍 as a symbol. The page could be a display of fields looking like a bit like a card and have tabs of sub resources defined in that detail.

export interface IConfigPage {
  name: string
  id: string
  description: string
  requestHeaders: any
  methods: IConfigMethods
  detailPage: IConfigDetailPage
  customActions: IConfigCustomAction[]
  customLabels: ICustomLabels
}

export interface IConfigDetailPage {
  get: IConfigGetSingleMethod
  subResourcePages: IConfigSubResourcePage[]
}

export interface IConfigSubResourcePage extends IConfigPage {}

@dsternlicht
Copy link
Owner

I guess it's more about doing a "detailPage" that can be reached through a standard button under the Action column with a 🔍 as a symbol. The page could be a display of fields looking like a bit like a card and have tabs of sub resources defined in that detail.

export interface IConfigPage {
  name: string
  id: string
  description: string
  requestHeaders: any
  methods: IConfigMethods
  detailPage: IConfigDetailPage
  customActions: IConfigCustomAction[]
  customLabels: ICustomLabels
}

export interface IConfigDetailPage {
  get: IConfigGetSingleMethod
  subResourcePages: IConfigSubResourcePage[]
}

export interface IConfigSubResourcePage extends IConfigPage {}

Maybe the detailsPage should be a property of the getSingle method?

@dsternlicht
Copy link
Owner

dsternlicht commented Apr 23, 2020

As for the subResources, maybe just resources would be a good name?
also I would add it in both page level, and the entire app level as well. Because some resources might needed to be available for a few pages.

@laudibert
Copy link
Contributor Author

Maybe the detailsPage should be a property of the getSingle method?

Yes, agreed.

@laudibert
Copy link
Contributor Author

As for the subResources, maybe just resources would be a good name?
also I would add it in both page level, and the entire app level as well. Because some resources might needed to be available for a few pages.

So, like this ?

export interface IConfig {
  remoteUrl: string
  name: string
  favicon: string
  baseUrl: string
  errorMessageDataPath: string | string[]
  unauthorizedRedirectUrl: string
  requestHeaders: any
  pages: IConfigPage[]
  resources: IConfigResourcePage[]
  customStyles?: ICustomStyles
  customLabels?: ICustomLabels
}

export interface IConfigPage {
  name: string
  id: string
  description: string
  requestHeaders: any
  methods: IConfigMethods
  customActions: IConfigCustomAction[]
  customLabels: ICustomLabels
}

export interface IConfigDetailPage {
  resources: IConfigResourcePage[]
}

export interface IConfigResourcePage extends IConfigPage { }

@dsternlicht
Copy link
Owner

As for the subResources, maybe just resources would be a good name?
also I would add it in both page level, and the entire app level as well. Because some resources might needed to be available for a few pages.

So, like this ?

export interface IConfig {
  remoteUrl: string
  name: string
  favicon: string
  baseUrl: string
  errorMessageDataPath: string | string[]
  unauthorizedRedirectUrl: string
  requestHeaders: any
  pages: IConfigPage[]
  resources: IConfigResourcePage[]
  customStyles?: ICustomStyles
  customLabels?: ICustomLabels
}

export interface IConfigPage {
  name: string
  id: string
  description: string
  requestHeaders: any
  methods: IConfigMethods
  customActions: IConfigCustomAction[]
  customLabels: ICustomLabels
}

export interface IConfigDetailPage {
  resources: IConfigResourcePage[]
}

export interface IConfigResourcePage extends IConfigPage { }

Yes, and:

export interface IConfigPage {
  name: string
  id: string
  description: string
  requestHeaders: any
  methods: IConfigMethods
  resources: IConfigResourcePage[]
  customActions: IConfigCustomAction[]
  customLabels: ICustomLabels
}

@laudibert
Copy link
Contributor Author

Ah, but what would be the difference from a resource defined at the app level and on at the page level then ?

@dsternlicht
Copy link
Owner

Ah, but what would be the difference from a resource defined at the app level and on at the page level then ?

Maybe you want a resource to be accessible on for a specific page because it's not relevant for other pages? Then RESTool will look for the resource in the page level, and fallback to the app level.

@laudibert
Copy link
Contributor Author

laudibert commented Apr 28, 2020

Maybe you want a resource to be accessible on for a specific page because it's not relevant for other pages? Then RESTool will look for the resource in the page level, and fallback to the app level.

I'm not sure I see what you mean since, for now, every resource has a unique id property like pages do.

So, right now, a resource detail page would look like this:

image

I am not a css expert and even a worse UI designer. So I only attempted to make something not too awful, but I will definitely need some help to have the right idea if this direction suits you.

It also involves the addition of the "go to details" button under the action column like so:

image

Let me know what you think @dsternlicht .

@dsternlicht
Copy link
Owner

dsternlicht commented Apr 30, 2020

So, right now, a resource detail page would look like this:

@laudibert I'm not sure I understand the flow. Let's try to create a user story for that feature, maybe then thing would make more sense?

Also, I added some comments to the PR.

@laudibert
Copy link
Contributor Author

Also, I added some comments to the PR.

Ah ? In a commit you mean ? I don't see them right now. The code is far from being ready now, a lot a refactoring has to be done.

@laudibert I'm not sure I understand the flow. Let's try to create a user story for that feature, maybe then thing would make more sense?

Sure, I'll try to do that as soon as I have a bit of time.

@@ -120,6 +120,12 @@
"methods": {
"$ref": "#/definitions/methods"
},
"subResourcePages": {
Copy link
Owner

Choose a reason for hiding this comment

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

Shouldn't it be resources?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the schema is just not up to date yet.

id: string
name: string
description: string
resources: IConfigResourcePage[]
Copy link
Owner

Choose a reason for hiding this comment

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

Can a IConfigDetailPage also have resources?

@@ -5,17 +5,25 @@ import HttpService from '../services/http.service';
export interface IAppContext {
config: IConfig | null
activePage: IConfigPage | null
activeItem: any | null
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe activeResource?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The logic was that activeItem is the item on which the details are being displayed. resource refers to classroomwithin /classrooms/:id/student, while item refers to the actual instance of a classroom resource.

Copy link
Owner

Choose a reason for hiding this comment

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

Got it.

@@ -71,6 +72,12 @@ export const Table = ({ items, fields, callbacks, customActions, customLabels }:
}
<td>
<div className="actions-wrapper">
{
callbacks.details &&
Copy link
Owner

Choose a reason for hiding this comment

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

Why do we need the details at all? why not simply using the getSingle method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well here it's because the button redirects you to the details page of the item. While put and delete actually act on the item, the detail button takes you out of the page.

So I thought using get would be confusing. But I guess so is details. Either getto be consistent with the method used behind or goToDetails to be explicit ?

@dsternlicht
Copy link
Owner

Also, I added some comments to the PR.

Ah ? In a commit you mean ? I don't see them right now. The code is far from being ready now, a lot a refactoring has to be done.

@laudibert I'm not sure I understand the flow. Let's try to create a user story for that feature, maybe then thing would make more sense?

Sure, I'll try to do that as soon as I have a bit of time.

Sorry, forgot to publish the comments 🙃

@laudibert
Copy link
Contributor Author

laudibert commented Apr 30, 2020

Ok, so before I get into an acutal User Story, here are the steps of what led me to implement that detailsPage so that context can be clear:

The first requirement I brought up in #115 basically was : how can we display 1 to n and n to n relationships on RESTool ?

RESTful APIs implement this through sub-resources like so: /classrooms/:id/students where classrooms is the resource and students is the sub-resource (reference here). Obviously, it can go deeper on like so: /classrooms/:id/students/:studentId/books.

RESTool allows you to display root resources very easily, but what about sub-resources ?

You suggested that a link to the actual sub-resource could be generated via dataTransform. So at first, I started that PR having as a goal for RESTool to be able to route pages with path variables so that /classrooms/:id/students could have its on page reachable through a link shown in classroomson each item and hidden from the menu (as going to /classrooms/:id/students with no id doesn't make sense).

As I did that and we discussed it further, it seemed clear that the links via dataTransform was not the end goal here as those relationships are standard in RESTful APIs and having a simple link was not good enough. Also, if a resource like classrooms had multiple sub-resources like students, teachers and whatnot, the link solution was reaching its limits.

There came the idea of association all sub-resources of one resource page within itself and the idea that one item could have its own page reachable via a 🔍 button.

The reasoning behind the detail page is the following:

  • RESTool allows you to display items via a list of items only
  • If a resource has many fields, you obviously want to "simplify" the list display by shortening some fields and not showing others to prevent having too much information on the list (sub-resources links would also be a cause of that)
  • A "detail" button, naturally associated with the getSinglemethod, could bring the user to another page where a more detailed view of the selected item would be displayed by using displayFields within getSingle (not done yet in the current implementation)
  • Moreover, in that new kind of page, there could be a way to display all the sub-resources of one resource. Hence the tab implementation I showed where all tabs have a list (table or cards) of all the items of each sub-resources
  • This would also allow for each sub-resources to have a full configuration of their own, including having sub-resources of their own, which solves the nested resources case like /classrooms/:id/students/:studentId/books

That being said, all sub-resources pages would be shown through detail pages, which makes sense as per definition, a sub-resource is always reached after selecting one item of the its parent resource.

Another solution, I guess, could be to only show links of those sub-resources in the detail page rather than directly having tabs showing the sub resources. But the fact remains that that when you show /classrooms/101/students you are not showing just a Students page but a Students of classroom 101 which implies that you are on a page linked to the parent resource and not just a regular page.

Sorry for the long text, tell me if you get what I'm talking about and what you think about this. Then I can write a proper User Story if need be @dsternlicht.

@dsternlicht
Copy link
Owner

dsternlicht commented Apr 30, 2020

Ok, so before I get into an acutal User Story, here are the steps of what led me to implement that detailsPage so that context can be clear:

The first requirement I brought up in #115 basically was : how can we display 1 to n and n to n relationships on RESTool ?

RESTful APIs implement this through sub-resources like so: /classrooms/:id/students where classrooms is the resource and students is the sub-resource (reference here). Obviously, it can go deeper on like so: /classrooms/:id/students/:studentId/books.

RESTool allows you to display root resources very easily, but what about sub-resources ?

You suggested that a link to the actual sub-resource could be generated via dataTransform. So at first, I started that PR having as a goal for RESTool to be able to route pages with path variables so that /classrooms/:id/students could have its on page reachable through a link shown in classroomson each item and hidden from the menu (as going to /classrooms/:id/students with no id doesn't make sense).

As I did that and we discussed it further, it seemed clear that the links via dataTransform was not the end goal here as those relationships are standard in RESTful APIs and having a simple link was not good enough. Also, if a resource like classrooms had multiple sub-resources like students, teachers and whatnot, the link solution was reaching its limits.

There came the idea of association all sub-resources of one resource page within itself and the idea that one item could have its own page reachable via a 🔍 button.

The reasoning behind the detail page is the following:

  • RESTool allows you to display items via a list of items only
  • If a resource has many fields, you obviously want to "simplify" the list display by shortening some fields and not showing others to prevent having too much information on the list (sub-resources links would also be a cause of that)
  • A "detail" button, naturally associated with the getSinglemethod, could bring the user to another page where a more detailed view of the selected item would be displayed by using displayFields within getSingle (not done yet in the current implementation)
  • Moreover, in that new kind of page, there could be a way to display all the sub-resources of one resource. Hence the tab implementation I showed where all tabs have a list (table or cards) of all the items of each sub-resources
  • This would also allow for each sub-resources to have a full configuration of their own, including having sub-resources of their own, which solves the nested resources case like /classrooms/:id/students/:studentId/books

That being said, all sub-resources pages would be shown through detail pages, which makes sense as per definition, a sub-resource is always reached after selecting one item of the its parent resource.

Another solution, I guess, could be to only show links of those sub-resources in the detail page rather than directly having tabs showing the sub resources. But the fact remains that that when you show /classrooms/101/students you are not showing just a Students page but a Students of classroom 101 which implies that you are on a page linked to the parent resource and not just a regular page.

Sorry for the long text, tell me if you get what I'm talking about and what you think about this. Then I can write a proper User Story if need be @dsternlicht.

Alrighty then. Thanks for clearing that out!
Now I understand why you used the tabs UI.

So a few decisions to make here:

  • Where would you define sub-resources / sub-pages? on which level?
  • Does the only way to navigate to these sub-pages is by clicking the button?
  • What do we need to add to the getSingle method?
  • What kind of UI we'll use for sub-pages (in cases like you mentioned that there are multiple sub-resources in one resources.
  • Should we rename pages to resources? would that make more sense? with backward compatibility of course.
  • How can we make this change gradually? Maybe we should start with the single page, merge, add support for internal links, and only then add support for sub-resources?

@laudibert
Copy link
Contributor Author

Where would you define sub-resources / sub-pages? on which level?

As sub-resources only come from a parent item like classrooms/101 can have classrooms/101/students, I would only have a definition of a sub-resource page within getSingle or a page definition. Even if you do have students used as a sub-resource of something else, like schools/:id/students, it would not be reusable from one page to the other (API path would change at the very least).

Does the only way to navigate to these sub-pages is by clicking the button?

Well it all depends on the UX that is decided really. Whether a sub-resource is displayed as a full page (where ate we on the menu when that happens?) or as a tab (or anything like that) within a item details. Or both possibility.
If it's decided that it can be displayed through a full page of its own then links seems necessary, custom actions to redirect too ?

What do we need to add to the getSingle method?

I think display.fields seems necessary to a detail page. It might not have the same definition than for the getAll method though, as possibilities could differ. Like showing JSONs in a "code display" way or html being parsed etc. ?

@laudibert
Copy link
Contributor Author

What kind of UI we'll use for sub-pages (in cases like you mentioned that there are multiple sub-resources in one resources.

I don't have other ideas than the tab one, but I'm not good at UI/UX, do you have any in mind?

Should we rename pages to resources? would that make more sense? with backward compatibility of course.

That's a good question. The thing is that a page definition is a definition for a resource but it also has specific page things like title or description. I think both are valid. I'm not sure if it should change or not.

How can we make this change gradually? Maybe we should start with the single page, merge, add support for internal links, and only then add support for sub-resources?

This depends a lot on answers to previous questions :D

@dsternlicht
Copy link
Owner

Where would you define sub-resources / sub-pages? on which level?

As sub-resources only come from a parent item like classrooms/101 can have classrooms/101/students, I would only have a definition of a sub-resource page within getSingle or a page definition. Even if you do have students used as a sub-resource of something else, like schools/:id/students, it would not be reusable from one page to the other (API path would change at the very least).

Does the only way to navigate to these sub-pages is by clicking the button?

Well it all depends on the UX that is decided really. Whether a sub-resource is displayed as a full page (where ate we on the menu when that happens?) or as a tab (or anything like that) within a item details. Or both possibility.
If it's decided that it can be displayed through a full page of its own then links seems necessary, custom actions to redirect too ?

What do we need to add to the getSingle method?

I think display.fields seems necessary to a detail page. It might not have the same definition than for the getAll method though, as possibilities could differ. Like showing JSONs in a "code display" way or html being parsed etc. ?

  • Ok. So page will have methods and resources.
  • I don't like the idea having resources as custom actions. Custom actions is for, well, taking actions. Let's start with a button for viewing a single item's page, and internal links.
  • Maybe the getSingle could have fields the same way getAll has, and if one of the field is a resource, you may mark it as resource field type, and connect it by the id of the resource`?

@dsternlicht
Copy link
Owner

What kind of UI we'll use for sub-pages (in cases like you mentioned that there are multiple sub-resources in one resources.

I don't have other ideas than the tab one, but I'm not good at UI/UX, do you have any in mind?

Should we rename pages to resources? would that make more sense? with backward compatibility of course.

That's a good question. The thing is that a page definition is a definition for a resource but it also has specific page things like title or description. I think both are valid. I'm not sure if it should change or not.

How can we make this change gradually? Maybe we should start with the single page, merge, add support for internal links, and only then add support for sub-resources?

This depends a lot on answers to previous questions :D

  • Tabs would work.
  • So how about having pages, and subPages rather than resources? I don't want to mix between them.

@laudibert
Copy link
Contributor Author

  • Ok. So page will have methods and resources.

  • I don't like the idea having resources as custom actions. Custom actions is for, well, taking actions. Let's start with a button for viewing a single item's page, and internal links.

Ok. So a sub-resource definition, however we choose to call it, should be able to turn into a full page or a tab in a detail page. Question about the page case, what shows on the menu when the internal link brings us to a sub-resource page ?

  • Maybe the getSingle could have fields the same way getAll has, and if one of the field is a resource, you may mark it as resource field type, and connect it by the id of the resource`?

I don't know if a resource should be associated with a field as it might be confusing to have the type defined as it can only work for getSingle. Maybe there could be a new property only defined on getSingle that is an array of id of the resources to show? Like tabs?

Also, does the 🔍 button appear automatically when getSingle is defined? Because since it currently is used to pre-fill the edit form, it would imply that current configuration will make the 🔍 automatically appear and I don't know if one functionality should imply the other is activated when they really differ apart from using the same API route.

Maybe then we need to find a way to differentiate the activation of the current getSingle functionality and the new get detailsone. What do you think?

  • Tabs would work.

Alright, anything you think I should change about the looks/style though?

  • So how about having pages, and subPages rather than resources? I don't want to mix between them.

Actually, put into that perspective, I think resources and subResources is less confusing than pages and subPages since a subPage would be a definition of something that can turn into a tab. No?

@dsternlicht
Copy link
Owner

  • Ok. So page will have methods and resources.
  • I don't like the idea having resources as custom actions. Custom actions is for, well, taking actions. Let's start with a button for viewing a single item's page, and internal links.

Ok. So a sub-resource definition, however we choose to call it, should be able to turn into a full page or a tab in a detail page. Question about the page case, what shows on the menu when the internal link brings us to a sub-resource page ?

The original page.

  • Maybe the getSingle could have fields the same way getAll has, and if one of the field is a resource, you may mark it as resource field type, and connect it by the id of the resource`?

I don't know if a resource should be associated with a field as it might be confusing to have the type defined as it can only work for getSingle. Maybe there could be a new property only defined on getSingle that is an array of id of the resources to show? Like tabs?

Why? Maybe a field in getAll could also have a resource type field?

Also, does the 🔍 button appear automatically when getSingle is defined? Because since it currently is used to pre-fill the edit form, it would imply that current configuration will make the 🔍 automatically appear and I don't know if one functionality should imply the other is activated when they really differ apart from using the same API route.

I think it's ok. If getSingle is defined, the button should appear.

Maybe then we need to find a way to differentiate the activation of the current getSingle functionality and the new get detailsone. What do you think?

  • Tabs would work.

Alright, anything you think I should change about the looks/style though?

Not at the moment. Maybe I'll change afterward.

  • So how about having pages, and subPages rather than resources? I don't want to mix between them.

Actually, put into that perspective, I think resources and subResources is less confusing than pages and subPages since a subPage would be a definition of something that can turn into a tab. No?

I agree.

@laudibert
Copy link
Contributor Author

Why? Maybe a field in getAll could also have a resource type field?

What would that do? If a resource type field in getSingle would generate a tab in the detail page to show a sub-resource, what would it do on a table of multiple item?

@dsternlicht
Copy link
Owner

Why? Maybe a field in getAll could also have a resource type field?

What would that do? If a resource type field in getSingle would generate a tab in the detail page to show a sub-resource, what would it do on a table of multiple item?

Oh. If you put it that way.. :)
You're right.

@laudibert
Copy link
Contributor Author

Why? Maybe a field in getAll could also have a resource type field?

What would that do? If a resource type field in getSingle would generate a tab in the detail page to show a sub-resource, what would it do on a table of multiple item?

Oh. If you put it that way.. :)
You're right.

No but it's just I didn't know what you had in mind.

Actually, maybe it can generate a link to the sub-resource page? That would solve the "internal url" thing.

@dsternlicht
Copy link
Owner

Why? Maybe a field in getAll could also have a resource type field?

What would that do? If a resource type field in getSingle would generate a tab in the detail page to show a sub-resource, what would it do on a table of multiple item?

Oh. If you put it that way.. :)
You're right.

No but it's just I didn't know what you had in mind.

Actually, maybe it can generate a link to the sub-resource page? That would solve the "internal url" thing.

That's actually what I meant.

@dsternlicht
Copy link
Owner

@laudibert What's the status of this PR?

@laudibert
Copy link
Contributor Author

@dsternlicht It's still ongoing, I'm having trouble finding time those days. I am planning on writing up a full status later today.

@dsternlicht
Copy link
Owner

@dsternlicht It's still ongoing, I'm having trouble finding time those days. I am planning on writing up a full status later today.

No worries :)
Just wanted to make sure that you're not waiting for my feedback on something.

@laudibert
Copy link
Contributor Author

Work (still) in progress.

What is done:

What is left to do:

  • Adding full "link to sub-resource" feature support (that should be fast)
  • README documentation.
  • I will probably add a sample of a configuration with that feature configured on a public open API under a new folder samples, would that be OK @dsternlicht ?

One other thing. For now, adding a sub-resource from a detail page is not supported. Meaning if you are on the classrooms/101 detail page, and the sub-resources configured are classrooms/:id/students and classrooms/:id/books, there will be two tabs for those sub-resources but there will be no "+ Add Item" button for any of them.

I am not sure if it should or how it should be done in term of display. What do you think @dsternlicht ?

@dsternlicht
Copy link
Owner

Work (still) in progress.

What is done:

What is left to do:

  • Adding full "link to sub-resource" feature support (that should be fast)
  • README documentation.
  • I will probably add a sample of a configuration with that feature configured on a public open API under a new folder samples, would that be OK @dsternlicht ?

That would be great.

One other thing. For now, adding a sub-resource from a detail page is not supported. Meaning if you are on the classrooms/101 detail page, and the sub-resources configured are classrooms/:id/students and classrooms/:id/books, there will be two tabs for those sub-resources but there will be no "+ Add Item" button for any of them.

I am not sure if it should or how it should be done in term of display. What do you think @dsternlicht ?

Hmmm so you'll only be able to view the items but not to edit/create them?

@laudibert
Copy link
Contributor Author

laudibert commented Jun 2, 2020

Hmmm so you'll only be able to view the items but not to edit/create them?

Modify them yes, create no.

image

As you can see in this example, I'm not sure where to place the create button when the item details and sub-resources tabs are involved.

@dsternlicht
Copy link
Owner

Hmmm so you'll only be able to view the items but not to edit/create them?

Modify them yes, create no.

image

As you can see in this example, I'm not sure where to place the create button when the item details and sub-resources tabs are involved.

For now it's ok. Let's skip the create.

@dsternlicht
Copy link
Owner

@laudibert are we ready? what's left?

@laudibert
Copy link
Contributor Author

@dsternlicht no, sorry for the long delay. It has been hard to find enough time to finish this lately.

I have added an example with the open API of TVMAZE website. And while doing tests on everything, I found some things that I fixed but I am having trouble with some bugs. In particular, there is a bug navigating with the "Next page" and "Previous page" buttons of the browser.

I ended up starting to write some unit tests hoping it will help me find what is going wrong as I cannot put my finger on it.

I will push what I have not pushed yet if you mind to take a look.

…es using TVMAZE api, fixed error when a object is null within a data extraction, resized images for details page, added first unit test for button component (as a starter) and updated packages to enable unit tests.
@laudibert
Copy link
Contributor Author

laudibert commented Jun 23, 2020

So current known bugs are :

  • When multiple pages have sub-resources, sub-resources don't show up anymore (as shown by the sample, this one should not be complicated, I found it "recently" and did not have the time to investigate properly yet)
  • "Can't perform a React state update on an unmounted component" on detail pages
  • Default value on query params do not apply on the first call (see "People" page in the sample)
  • Using "next page" and "previous page" buttons can cause for erratic behavior (I have not determined the exact behavior of this bug yet)
  • Clicking on a tab makes the window go back all the way up

@laudibert
Copy link
Contributor Author

* When multiple pages have sub-resources, sub-resources don't show up anymore (as shown by the sample, this one should not be complicated, I found it "recently" and did not have the time to investigate properly yet)

So this isn't an actual bug but more a misuse in the sample I wrote as I was referring a the url /shows/:id in two different resources for their detail page under people/:id/creditspage and shows page.

@magoerlich
Copy link
Contributor

Greetings everyone, was this feature ever implemented?

@dsternlicht
Copy link
Owner

Greetings everyone, was this feature ever implemented?

Nope, it was never completed by @laudibert :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants