== View of all components & their details== === Actors === Guest, User, Admin === Scenario === 1. The user clicks on the "COMPONENTS" dropdown [[Image(clickComponents.png)]] 2. A list of all the component types is displayed and the users chooses one [[Image(componentsDropdown.png)]] 3. A popup of all the components of that type is displayed {{{ SELECT * FROM components WHERE name ILIKE ('%' || $q || '%') ORDER BY CASE WHEN $sort = 'price_asc' THEN price END ASC, CASE WHEN $sort = 'price_desc' THEN price END DESC, price DESC LIMIT COALESCE($limit, 100); }}} [[Image(componentsList.png)]] 4. The user can sort by price [[Image(sortByPrice.png)]] 5. The users can view the details of a component by clicking on it {{{ SELECT * FROM components WHERE id = $componentId LIMIT 1; SELECT * FROM $details_table -- cpu/gpu/memory/storage/power_supply/motherboard/pc_case/cooler/... WHERE component_id = $componentId LIMIT 1; -- if type == pc_case: SELECT * FROM case_storage_form_factors WHERE case_id = $componentId; SELECT * FROM case_ps_form_factors WHERE case_id = $componentId; SELECT * FROM case_mobo_form_factors WHERE case_id = $componentId; -- if type == 'cooler': SELECT * FROM cooler_cpu_sockets WHERE cooler_id = $componentId; }}} [[Image(componentsDetails.png)]]