Skip to content

Commit

Permalink
Merge pull request #20 from rodydavis/master
Browse files Browse the repository at this point in the history
Fixing errors caused in staging deployment
  • Loading branch information
rodydavis authored Feb 18, 2022
2 parents cd89dcb + 28614ea commit 9344c91
Show file tree
Hide file tree
Showing 35 changed files with 70,976 additions and 313 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ app/js/*.js
config.js
config.yaml

app/ts/config.ts
app/ts/config.ts
spec.json
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,12 @@ npm run start
```

6. View the server at http://localhost:8080/


## Troubleshooting

```
ImportError: cannot import name apiproxy
```

https://stackoverflow.com/questions/69465376/app-engine-python-2-7-importerror-cannot-import-name-apiproxy
6 changes: 6 additions & 0 deletions app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ handlers:
- url: /third_party
static_dir: third_party

- url: /third_party/js
static_dir: third_party/js

- url: /third_party/css
static_dir: third_party/css

- url: /css
static_dir: app/css

Expand Down
6 changes: 3 additions & 3 deletions app/ts/baseCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { app } from './app.js';
import {app} from './app.js';

app.controller(
'baseCtrl',
Expand Down Expand Up @@ -50,7 +50,7 @@ app.controller(
ev.stopPropagation();

// Clone project data
Spec.get({ id: project.id }, function (data) {
Spec.get({id: project.id}, function (data) {
var newSpec = {
group: data.group,
groupHandle: data.groupHandle,
Expand Down Expand Up @@ -89,7 +89,7 @@ app.controller(
$mdDialog.show(confirm).then(
function () {
// Delete project
Spec.delete({ id: project.id }, function (resp) {
Spec.delete({id: project.id}, function (resp) {
if (callback) {
callback();
}
Expand Down
2 changes: 1 addition & 1 deletion app/ts/canvasDirectives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { app } from './app.js';
import {app} from './app.js';

declare const angular;

Expand Down
2 changes: 1 addition & 1 deletion app/ts/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { app } from './app.js';
import {app} from './app.js';

app.filter('nl2br', [
'$sce',
Expand Down
2 changes: 1 addition & 1 deletion app/ts/gapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var scopeModel;

function onApiLoad() {
gapi.load('auth');
gapi.load('picker', { callback: onPickerApiLoad });
gapi.load('picker', {callback: onPickerApiLoad});
}

function loadPicker(model) {
Expand Down
4 changes: 2 additions & 2 deletions app/ts/groupCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { app } from './app.js';
import {app} from './app.js';

declare const angular;

Expand All @@ -26,7 +26,7 @@ app.controller(

var groupHandle = $routeParams.group.replace(/\s+/g, '-').toLowerCase();

Spec.query({ group: groupHandle }, function (specs) {
Spec.query({group: groupHandle}, function (specs) {
// Show new project message if necessary
if (specs.length < 1) {
$scope.hasProjects = false;
Expand Down
2 changes: 1 addition & 1 deletion app/ts/projectListService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { app } from './app.js';
import {app} from './app.js';

app.service('projectListService', function () {
// multispec selection
Expand Down
4 changes: 2 additions & 2 deletions app/ts/sidebarCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { app } from './app.js';
import {app} from './app.js';

declare const angular;

Expand All @@ -22,7 +22,7 @@ app.controller('sidebarCtrl', function ($scope, Spec, projectListService) {
// Updates sidebar with new items and edits
$scope.$on('refreshSidebar', function () {
$scope.projectGroups = [];
Spec.query({ owner: $scope.user }, function (specs) {
Spec.query({owner: $scope.user}, function (specs) {
$scope.projectGroups = [];
angular.forEach(specs, function (spec, index) {
projectListService.addProject($scope, spec);
Expand Down
2 changes: 1 addition & 1 deletion app/ts/specCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { app } from './app.js';
import {app} from './app.js';

app.controller('specCtrl', function ($scope, $routeParams, $sce, $location) {
// Initial Config
Expand Down
4 changes: 2 additions & 2 deletions app/ts/specDirectives.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { app } from './app.js';
import {app} from './app.js';

/*
* initializes wrapperElem for specTabCtrl scope
Expand Down Expand Up @@ -178,7 +178,7 @@ app.directive('scrubbable', function () {
// @ts-ignore
scrubber.draggable({
axis: 'x',
cursorAt: { left: 0 },
cursorAt: {left: 0},
drag: function (evt, ui) {
ui.position.left = constrainScrubberX(ui.position.left);
scrubVideoX(ui.position.left);
Expand Down
4 changes: 2 additions & 2 deletions app/ts/specResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { app } from './app.js';
import {app} from './app.js';

app.provider('Spec', function () {
// @ts-ignore
Expand Down Expand Up @@ -83,7 +83,7 @@ app.provider('Spec', function () {

value.id = id;
localStorageService.set(id, value);
callback({ id: id });
callback({id: id});
}, 0);
},
update: function (params, value, callback) {
Expand Down
9 changes: 8 additions & 1 deletion app/ts/specTabCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@ app.controller(
const result = e.target?.result;
if (!result) return;
const json = JSON.parse(result as string);
const current = $scope.data;
// Copy id,persmissions, group,groupHandle
json.id = current.id;
json.permissions = current.permissions;
json.group = current.group;
json.groupHandle = current.groupHandle;
// json.title = current.title;
$scope.data = json;
$scope.spec = $scope.data.spec;
$scope.refreshCanvas();
Expand All @@ -238,7 +245,7 @@ app.controller(

$scope.exportJson = function () {
// Export Json
const spec = $scope.spec;
const spec = $scope.data;
const json = JSON.stringify(spec, null, 2);
const blob = new Blob([json], {type: 'application/json'});
const url = URL.createObjectURL(blob);
Expand Down
26 changes: 18 additions & 8 deletions app/ts/storageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { app } from './app.js';
import {app} from './app.js';

declare const angular;

Expand Down Expand Up @@ -44,14 +44,24 @@ app.service(
var sanitizedData = function (data) {
if (typeof data === 'undefined') return data;
// Clone data
var sanitizedData = JSON.parse(JSON.stringify(data));
let sanitizedData = JSON.parse(JSON.stringify(data));

// spec properties to remove
delete sanitizedData.spec.canvas.width;
delete sanitizedData.spec.divisions.minorCount;
delete sanitizedData.spec.divisions.minorGap;
delete sanitizedData.spec.divisions.majorCount;
delete sanitizedData.spec.divisions.majorGap;
// try {
// delete sanitizedData.spec.canvas.width;
// } catch (error) {}
// try {
// delete sanitizedData.spec.divisions.minorCount;
// } catch (error) {}
// try {
// delete sanitizedData.spec.divisions.minorGap;
// } catch (error) {}
// try {
// delete sanitizedData.spec.divisions.majorCount;
// } catch (error) {}
// try {
// delete sanitizedData.spec.divisions.majorGap;
// } catch (error) {}

return sanitizedData;
};
Expand All @@ -74,7 +84,7 @@ app.service(
var save = function (scope) {
// Update Spec
Spec.update(
{ id: scope.data.id },
{id: scope.data.id},
sanitizedData(scope.data),
function (resp) {
console.log(resp);
Expand Down
4 changes: 2 additions & 2 deletions app/ts/userCtrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

import { app } from './app.js';
import {app} from './app.js';

declare const angular;

Expand All @@ -31,7 +31,7 @@ app.controller(
$scope.isOwner = false;
}

Spec.query({ owner: $routeParams.user }, function (specs) {
Spec.query({owner: $routeParams.user}, function (specs) {
// Show new project message if necessary
if (specs.length < 1) {
$scope.hasProjects = false;
Expand Down
Loading

0 comments on commit 9344c91

Please sign in to comment.