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

Story/vspc 190 A user should be able to define the order spaces appear in the site menu of the public page #277

Open
wants to merge 86 commits into
base: develop
Choose a base branch
from

Conversation

glend17
Copy link
Contributor

@glend17 glend17 commented Feb 9, 2022

Guidelines for Pull Requests

If you haven't yet read our code review guidelines, please do so, You can find them here.

Please confirm the following by adding an x for each item (turn [ ] into [x]).

  • I have removed all code style changes that are not necessary (e.g. changing blanks across the whole file that don’t need to be changed, adding empty lines in parts other than your own code)
  • I am not making any changes to files that don’t have any effect (e.g. imports added that don’t need to be added)
  • I do not have any sysout statements in my code or commented out code that isn’t needed anymore
  • I am not reformatting any files in the wrong format or without cause.
  • I am not changing file encoding or line endings to something else than UTF-8, LF
  • My pull request does not show an insane amount of files being changed although my ticket only requires a few files being changed
  • I have added Javadoc/documentation where appropriate
  • I have added test cases where appropriate
  • I have explained any part of my code/implementation decisions that is not be self-explanatory

Please provide a brief description of your ticket

(you can copy the ticket if it hasn't changed)

...Put description here...

Right now, on the public site, the menu simply lists all published spaces. The user has no control over the order. For this ticket two things should be implemented:

by default the spaces should be ordered alphabetically by name

a user should be able to switch between alphabetically ordered, ordered by creation date, and a custom order.

For the custom order, there should be a page (on the staff side) that lists all spaces and the user can simply arrange them in the order they should be shown.

Anything else the reviewer needs to know?

User can choose if they have to arrange spaces alphabetically or through creation date or a custom order in spaces on the staff site.
They can create custom orders in the custom order page on the staff site. Alphabetical is default, if user chooses custom but does not select an order it will fall back to alphabetical order.

@pkharge pkharge reopened this Oct 19, 2023
@jdamerow
Copy link
Member

Make it so, Jenkins.

@jdamerow
Copy link
Member

  • dropdown needs to use bootstrap like the rest
    image
  • This configuration should be in the Exhibition Settings not the space list page:
    image
  • Also the link "Manage custom orders" highlights blue when hovered over. Nowhere else does this happen, so it shouldn't happen here either.
  • There is some kind of bug when creating custom orders. I created a new order, moved a few spaces around and saved it. The list in the menu on the public page now only has a few spaces in it (not all), although the custom order page on the staff site shows all spaces.
  • all custom orders should show up in the drop down menu that decides which order to use (alphabetical, by creation date, custom 1, custom 2, etc). It doesn't make sense that the user would have to go to a separate page to select which custom order to use.

@jdamerow jdamerow closed this Nov 20, 2023
@pooja-thalur pooja-thalur reopened this Aug 12, 2024
return value;
}

public static List<String> getAllValues() {
Copy link
Member

Choose a reason for hiding this comment

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

you can probably just get rid of the values, and simply pass ALPHABETICAL or CREATION_DATE as request parameter. Then you can use the valueOf method to get an enum.

* @param publishedSpaces
* @return list of {@link ISpace}
*/
private List<ISpace> sortSpacesOnCreationDate(List<ISpace> publishedSpaces){
Copy link
Member

Choose a reason for hiding this comment

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

see above

attributes.addFlashAttribute("alertType", "danger");
attributes.addFlashAttribute("message", "Custom order could not be updated. The title field is empty.");
attributes.addFlashAttribute("showAlert", "true");
return "redirect:/staff/space/order/"+spacesCustomOrderId;
Copy link
Member

Choose a reason for hiding this comment

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

same as before, data should not be lost.

Copy link
Member

Choose a reason for hiding this comment

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

?

@Autowired
private ISpacesCustomOrderManager spacesCustomOrderManager;

@RequestMapping(value = "/staff/space/order/{customOrderId}/edit/info", method = RequestMethod.POST)
Copy link
Member

Choose a reason for hiding this comment

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

and then this url can just be /staff/space/order/{customOrderId}

}

@RequestMapping(value = "/staff/space/order/{customOrderId}/edit/spaceorders", method = RequestMethod.POST)
public String saveOrder(
Copy link
Member

Choose a reason for hiding this comment

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

is there are reason, name/description and order are not stored together in one call?

Copy link
Member

Choose a reason for hiding this comment

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

right now, only the order can be changed on the edit page, and on the same page, there is a separate option to edit the name/description, which opens a popup to edit and save only the name/description.

Should we keep it all together (name, description and order) in one page?

Copy link
Member

Choose a reason for hiding this comment

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

yes, I don't see a reason not to

*/

@Controller
public class StaffSpaceCustomOrderController {
Copy link
Member

Choose a reason for hiding this comment

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

name should make clear what this controller is for

import edu.asu.diging.vspace.core.services.ISpacesCustomOrderManager;

@Controller
public class UpdateStaffSpaceOrderModeController {
Copy link
Member

Choose a reason for hiding this comment

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

why is this called ...StaffSpace... not just ...Space...? There is not equivalent for the public page, right? This controller does not need to be contrasted with another one for the public site?

@jdamerow jdamerow closed this Aug 20, 2024
@pooja-thalur pooja-thalur reopened this Aug 30, 2024
.getSpacesCustomOrder();
if(spaceCustomOrder!=null && spaceCustomOrder.getId().equals(id)) {
exhibition.setSpacesCustomOrder(null);
exhibitionManager.storeExhibition((Exhibition)exhibition);
Copy link
Member

Choose a reason for hiding this comment

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

?

attributes.addFlashAttribute("alertType", "danger");
attributes.addFlashAttribute("message", "Custom order could not be saved. Please enter the name of the order.");
attributes.addFlashAttribute("showAlert", "true");
return "redirect:/staff/space/order/add";
Copy link
Member

Choose a reason for hiding this comment

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

?

attributes.addFlashAttribute("alertType", "danger");
attributes.addFlashAttribute("message", "Custom order could not be updated. The title field is empty.");
attributes.addFlashAttribute("showAlert", "true");
return "redirect:/staff/space/order/"+spacesCustomOrderId;
Copy link
Member

Choose a reason for hiding this comment

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

?

}

@RequestMapping(value = "/staff/space/order", method = RequestMethod.GET)
public String displayCustomOrders(Model model) {
Copy link
Member

Choose a reason for hiding this comment

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

?

}

@RequestMapping(value = "/staff/space/order/setExhibitionCustomOrder", method = RequestMethod.POST)
public String setExhibitionSpacesCustomOrder(Model model,
Copy link
Member

Choose a reason for hiding this comment

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

this should be in the same class as the one to show the page for a specific order, but url should be /staff/space/order/{orderId}.

@jdamerow jdamerow closed this Sep 27, 2024
@pooja-thalur pooja-thalur reopened this Oct 4, 2024
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.

6 participants