Skip to content

Commit

Permalink
chore: script to clearing icons
Browse files Browse the repository at this point in the history
  • Loading branch information
luandro committed Oct 22, 2024
1 parent d170b88 commit 34db635
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/driveService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ function showDownloadLink(folderUrl: string) {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CoMapeo Configuration Generated</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;700&display=swap');
Expand Down Expand Up @@ -224,12 +223,11 @@ function showDownloadLink(folderUrl: string) {
<h1>CoMapeo Configuration Generated</h1>
<div class="container">
<p>Your CoMapeo configuration files have been successfully generated and compressed into a zip file.</p>
<p>To download your configuration, click the button below.</p>
<p>Once downloaded, extract the contents to locate the .comapeocat file, which can be imported into the CoMapeo app.</p>
<p>To download your configuration, click the button below. Once downloaded, extract the contents to locate the .comapeocat file, which can be imported into the CoMapeo app.</p>
<a href="${folderUrl}" target="_blank" class="folder-btn">Download CoMapeo Configuration</a>
</div>
</body>
</html>
`;
SpreadsheetApp.getUi().showModalDialog(HtmlService.createHtmlOutput(html).setWidth(750).setHeight(980), 'CoMapeo Configuration Generated');
SpreadsheetApp.getUi().showModalDialog(HtmlService.createHtmlOutput(html).setWidth(800).setHeight(980), 'CoMapeo Configuration Generated');
}
26 changes: 26 additions & 0 deletions src/test/cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,29 @@ function removeTranslationAndMetadataSheets(): void {

console.log("Finished removing translation sheets");
}

function deleteCategoriesSheetBColumn(): void {
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
const categoriesSheet = spreadsheet.getSheetByName("Categories");

if (!categoriesSheet) {
console.log("Categories sheet not found");
return;
}

const lastRow = categoriesSheet.getLastRow();
if (lastRow <= 1) {
console.log("Categories sheet is empty or contains only header");
return;
}

// Delete column B content, excluding the header
categoriesSheet.getRange(2, 2, lastRow - 1, 1).clearContent();

console.log("Deleted content from column B in Categories sheet, excluding the header");
}

function cleanup(): void {
removeTranslationAndMetadataSheets();
deleteCategoriesSheetBColumn();
}

0 comments on commit 34db635

Please sign in to comment.