Skip to content

Commit

Permalink
Merge pull request #435 from crossroads/master
Browse files Browse the repository at this point in the history
[Release] Admin v0.17.2
  • Loading branch information
patrixr authored Jun 12, 2020
2 parents 300ffe5 + cab243e commit 066609a
Show file tree
Hide file tree
Showing 30 changed files with 261 additions and 332 deletions.
17 changes: 15 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ jobs:
www_deploy:
<<: *defaults
docker:
- image: circleci/ruby:2.5.1-node
- image: circleci/ruby:2.5.5
steps:
- restore-cache: *restore-repo-cache
- restore-cache: *restore-bundler-cache
Expand Down Expand Up @@ -293,13 +293,26 @@ jobs:

ios_build_and_deploy:
macos:
xcode: "10.1.0"
xcode: "11.0.0"
working_directory: ~/code
shell: /bin/bash --login -eo pipefail
environment:
CIRCLE_ARTIFACTS: /Users/distiller/code/cordova/platforms/ios/build/device
steps:
- checkout
- run:
name: install [email protected]
command: |
set +e
touch $BASH_ENV
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash
echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
echo nvm install 8.15.0 >> $BASH_ENV
echo nvm alias default 8.15.0 >> $BASH_ENV
- run:
name: verify node version
command: node --version
- restore-cache: *restore-ios-yarn-cache
- run: *yarn
- save-cache: *save-ios-yarn-cache
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Forward release notes

on:
pull_request:
types: [closed]
branches:
- live

jobs:
release-notes:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v2
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Generate and email notes
run: npx @goodcity/release-notes --email-to "[email protected],[email protected],[email protected]" --head ${{github.event.pull_request.head.sha}} --base ${{github.event.pull_request.base.sha}} --email-subject "🚀 Admin Release 🚀"
env:
JIRA_USERNAME: ${{secrets.jira_username}}
JIRA_PASSWORD: ${{secrets.jira_password}}
SENDGRID_API_KEY: ${{secrets.sendgrid_api_key}}
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.5.3
ruby-2.5.5
11 changes: 0 additions & 11 deletions app/controllers/finished.js

This file was deleted.

21 changes: 20 additions & 1 deletion app/controllers/image_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import utils from "../utils/utility-methods";
*
*/
export default Ember.Controller.extend(AsyncMixin, {
queryParams: ["forwardRoute"],
session: Ember.inject.service(),
store: Ember.inject.service(),
messageBox: Ember.inject.service(),
Expand Down Expand Up @@ -98,16 +99,30 @@ export default Ember.Controller.extend(AsyncMixin, {
}),

favouriteImage: Ember.computed(
"supportsFavouriteImage",
"record.favouriteImageId",
"[email protected]",
"images.[]",
function() {
if (this.get("supportsFavouriteImage")) {
const id = this.get("record.favouriteImageId");
const im = id && this.get("images").findBy("id", id);

if (im) {
return im;
}
}
return this.get("images").findBy("favourite");
}
),

initPreviewImage: Ember.on(
"init",
Ember.observer("record", "images.[]", function() {
if (this.get("images").includes(this.get("previewImage"))) {
return;
}

var image = this.get("images.firstObject");
if (image) {
this.send("setPreview", image);
Expand Down Expand Up @@ -188,7 +203,11 @@ export default Ember.Controller.extend(AsyncMixin, {

actions: {
done() {
window.history.back();
if (this.get("forwardRoute")) {
this.replaceRoute(this.get("forwardRoute"), this.get("record"));
} else {
window.history.back();
}
},

setPreview(image) {
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/item_types.js

This file was deleted.

32 changes: 0 additions & 32 deletions app/controllers/my_list.js

This file was deleted.

20 changes: 0 additions & 20 deletions app/controllers/offers/receiving.js

This file was deleted.

21 changes: 0 additions & 21 deletions app/controllers/offers/submitted.js

This file was deleted.

9 changes: 6 additions & 3 deletions app/controllers/review_item.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default Ember.Controller.extend({
if (this.get("isItemVanished")) {
if (currentRoute.indexOf("review_item") >= 0) {
this.get("messageBox").alert(this.get("i18n").t("404_error"), () => {
this.transitionToRoute("my_list");
this.transitionToRoute("dashboard");
});
}
}
Expand Down Expand Up @@ -62,7 +62,8 @@ export default Ember.Controller.extend({
}
}
),
canCopyItem: Ember.computed("item", function() {

canCopyItem: Ember.computed("item.state", function() {
const item = this.get("item");
return !item.get("offer").get("isFinished") && item.get("state") != "draft";
}),
Expand Down Expand Up @@ -125,7 +126,9 @@ export default Ember.Controller.extend({

Ember.RSVP.all(promises).then(function() {
loadingView.destroy();
_this.transitionToRoute("item.edit_images", newItem);
_this.transitionToRoute("item.image_editor", newItem, {
queryParams: { forwardRoute: "review_item.accept" }
});
});
});
}
Expand Down
19 changes: 13 additions & 6 deletions app/controllers/review_offer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default Ember.Controller.extend(AsyncTasksMixin, {
offer: Ember.computed.alias("model"),
isStartReviewClicked: false,
i18n: Ember.inject.service(),
offerService: Ember.inject.service(),
messageBox: Ember.inject.service(),
backLinkPath: "",
displayCompleteReviewPopup: false,
Expand Down Expand Up @@ -51,7 +52,7 @@ export default Ember.Controller.extend(AsyncTasksMixin, {
currentPath.indexOf(`offers/${this.get("offer.id")}`) >= 0
) {
this.get("messageBox").alert(this.get("i18n").t("404_error"), () => {
this.transitionToRoute("my_list");
this.transitionToRoute("dashboard");
});
}
}
Expand All @@ -63,11 +64,17 @@ export default Ember.Controller.extend(AsyncTasksMixin, {
},

addItem() {
var draftItemId =
this.get("model.items")
.filterBy("state", "draft")
.get("firstObject.id") || "new";
this.transitionToRoute("item.edit_images", draftItemId);
const offer = this.get("offer");

const task = this.get("offerService")
.addNewItem(offer)
.then(item => {
this.transitionToRoute("item.image_editor", item, {
queryParams: { forwardRoute: "review_item.accept" }
});
});

this.runTask(task, this.ERROR_STRATEGIES.MODAL);
},

startReview() {
Expand Down
16 changes: 8 additions & 8 deletions app/mixins/back_navigator.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import Ember from 'ember';
import Ember from "ember";

export default Ember.Mixin.create({
history: [],

hasHistory: Ember.computed('history.length', function(){
return this.get('history.length') > 1;
hasHistory: Ember.computed("history.length", function() {
return this.get("history.length") > 1;
}),

actions: {
togglePath(path) {
this.get('history').pushObject(this.get('currentPath'));
this.get("history").pushObject(this.get("currentPath"));

if(this.get('target.currentPath') === path) {
if(this.get('hasHistory')){
this.get('history').popObject();
if (this.get("target.currentPath") === path) {
if (this.get("hasHistory")) {
this.get("history").popObject();
window.history.back();
} else {
this.transitionToRoute("my_list");
this.transitionToRoute("dashboard");
}
} else {
this.transitionToRoute(path);
Expand Down
4 changes: 1 addition & 3 deletions app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Router.map(function() {
"item",
{ resetNamespace: true, path: "/items/:item_id" },
function() {
this.route("edit_images");
this.route("image_editor");
}
);

Expand Down Expand Up @@ -102,8 +102,6 @@ Router.map(function() {
);
});

this.route("item_types");
this.route("packages");
this.route("my_notifications");
this.route("search");
this.route("offers_filters");
Expand Down
23 changes: 0 additions & 23 deletions app/routes/authenticate.js

This file was deleted.

9 changes: 9 additions & 0 deletions app/routes/item/image_editor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import AuthorizeRoute from "../authorize";

export default AuthorizeRoute.extend({
controllerName: "image_editor",

renderTemplate() {
this.render("image_editor");
}
});
7 changes: 0 additions & 7 deletions app/routes/item_types.js

This file was deleted.

2 changes: 1 addition & 1 deletion app/routes/review_offer/donor_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default AuthorizeRoute.extend({

afterModel(model) {
if (!model) {
this.transitionTo("my_list.reviewing");
this.transitionTo("dashboard");
}
}
});
Loading

0 comments on commit 066609a

Please sign in to comment.