     delete @state.manifests[name]
     @forceUpdate();
 
+  deleteSubjectSet: ->
+    @setState deletionError: null
+
+    confirmed = confirm 'Really delete this subject set and all its subjects?'
+
+    if confirmed
+      @setState deletionInProgress: true
+
+      this.props.subjectSet.delete()
+        .then =>
+          @props.project.uncacheLink 'subject_sets'
+          @transitionTo 'edit-project-details', projectID: @props.project.id
+        .catch (error) =>
+          @setState deletionError: error
+        .then =>
+          if @isMounted()
+            @setState deletionInProgress: false
+
 module.exports = React.createClass
   displayName: 'EditSubjectSetPageWrapper'
 

apiClient = require '../../api/client'
ChangeListener = require '../../components/change-listener'
Papa = require 'papaparse'

NOOP = Function.prototype


EditSubjectSetPage = React.createClass
  displayName: 'EditSubjectSetPage'

  mixins: [Navigation]

  getDefaultProps: ->
    subjectSet: null

  getInitialState: ->
    manifests: {}
    files: {}
    deletionError: null
    deletionInProgress: false

  render: ->
    <div>
