public function classBranchPopup(NodeInterface $node, $js = 'nojs') {
    if ($js == 'ajax') {
      $response = new AjaxResponse();
      $form['#attached']['library'][] = 'core/drupal.dialog.ajax';
      $response->setAttachments($form['#attached']);
      $content = $this->buildPopupContent($node);
      if ($content instanceof CommandInterface) {
        $response->addCommand($content);
      }
      else {
        $modal = new OpenModalDialogCommand(t('Select location'), $content, $this->popupOptions());
        $response->addCommand($modal);
      }
      return $response;
    }
    else {
      return $this->redirect('user.page');
    }
  }