groton-school / course-planning-tool

Course planning tool to distribute individual Google Sheet course plans to students and advisors based on Blackbaud registration data
GNU General Public License v3.0
0 stars 0 forks source link

need to incrementally expand protection when history expands #84

Closed github-actions[bot] closed 1 year ago

github-actions[bot] commented 1 year ago

https://api.github.com/groton-school/course-planning-tool/blob/7131402eb51f5138647b9208f033512899a02cba/src/CoursePlan/CoursePlan.ts#L250


              .build()
          );
        }
        validations.push(rowValidation);
      }
    }

    if (create) {
      // TODO need to incrementally expand protection when history expands
      this.protectNonCommentRanges(values[0].length, values.length);

      this.setStatus('configuring data validation'); // #create
      this.getAnchorOffset(0, values[0].length, validations.length, validations[0].length).setDataValidations(validations);

      this.insertAndMergeOptionsRows(values[0].length);
    }

    this.setStatus('publishing enrollment history') // #create, #update
    for (let row = 0; row < values.length; row++) {
      const target = this.getAnchorOffset(row * this.getNumOptionsPerDepartment(), 0, 1, values[row].length);
      target.clearDataValidations();
      target.setValues([values[row]]);
    }

    this.updateCourseList();
  }

  private static applyFormat = (format, data) =>
battis commented 1 year ago

Expanding ranges that are protected expands protection already.