mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-04 13:59:09 +00:00
refactor: clarify description import (#526)
This commit is contained in:
@@ -70,8 +70,9 @@ export const parseExcel = async (excelData) => {
|
|||||||
excelData
|
excelData
|
||||||
.filter((e) => e.length > 0)
|
.filter((e) => e.length > 0)
|
||||||
.forEach((row) => {
|
.forEach((row) => {
|
||||||
let eventTitleNext = false;
|
// project data imports are on the column to the right
|
||||||
let projectTitleNext = false;
|
let projectTitleNext = false;
|
||||||
|
let projectDescriptionNext = false;
|
||||||
let publicUrlNext = false;
|
let publicUrlNext = false;
|
||||||
let publicInfoNext = false;
|
let publicInfoNext = false;
|
||||||
let backstageUrlNext = false;
|
let backstageUrlNext = false;
|
||||||
@@ -81,12 +82,12 @@ export const parseExcel = async (excelData) => {
|
|||||||
|
|
||||||
row.forEach((column, j) => {
|
row.forEach((column, j) => {
|
||||||
// check flags
|
// check flags
|
||||||
if (eventTitleNext) {
|
if (projectTitleNext) {
|
||||||
projectData.title = column;
|
projectData.title = column;
|
||||||
eventTitleNext = false;
|
|
||||||
} else if (projectTitleNext) {
|
|
||||||
projectData.description = column;
|
|
||||||
projectTitleNext = false;
|
projectTitleNext = false;
|
||||||
|
} else if (projectDescriptionNext) {
|
||||||
|
projectData.description = column;
|
||||||
|
projectDescriptionNext = false;
|
||||||
} else if (publicUrlNext) {
|
} else if (publicUrlNext) {
|
||||||
projectData.publicUrl = column;
|
projectData.publicUrl = column;
|
||||||
publicUrlNext = false;
|
publicUrlNext = false;
|
||||||
@@ -159,10 +160,10 @@ export const parseExcel = async (excelData) => {
|
|||||||
// need to make sure it is a string first
|
// need to make sure it is a string first
|
||||||
switch (col) {
|
switch (col) {
|
||||||
case 'project name':
|
case 'project name':
|
||||||
eventTitleNext = true;
|
projectTitleNext = true;
|
||||||
break;
|
break;
|
||||||
case 'project description':
|
case 'project description':
|
||||||
projectTitleNext = true;
|
projectDescriptionNext = true;
|
||||||
break;
|
break;
|
||||||
case 'public url':
|
case 'public url':
|
||||||
publicUrlNext = true;
|
publicUrlNext = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user