Skip to content

Commit

Permalink
Merge pull request #1684 from ushahidi/migration/dev-workflow-setup
Browse files Browse the repository at this point in the history
Migration/dev workflow setup
  • Loading branch information
Angamanga committed Jul 1, 2021
2 parents bc4e571 + e136396 commit 8d9456d
Show file tree
Hide file tree
Showing 729 changed files with 40,142 additions and 1,658 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# dotrun package
.docker-project
.yarn.*.hash
.dotrun.json

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# build
/build

# local configuratinon
.env.*.local
.env.local

# junk
*.DS_Store
*.fuse*
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11,183 changes: 11,183 additions & 0 deletions api/package-lock.json

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions api/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ushahidi/api",
"scripts": {
"start": "webpack serve",
"start": "webpack serve --port 9093",
"start:standalone": "webpack serve --env standalone",
"build": "webpack --mode=production",
"analyze": "webpack --mode=production --env analyze",
Expand All @@ -13,9 +13,7 @@
"coverage": "cross-env BABEL_ENV=test jest --coverage"
},
"husky": {
"hooks": {

}
"hooks": {}
},
"devDependencies": {
"@babel/core": "^7.12.16",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
221 changes: 221 additions & 0 deletions legacy/app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
require('angular');
require('@uirouter/angularjs');
require('angular-resource');
require('angular-translate');
require('angular-translate-loader-static-files');
require('angular-ui-bootstrap');
require('angular-sanitize');
require('angular-elastic');
require('angular-filter');
require('angular-local-storage');
require('checklist-model');
require('ngGeolocation/ngGeolocation');
require('ng-showdown');
window.d3 = require('d3'); // Required for nvd3
require('./common/wrapper/nvd3-wrapper');
require('angular-nvd3/src/angular-nvd3');
require('angular-cache');
require('angular-linkify');
require('ngtweet');

// Make sure we have a window.ushahidi object
window.ushahidi = window.ushahidi || {};

// Load ushahidi modules
require('./common/common-module.js');
require('./main/main-module.js');
require('./settings/settings.module.js');
import ravenModule from './common/raven/raven';
import * as UshahidiSdk from 'ushahidi-platform-sdk/build/src/index';
// Load platform-pattern-library CSS
require('ushahidi-platform-pattern-library/assets/css/style.min.css');
require('../sass/vendor.scss');

// this 'environment variable' will be set within the gulpfile
var backendUrl = (window.ushahidi.backendUrl = (
window.ushahidi.backendUrl || BACKEND_URL
).replace(/\/$/, '')),
intercomAppId = (window.ushahidi.intercomAppId =
window.ushahidi.intercomAppId || ''),
ushDisableChecks = window.ushahidi.ushDisableChecks || USH_DISABLE_CHECKS,
verifier = (window.ushahidi.verifier =
window.ushahidi.verifier || VERIFIER),
appStoreId = (window.ushahidi.appStoreId =
window.ushahidi.appStoreId || ''),
apiUrl = (window.ushahidi.apiUrl = backendUrl + '/api/v3'),
claimedAnonymousScopes = [
'posts',
'country_codes',
'media',
'forms',
'api',
'tags',
'savedsearches',
'sets',
'users',
'stats',
'layers',
'config',
'messages',
'notifications',
'webhooks',
'contacts',
'roles',
'permissions',
'csv'
];

angular
.module('app', [
'checklist-model',
'monospaced.elastic',
'ui.router',
'ngResource',
'LocalStorageModule',
'pascalprecht.translate',
'ui.bootstrap.pagination',
'angular.filter',
'ng-showdown',
'ngGeolocation',
'nvd3',
'angular-cache',
'linkify',
ravenModule,
'ushahidi.common',
'ushahidi.main',
'ushahidi.settings',
'ui.bootstrap.dropdown',
'ngtweet'
])

.constant('CONST', {
BACKEND_URL: backendUrl,
API_URL: apiUrl,
INTERCOM_APP_ID: intercomAppId,
APP_STORE_ID: appStoreId,
VERIFIER: verifier,
DEFAULT_LOCALE: 'en_US',
OAUTH_CLIENT_ID: 'ushahidiui',
OAUTH_CLIENT_SECRET: '35e7f0bca957836d05ca0492211b0ac707671261',
CLAIMED_ANONYMOUS_SCOPES: claimedAnonymousScopes,
CLAIMED_USER_SCOPES: ['*'],
MAPBOX_API_KEY:
window.ushahidi.mapboxApiKey ||
'pk.eyJ1IjoidXNoYWhpZGkiLCJhIjoiY2lxaXUzeHBvMDdndmZ0bmVmOWoyMzN6NiJ9.CX56ZmZJv0aUsxvH5huJBw', // Default OSS mapbox api key
USH_DISABLE_CHECKS: ushDisableChecks,
TOS_RELEASE_DATE: new Date(window.ushahidi.tosReleaseDate).toJSON()
? new Date(window.ushahidi.tosReleaseDate)
: false, // Date in UTC
EXPORT_POLLING_INTERVAL:
window.ushahidi.export_polling_interval || 30000
})
.config([
'$compileProvider',
function ($compileProvider) {
$compileProvider.debugInfoEnabled(false);
}
])
.config([
'$locationProvider',
function ($locationProvider) {
$locationProvider.html5Mode(true).hashPrefix('!');
}
])
.config(function ($urlRouterProvider, $urlMatcherFactoryProvider) {
$urlRouterProvider.when('', '/views/map');
$urlRouterProvider.when('/', '/views/map');
// if the path doesn't match any of the urls you configured
// otherwise will take care of routing the user to the specified url
$urlRouterProvider.otherwise('/404');
$urlMatcherFactoryProvider.strictMode(false);
})
.config([
'$showdownProvider',
function ($showdownProvider) {
$showdownProvider.setOption('simplifiedAutoLink', true);
$showdownProvider.setOption(
'excludeTrailingPunctuationFromURLs',
true
);
$showdownProvider.setOption('openLinksInNewWindow', true);
$showdownProvider.setOption('tasklists', true);
$showdownProvider.setOption('sanitize', true);
}
])

.factory('_', function () {
return require('underscore/underscore');
})
.factory('d3', function () {
return window.d3;
})
.factory('URI', function () {
return require('URIjs/src/URI.js');
})
.factory('Leaflet', function () {
var L = require('leaflet');
// Load leaflet plugins here too
require('imports-loader?L=leaflet!leaflet.markercluster');
require('imports-loader?L=leaflet!leaflet.locatecontrol/src/L.Control.Locate');
require('imports-loader?L=leaflet!leaflet-easybutton');
return L;
})
.factory('moment', function () {
return require('moment');
})
.factory('BootstrapConfig', [
'_',
function (_) {
return window.ushahidi.bootstrapConfig
? _.indexBy(window.ushahidi.bootstrapConfig, 'id')
: { map: {}, site: {}, features: {} };
}
])
.factory('Sortable', function () {
return require('sortablejs/Sortable');
})
.factory('Editor', function () {
return require('@toast-ui/editor');
})
.factory('Flatpickr', function () {
return require('flatpickr').default;
})
.factory('UshahidiSdk', function () {
return UshahidiSdk;
})
.factory('FocusTrap', function () {
return require('focus-trap');
})
.run([
'$rootScope',
'LoadingProgress',
'$transitions',
'$uiRouter',
function ($rootScope, LoadingProgress, $transitions, $uiRouter) {
// this handles the loading-state app-wide
LoadingProgress.watchTransitions();
if (window.ushahidi.gaEnabled) {
$transitions.onSuccess({}, function (transition) {
window.ga('send', 'pageview', $uiRouter.urlRouter.location);
});
}
}
])
.run([
'DemoDeploymentService',
function (DemoDeploymentService) {
angular
.element(document.getElementById('bootstrap-app'))
.removeClass('hidden');
angular
.element(document.getElementById('bootstrap-loading'))
.addClass('hidden');
DemoDeploymentService.demoCheck();
}
])
.run([
'VerifierService',
function (VerifierService) {
VerifierService.debugModeCheck();
}
]);
17 changes: 9 additions & 8 deletions legacyApp/app/bootstrap.js → legacy/app/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,22 @@ const ngLifecycles = singleSpaAngularJS({
preserveGlobal: false,
strictDi: true,
template: require('./index.html')
});
});

export const bootstrap = ngLifecycles.bootstrap;

export const mount = (opts, mountedInstances, props) => {
if (window.ushahidi && window.ushahidi.backendUrl && !window.ushahidi.bootstrapConfig) {
return fetch(window.ushahidi.backendUrl, response => {
return response.json();
}).then(config => {
// setting config
window.ushahidi.bootstrapConfig = config;
return ngLifecycles.mount(opts, mountedInstances, props);
});
return fetch(window.ushahidi.backendUrl, response => {
return response.json();
}).then(config => {
// setting config
window.ushahidi.bootstrapConfig = config;
return ngLifecycles.mount(opts, mountedInstances, props);
});
} else {
return ngLifecycles.mount(opts, mountedInstances, props);
}
}

export const unmount = ngLifecycles.unmount;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 8d9456d

Please sign in to comment.