Skip to content

Commit

Permalink
445/bower-fix-and-cleanup (#446)
Browse files Browse the repository at this point in the history
* Remove angulartics from app module

* Test adding openssl-ca to env in deploy

* Update deploy.yml

* Remove angulartics from html

* Remove attributes in button controller and minor cleanup
  • Loading branch information
oscgonfer authored Oct 2, 2023
1 parent 907fb36 commit bce8e5f
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 95 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Deploy to GH

on:
push:
branches: [ master ]
on: [push]

jobs:
test:
Expand All @@ -19,6 +17,7 @@ jobs:
- name: Test something (currently we have no tests)
run: |
npm install -g gulp-cli
export NODE_OPTIONS=--use-openssl-ca
npm install
gulp build
Expand All @@ -27,4 +26,4 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
if: job.status == 'success'
if: github.ref == 'refs/heads/master' && job.status == 'success'
2 changes: 0 additions & 2 deletions src/app/app.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ angular.module('app', [
'app.components',
'papa-promise',
'angularLoad',
'angulartics',
'angulartics.google.analytics',
'ngSanitize',
'angular-clipboard',
'ngCookies',
Expand Down
26 changes: 13 additions & 13 deletions src/app/components/alert/alert.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@

AlertController.$inject = ['$scope', '$mdToast', 'message', 'button', 'href'];
function AlertController($scope, $mdToast, message, button, href) {
var vm = this;
var vm = this;

vm.close = close;
vm.message = message;
vm.button = button;
vm.href = href;
vm.close = close;
vm.message = message;
vm.button = button;
vm.href = href;

// hideAlert will be triggered on state change
$scope.$on('hideAlert', function() {
close();
});
// hideAlert will be triggered on state change
$scope.$on('hideAlert', function() {
close();
});

///////////////////
///////////////////

function close() {
$mdToast.hide();
}
function close() {
$mdToast.hide();
}
}
})();
22 changes: 7 additions & 15 deletions src/app/components/alert/alert.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@
function infoNoDataVisitor() {
info('Woah! We couldn\'t locate this kit on the map because it hasn\'t published any data. Leave a ' +
'comment to let its owner know.',
10000,
{
button: 'Leave comment',
buttonAttributes: 'analytics-on="click" analytics-event="click" ' +
'analytics-category="Offline Kit Comment Link"',
href: 'https://forum.smartcitizen.me/'
});
10000,
{
button: 'Leave comment',
href: 'https://forum.smartcitizen.me/'
});
}

function infoNoDataOwner() {
Expand All @@ -55,25 +53,20 @@
10000,
{
button: 'Leave comment',
buttonAttributes: 'analytics-on="click" analytics-event="click" ' +
'analytics-category="Private Kit Comment Link"',
href: 'https://forum.smartcitizen.me/'
});
}

function infoLongTime() {
info('😅 It looks like this kit hasn\'t posted any data in a long ' +
'time. Why not leave a comment to let its owner know?', 10000,
'time. Why not leave a comment to let its owner know?',
10000,
{
button: 'Leave comment',
buttonAttributes: 'analytics-on="click" analytics-event="click" ' +
'analytics-category="Long time No published Kit Comment Link"',
href: 'https://forum.smartcitizen.me/'
});
}



function info(message, delay, options) {
if(options && options.button) {
toast('infoButton', message, options, undefined, delay);
Expand All @@ -95,7 +88,6 @@
locals: {
message: message,
button: options && options.button,
buttonAttributes: options && options.buttonAttributes,
href: options && options.href
}
});
Expand Down
3 changes: 1 addition & 2 deletions src/app/components/alert/alertinfoButton.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
alt="Alert icon" class="alert_typeIcon">
</md-icon>
<span flex>{{ vm.message }}</span>
<md-button ng-href="{{vm.href}}" class="alert_button">{{ vm.button }}</md-button>
<md-button ng-href="{{vm.href}}" class="alert_button">{{ vm.button }}</md-button>
</div>

<div flex-nogrow>
<md-button ng-click="vm.close()" aria-label>
<md-icon md-svg-src="./assets/images/close_icon_black.svg"
Expand Down
24 changes: 6 additions & 18 deletions src/app/components/kit/showKit/showKit.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,33 +42,25 @@

<div hide show-gt-xs flex="nogrow" class="kit_navbar" active-button layout="row" layout-align="end center">

<md-button href="#" class="md-flat chart_icon btn-small" aria-label=""
analytics-on="click" analytics-category="Kit Detail Section Button"
analytics-event="click" analytics-label="Chart">
<md-button href="#" class="md-flat chart_icon btn-small" aria-label="">
<md-tooltip md-direction="top">Chart</md-tooltip>
<md-icon md-svg-src="./assets/images/chart_icon.svg">
</md-icon>
</md-button>

<md-button href="#" class="md-flat kit_details_icon btn-small" aria-label=""
analytics-on="click" analytics-category="Kit Detail Section Button"
analytics-event="click" analytics-label="Kit">
<md-button href="#" class="md-flat kit_details_icon btn-small" aria-label="">
<md-tooltip md-direction="top">Kit Detail</md-tooltip>
<md-icon md-svg-src="./assets/images/kit_details_icon_light.svg">
</md-icon>
</md-button>

<md-button href="#" class="md-flat user_details btn-small" aria-label=""
analytics-on="click" analytics-category="Kit Detail Section Button"
analytics-event="click" analytics-label="User">
<md-button href="#" class="md-flat user_details btn-small" aria-label="">
<md-tooltip md-direction="top">User info</md-tooltip>
<md-icon md-svg-src="./assets/images/user_details_icon.svg">
</md-icon>
</md-button>
<!-- HACK: disable because of lodash -->
<!-- <md-button href="#" class="md-flat discussion_icon" aria-label=""
analytics-on="click" analytics-category="Kit Detail Section Button"
analytics-event="click" analytics-label="Comments">
<!-- <md-button href="#" class="md-flat discussion_icon" aria-label="">
<md-icon md-svg-src="./assets/images/discussion_icon.svg">
</md-icon>
</md-button> -->
Expand Down Expand Up @@ -132,9 +124,7 @@ <h2 class="title">
</div>
<div class="sensor_select">
<md-select placeholder="CHOOSE SENSOR" ng-model="vm.selectedSensor">
<md-option ng-if="(sensor.name != 'battery' || (sensor.name == 'battery' && sensor.value != -1)) && !(!vm.showRaw && sensor.tags.indexOf('raw') !== -1)" ng-repeat="sensor in vm.chartSensors" ng-value="{{sensor.id}}" ng-selected="$first"
analytics-on="click" analytics-category="Kit Chart"
analytics-event="click" analytics-label="Metric" class="color-dropdown">
<md-option ng-if="(sensor.name != 'battery' || (sensor.name == 'battery' && sensor.value != -1)) && !(!vm.showRaw && sensor.tags.indexOf('raw') !== -1)" ng-repeat="sensor in vm.chartSensors" ng-value="{{sensor.id}}" ng-selected="$first" class="color-dropdown">
<md-icon md-svg-src="{{ sensor.icon }}"></md-icon>
<span class="md-primary">{{ sensor.name }}</span>
</md-option>
Expand All @@ -151,9 +141,7 @@ <h6>{{ vm.sensorNames[vm.selectedSensor] }} </h6>
<div style="display: block; width: 100%;">
<span style="vertical-align: middle;">Compare with</span>
<md-select placeholder="NONE" ng-model="vm.selectedSensorToCompare">
<md-option ng-repeat="sensor in vm.sensorsToCompare" ng-value="{{sensor.id}}" ng-if="(sensor.name != 'battery' || (sensor.name == 'battery' && sensor.value != -1)) && !(!vm.showRaw && sensor.tags.indexOf('raw') !== -1)"
analytics-on="click" analytics-category="Kit Chart"
analytics-event="click" analytics-label="Compare" class="color-dropdown">
<md-option ng-repeat="sensor in vm.sensorsToCompare" ng-value="{{sensor.id}}" ng-if="(sensor.name != 'battery' || (sensor.name == 'battery' && sensor.value != -1)) && !(!vm.showRaw && sensor.tags.indexOf('raw') !== -1)" class="color-dropdown">
<md-icon md-svg-src="{{ sensor.icon }}"></md-icon>
<span class="md-primary">{{ sensor.name }}</span>
</md-option>
Expand Down
21 changes: 0 additions & 21 deletions src/app/components/landing/landing.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
<img class="sc-logo" src="/assets/images/smartcitizen_logo.svg" alt="logo" />
<a href="/kits/"
class="btn-black-outline btn-round-new sc-off-cta-platform"
analytics-on="click"
analytics-category="Landing"
>GO TO THE PLATFORM</a>

<section class="video-section">
<div class="heading-over-video" layout="column" layout-align="center start">
<h1 class="color-white font-kanit">ORDER YOUR SMART CITIZEN KIT FROM SEEED STUDIO</h1>
<a href="https://www.seeedstudio.com/Smart-Citizen-Starter-Kit-p-2865.html"
class="btn-blue btn-round-new mb-30 mt-20"
analytics-on="click"
analytics-category="Landing"
>ORDER NOW</a>
</div>
</section>
Expand All @@ -28,8 +24,6 @@ <h2>WE EMPOWER COMMUNITIES TO BETTER UNDERSTAND THEIR ENVIRONMENT</h2>
<p style="margin-bottom:33px">We're a community of passionate people who believe data is critical to inform political participation at all levels. We develop tools for citizen action in environmental monitoring and methodologies for community engagement and co-creation.</p>
<a href="https://www.youtube.com/watch?v=hvn5LyACUYw"
class="btn-black-outline btn-round-new"
analytics-on="click"
analytics-category="Landing"
>WATCH DOCUMENTARY</a>
</div>
<div flex-order-xs="1" class="img-new_sck tile tile-left tile-image border-xs-top">
Expand All @@ -44,8 +38,6 @@ <h2>INTRODUCING A NEW AND IMPROVED KIT</h2>
<p style="margin-bottom:33px">For the past three years, we have been working on an updated version of the Kit. The new sensors collect urban data more accurately and are easier to use. The Smart Citizen Kit 2.1 is available from Seeed studio.</p>
<a href="https://www.seeedstudio.com/Smart-Citizen-Starter-Kit-p-2865.html"
class="btn-black-outline btn-round-new"
analytics-on="click"
analytics-category="Landing"
>ORDER NOW</a>
</div>
</div>
Expand Down Expand Up @@ -103,8 +95,6 @@ <h2>CIVIC PARTICIPATION ACROSS THE GLOBE</h2>
<div layout="column" layout-align="end center" style="" class="img-platform tile tile-left tile-image">
<a href="/kits/"
class="btn-blue btn-round-new mb-30"
analytics-on="click"
analytics-category="Landing"
>GO TO THE PLATFORM</a>
</div>
</section>
Expand All @@ -123,8 +113,6 @@ <h2>AN OPEN PLATFORM TO LEARN, BUILD AND CONTRIBUTE</h2>
<div layout="column" layout-align="end center" style="" class="img-docs tile tile-left tile-image">
<a href="https://docs.smartcitizen.me/"
class="btn-blue btn-round-new mb-30"
analytics-on="click"
analytics-category="Landing"
>GO TO THE DOCS</a>
</div>
</section>
Expand All @@ -145,9 +133,6 @@ <h3 class="color-white text-left my-20" >SUBSCRIBE TO GET THE LATEST NEWS</h3>
name="subscribe"
id="mc-embedded-subscribe"
value="GO!"
analytics-on="click"
analytics-category="Landing"
analytics-event="Subscribe to newsletter"
/>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
Expand All @@ -169,8 +154,6 @@ <h3>DEVELOPER<br> READY</h3>
<p>Use our powerful API to build amazing things using data.</p>
<a href="https://developer.smartcitizen.me/"
class="btn-black-outline btn-round-new"
analytics-on="click"
analytics-category="Landing"
>USE THE API</a>
</div>
<div flex="30" flex-sm="100" flex-xs="100" layout="column" layout-align="space-between center" class="bg-white border-black px-20 py-40 mb-10" >
Expand All @@ -179,8 +162,6 @@ <h3>WE’RE<br>OPEN SOURCE</h3>
<p>Fork and contribute to the project in GitHub.</p>
<a href="https://github.com/fablabbcn?utf8=✓&q=smartcitizen"
class="btn-black-outline btn-round-new"
analytics-on="click"
analytics-category="Landing"
>VISIT OUR REPOS</a>
</div>
<div flex="30" flex-sm="100" flex-xs="100" layout="column" layout-align="space-between center" class="bg-white border-black px-20 py-40 mb-10">
Expand All @@ -189,8 +170,6 @@ <h3>JOIN THE<br>FORUM</h3>
<p>A place to share ideas with the community or find support.<p>
<a href="https://forum.smartcitizen.me"
class="btn-black-outline btn-round-new"
analytics-on="click"
analytics-category="Landing"
>GET INVOLVED</a>
</div>
</div>
Expand Down
9 changes: 3 additions & 6 deletions src/app/components/myProfile/Kits.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@

<div class="" layout="row" layout-align="center center" layout-gt-sm="column">
<md-button ng-click="vm.filterKits('all')"
class="profile_sidebar_button" analytics-on="click"
analytics-event="Profile" analytics-action="kit filter">
class="profile_sidebar_button">
ALL
</md-button>
<md-button ng-click="vm.filterKits('online')"
class="profile_sidebar_button" analytics-on="click"
analytics-event="Profile" analytics-action="kit filter">
class="profile_sidebar_button">
ONLINE
</md-button>
<md-button ng-click="vm.filterKits('offline')"
class="profile_sidebar_button" analytics-on="click"
analytics-event="Profile" analytics-action="kit filter">
class="profile_sidebar_button">
OFFLINE
</md-button>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/app/components/myProfile/myProfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h2 class="profile_header_name">{{ vm.user.username || 'No data' }}</h2>

<div class="myProfile_tabs_parent" flex>
<md-tabs md-dynamic-height="" class="myProfile_tabs" md-center-tabs="false" md-selected="vm.startingTab">
<md-tab label md-on-select="vm.selectThisTab(0, 'kits')" analytics-on="click" analytics-event="Profile" analytics-action="kits">
<md-tab label md-on-select="vm.selectThisTab(0, 'kits')">
<md-tab-label>
<md-icon md-svg-src="./assets/images/kit_details_icon_light.svg" class="myProfile_tab_icon"></md-icon>
<span class="color-white">KITS</span>
Expand All @@ -31,7 +31,7 @@ <h2 class="profile_header_name">{{ vm.user.username || 'No data' }}</h2>
</ui-view>
</md-tab-body>
</md-tab>
<md-tab label md-on-select="vm.selectThisTab(1, 'user')" analytics-on="click" analytics-event="Profile" analytics-action="profile">
<md-tab label md-on-select="vm.selectThisTab(1, 'user')">
<md-tab-label>
<md-icon md-svg-src="./assets/images/user_details_icon.svg" class="myProfile_tab_icon"></md-icon>
<span class="color-white">USER</span>
Expand All @@ -42,7 +42,7 @@ <h2 class="profile_header_name">{{ vm.user.username || 'No data' }}</h2>
</ui-view>
</md-tab-body>
</md-tab>
<!-- <md-tab label md-on-select="vm.selectThisTab(2, 'tools')" analytics-on="click" analytics-event="Profile" analytics-action="tools">
<!-- <md-tab label md-on-select="vm.selectThisTab(2, 'tools')">
<md-tab-label>
<md-icon md-svg-src="./assets/images/support_icon_white.svg" class="myProfile_tab_icon"></md-icon>
<span class="color-white">TOOLS</span>
Expand Down
4 changes: 1 addition & 3 deletions src/app/components/signup/signup.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<md-button class="" ng-click="vm.showSignup($event)"
analytics-on="click" analytics-event="Signup"
analytics-action="click">
<md-button class="" ng-click="vm.showSignup($event)">
Sign Up
</md-button>
3 changes: 1 addition & 2 deletions src/app/components/signup/signupModal.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ <h2>Sign up</h2>
</md-input-container>
</div>

<md-button class="md-primary" ng-click="openLogin()"
analytics-on="click" analytics-event="Signup" analytics-action="login">
<md-button class="md-primary" ng-click="openLogin()">
Already have an account? Log in
</md-button>
</div>
Expand Down
9 changes: 3 additions & 6 deletions src/app/components/userProfile/userProfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,15 @@ <h2 class="profile_header_name">{{ vm.user.username || 'No data' }}</h2>
<p class="profile_sidebar_title">FILTER KITS BY</p>
<div class="" layout="column">
<md-button ng-click="vm.filterKits('all')"
class="profile_sidebar_button" analytics-on="click"
analytics-event="Profile" analytics-action="kit filter">
class="profile_sidebar_button">
ALL
</md-button>
<md-button ng-click="vm.filterKits('online')"
class="profile_sidebar_button" analytics-on="click"
analytics-event="Profile" analytics-action="kit filter">
class="profile_sidebar_button">
ONLINE
</md-button>
<md-button ng-click="vm.filterKits('offline')"
class="profile_sidebar_button" analytics-on="click"
analytics-event="Profile" analytics-action="kit filter">
class="profile_sidebar_button">
OFFLINE
</md-button>
</div>
Expand Down

0 comments on commit bce8e5f

Please sign in to comment.