Today I got my new YT Tues bike and I've noticed that front brake lever came off the piston and I have no idea how to get it in place if it is even possible? Is it defective or can I fix it? Rear brake works just fine...
You can see in the first picture that a snap ring is out of place. I’m not familiar with these brakes but I’d have to assume there is something very wrong that must be dealt with by a qualified mechanic or the manufacturer. You don’t want to mess around with brakes, especially on a downhill bike.
As it’s a new bike, take it straight back to where you purchased it and get it fixed or replaced under warranty.
It appears that the ball end of the rod should be in the socket with the washer in place, and then the c-shaped snap ring gets snapped into position to hold it all together. That is how it appears to me, however if there are any missing pieces I couldn't say, perhaps an exploded assembly diagram would help. It would appear that the ball has been ripped out of the socket somehow, presumably after the bike was assembled and PDI checked. From the first two photos, the rod also looks a little bent, not an encouraging sign.
The best thing for you to do would be to return it to the shop or seller for a repair. YT indicate a 2 year warranty on all components.
Depending on where you bought it you'd have a couple of options. If it was from a shop, they should be able to repair the brake under warranty. Maybe they can repair the lever after an inspection in person, or maybe they would need to swap the lever for a new one. It wouldn't matter to you; if they do a safe repair, you would have a sound bike afterwards.
If you bought it online, contact the seller and contact YT. They might want you to send the bike off somewhere, but it could be more convenient to take it to a local shop to be inspected and repaired. You might be able to ask one of them to contribute to the cost of the repair. Not having to pay to send the bike away would be a good start for you.
If you want to attempt the repair or replace the lever yourself that's ok if you fully understand the risks, but if you're here asking the question, it isn't something you've fixed yourself before. Being a new bike, that is liability and risk you don't have to take on yourself, it's what the warranty is for.
Here's a parts diagram for the lever from TRPs website for this part
In your pictures we can see part number 4 and the shaded out lock ring and washer to the right of part number 4.
There is a set of parts that are in number 7.
In your pictures I don't see the left most cone shaped washer. It looks like a part might be missing.
On their website the part numbers have names.
Part number 4 is the "detented pushrod"
Part number 7 is the "master cylinder piston"
Knowing the names might help in your conversation with YT.