Skip to content

Commit

Permalink
removed code related to gallery widget preview and control thumbnails
Browse files Browse the repository at this point in the history
  • Loading branch information
owenhoskins committed Jun 13, 2018
1 parent c2d491e commit 56b9856
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 212 deletions.
124 changes: 62 additions & 62 deletions dist/cms.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cms.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@
"react-immutable-proptypes": "^2.1.0",
"react-intersection-observer": "^3.0.3",
"react-modal": "^3.1.5",
"react-photo-gallery": "^6.0.22",
"react-redux": "^4.4.0",
"react-router-dom": "^4.2.2",
"react-router-redux": "^5.0.0-alpha.8",
Expand Down
11 changes: 0 additions & 11 deletions src/backends/github/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export default class API {
const headers = this.requestHeaders(options.headers || {});
const url = this.urlFor(path, options);
let responseStatus;
console.log('API request: ', path, headers, url)
return fetch(url, { ...options, headers }).then((response) => {
responseStatus = response.status;
const contentType = response.headers.get("Content-Type");
Expand All @@ -87,7 +86,6 @@ export default class API {
return response.text();
})
.catch((error) => {
console.log('error: ', error, responseStatus)
throw new APIError(error.message, responseStatus, 'GitHub');
});
}
Expand Down Expand Up @@ -272,12 +270,8 @@ export default class API {

const fileTree = this.composeFileTree(files);

// debug console.log('persistFiles: fileTree', fileTree)

return Promise.all(uploadPromises).then(() => {
if (!options.mode || (options.mode && options.mode === SIMPLE)) {
// debug console.log('presitFiles: uploadPromises, getBranch()', uploadPromises )
// it probably is in the updateTree call
return this.getBranch()
.then(branchData => this.updateTree(branchData.commit.sha, "/", fileTree))
.then(changeTree => this.commit(options.commitMessage, changeTree))
Expand Down Expand Up @@ -488,7 +482,6 @@ export default class API {
* Get the blob data by path.
*/

// debug console.log('rebaseSingleBlobCommit: ', parent, commit.tree.sha, pathToBlpor)
return this.getBlobInTree(commit.tree.sha, pathToBlob)

/**
Expand Down Expand Up @@ -721,7 +714,6 @@ export default class API {
}

updateTree(sha, path, fileTree) {
// debug console.log('updateTree: ', sha, path, fileTree)
return this.getTree(sha)
.then((tree) => {
let obj;
Expand Down Expand Up @@ -751,18 +743,15 @@ export default class API {
);
}

// debug console.log('updates: ', updates)
return Promise.all(updates)
.then(tree => this.createTree(sha, tree))
.then(response => {
// debug console.log('updateTree Promise response: ', response)
return ({ path, mode: "040000", type: "tree", sha: response.sha, parentSha: sha })
});
});
}

createTree(baseSha, tree) {
// debug console.log('createTree: ', baseSha, tree)
return this.request(`${ this.repoURL }/git/trees`, {
method: "POST",
body: JSON.stringify({ base_tree: baseSha, tree }),
Expand Down
3 changes: 0 additions & 3 deletions src/backends/github/implementation.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ export default class GitHub {
async persistMedia(mediaFile, options = {}) {
try {
const response = await this.api.persistFiles(null, [mediaFile], options);
// here it is failing, response is returning with an error
console.log('persistMedia: ', response, mediaFile, options)
const repo = this.repo || this.getRepoFromResponseUrl(response.url);
const { value, size, path, fileObj } = mediaFile;
let url = `https://raw.githubusercontent.com/${repo}/${this.branch}${path}`;
Expand All @@ -153,7 +151,6 @@ export default class GitHub {
return { id: mediaFile.sha, name: value, size: fileObj.size, url, path: trimStart(path, '/') };
}
catch(error) {
console.error('presistMedia: ', error);
throw error;
}
}
Expand Down
129 changes: 0 additions & 129 deletions src/components/EditorWidgets/Gallery/GalleryPreview.js

This file was deleted.

6 changes: 1 addition & 5 deletions src/components/EditorWidgets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import MarkdownControl from './Markdown/MarkdownControl';
import MarkdownPreview from './Markdown/MarkdownPreview';
import ListControl from './List/ListControl';
import ListPreview from './List/ListPreview';
//import GalleryControl from './Gallery/GalleryControl'
import GalleryPreview from './Gallery/GalleryPreview'
import ObjectControl from './Object/ObjectControl';
import ObjectPreview from './Object/ObjectPreview';
import RelationControl from './Relation/RelationControl';
Expand All @@ -43,6 +41,4 @@ registerWidget('select', SelectControl, SelectPreview);
registerWidget('object', ObjectControl, ObjectPreview);
registerWidget('relation', RelationControl, RelationPreview);
registerWidget('boolean', BooleanControl);
registerWidget('unknown', UnknownControl, UnknownPreview);

registerWidget('gallery', ListControl, GalleryPreview);
registerWidget('unknown', UnknownControl, UnknownPreview);

0 comments on commit 56b9856

Please sign in to comment.