The decision by the previous UK Conservative government to approve the giant Rosebank oilfield was ruled unlawful by an Edinburgh court.