Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions tools/admin/operations/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,10 @@ export async function uploadBlockDocs(org, site, blocksToUpload, onProgress) {

export async function updateLibraryBlocksJSON(org, site, blockNames) {
let existingBlocks = [];
let existingOptions = null;

try {
const existingBlocksJSON = await fetchBlocksJSON(org, site);
existingBlocks = getBlocksArray(existingBlocksJSON);
if (existingBlocksJSON?.options) {
existingOptions = existingBlocksJSON.options;
}
} catch (error) {
// ignore
}
Expand Down Expand Up @@ -149,10 +145,6 @@ export async function updateLibraryBlocksJSON(org, site, blockNames) {
site,
);

if (existingOptions) {
blocksJSON.options = existingOptions;
}

return updateBlocksJSON(org, site, blocksJSON);
}

Expand Down
47 changes: 5 additions & 42 deletions tools/admin/utils/doc-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,49 +73,12 @@ export function generateBlocksJSON(blocks, org, site) {
path: block.path || getContentBlockPath(org, site, block.name),
}));

const optionsSheet = [
{
key: 'style',
blocks: 'section-metadata',
values: 'xxs-spacing | xs-spacing | s-spacing | m-spacing | l-spacing | xl-spacing | xxl-spacing | dark | light | quiet',
},
{
key: 'gap',
blocks: 'ALL',
values: '100 | 200 | 300 | 400 | 500 | 600 | 700 | 800',
},
{
key: 'background',
blocks: 'section-metadata',
values: 'dark-grey=#676767 | light-grey=#EFEFEF | adobe-red=#FF0000 | blue=#0077B6 | green=#00A36C',
},
{
key: 'spacing',
blocks: 'section-metadata',
values: '400 | 500 | 600 | 700 | 800',
},
{
key: 'template',
blocks: 'metadata',
values: 'blog-post | product-page | feature-page',
},
];

return {
':version': 3,
':names': ['data', 'options'],
':type': 'multi-sheet',
data: {
total: dataSheet.length,
limit: dataSheet.length,
offset: 0,
data: dataSheet,
},
options: {
total: optionsSheet.length,
limit: optionsSheet.length,
offset: 0,
data: optionsSheet,
},
':type': 'sheet',
total: dataSheet.length,
limit: dataSheet.length,
offset: 0,
data: dataSheet,
};
}
Loading