Move port click valid check logic to UI