
"""Modals for deleting objects"""

from lib import base
from lib import decorator
from lib.constants import locator


class DeleteObjectModal(base.Modal):
  """A generic modal for deleting an object"""

  _page_model_cls_after_redirect = None
  _locator = locator.ModalDeleteObject

  def __init__(self, driver):
    super(DeleteObjectModal, self).__init__(driver)
    self.title_modal = base.Label(
        driver, self._locator.MODAL_TITLE)
    self.confirmation_text = base.Label(
        driver, self._locator.CONFIRMATION_TEXT)
    self.title_object = base.Label(
        driver, self._locator.OBJECT_TITLE)
    self.button_delete = base.Button(
        driver, self._locator.BUTTON_DELETE)

  @decorator.wait_for_redirect
  def confirm_delete(self):
    """
    Returns:
        lib.page.dashboard.Dashboard
    """
    self.button_delete.click()


"""Modals for deleting objects"""

from lib import base
from lib.constants import locator


class DeleteObjectModal(base.Modal):
  """A generic modal for deleting an object"""

  _page_model_cls_after_redirect = None
  _locator = locator.ModalDeleteObject

  def __init__(self, driver):
    super(DeleteObjectModal, self).__init__(driver)
    self.title_modal = base.Label(
        driver, self._locator.MODAL_TITLE)
    self.confirmation_text = base.Label(
        driver, self._locator.CONFIRMATION_TEXT)
    self.title_object = base.Label(
        driver, self._locator.OBJECT_TITLE)
    self.button_delete = base.Button(
        driver, self._locator.BUTTON_DELETE)

  def confirm_delete(self):
    """
    Returns:
        lib.page.dashboard.Dashboard
    """
    self.button_delete.click()

Remove redirect from delete modal page object
Remove redirect from delete modal page object

(cherry picked from commit 480ecdb)

  
  """Modals for deleting objects"""
  
  from lib import base
- from lib import decorator
  from lib.constants import locator
  
  
  class DeleteObjectModal(base.Modal):
    """A generic modal for deleting an object"""
  
    _page_model_cls_after_redirect = None
    _locator = locator.ModalDeleteObject
  
    def __init__(self, driver):
      super(DeleteObjectModal, self).__init__(driver)
      self.title_modal = base.Label(
          driver, self._locator.MODAL_TITLE)
      self.confirmation_text = base.Label(
          driver, self._locator.CONFIRMATION_TEXT)
      self.title_object = base.Label(
          driver, self._locator.OBJECT_TITLE)
      self.button_delete = base.Button(
          driver, self._locator.BUTTON_DELETE)
  
-   @decorator.wait_for_redirect
    def confirm_delete(self):
      """
      Returns:
          lib.page.dashboard.Dashboard
      """
      self.button_delete.click()
  
Remove redirect from delete modal page object
## Code Before:

"""Modals for deleting objects"""

from lib import base
from lib import decorator
from lib.constants import locator


class DeleteObjectModal(base.Modal):
  """A generic modal for deleting an object"""

  _page_model_cls_after_redirect = None
  _locator = locator.ModalDeleteObject

  def __init__(self, driver):
    super(DeleteObjectModal, self).__init__(driver)
    self.title_modal = base.Label(
        driver, self._locator.MODAL_TITLE)
    self.confirmation_text = base.Label(
        driver, self._locator.CONFIRMATION_TEXT)
    self.title_object = base.Label(
        driver, self._locator.OBJECT_TITLE)
    self.button_delete = base.Button(
        driver, self._locator.BUTTON_DELETE)

  @decorator.wait_for_redirect
  def confirm_delete(self):
    """
    Returns:
        lib.page.dashboard.Dashboard
    """
    self.button_delete.click()

## Instruction:
Remove redirect from delete modal page object
## Code After:

"""Modals for deleting objects"""

from lib import base
from lib.constants import locator


class DeleteObjectModal(base.Modal):
  """A generic modal for deleting an object"""

  _page_model_cls_after_redirect = None
  _locator = locator.ModalDeleteObject

  def __init__(self, driver):
    super(DeleteObjectModal, self).__init__(driver)
    self.title_modal = base.Label(
        driver, self._locator.MODAL_TITLE)
    self.confirmation_text = base.Label(
        driver, self._locator.CONFIRMATION_TEXT)
    self.title_object = base.Label(
        driver, self._locator.OBJECT_TITLE)
    self.button_delete = base.Button(
        driver, self._locator.BUTTON_DELETE)

  def confirm_delete(self):
    """
    Returns:
        lib.page.dashboard.Dashboard
    """
    self.button_delete.click()
