HUE-2234 [core] Select first document or shared document tag by default

Added logic to return the first available tag/project that has more than one document. If not available, it returns the history