-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove jQuery #497
Remove jQuery #497
Conversation
a4ddaa0
to
7d6ec6c
Compare
fa28721
to
ccd0695
Compare
As far as I see the tests are running well on your fork. If this is true, you might well mark this PR as ready for review (hopefully triggering the tasts here as well). |
0c1be68
to
1476b9a
Compare
Codecov Report
@@ Coverage Diff @@
## master #497 +/- ##
========================================
Coverage 0.87% 0.87%
Complexity 436 436
========================================
Files 14 14
Lines 1375 1375
========================================
Hits 12 12
Misses 1363 1363
Flags with carried forward coverage won't be shown. Click here to find out more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not test all cases (especially not all failure cases) as it is quite cumbersome to do so. Looks good in general, a few changes I marked (some are only comments of course).
src/components/RecipeView.vue
Outdated
if ($this.$store.state.recipe.recipeInstructions) { | ||
$this.instructions = Object.values($this.$store.state.recipe.recipeInstructions) | ||
} | ||
|
||
if ($this.$store.state.recipe.keywords) { | ||
$this.keywords = String($this.$store.state.recipe.keywords).split(',') | ||
} | ||
|
||
if ($this.$store.state.recipe.cookTime) { | ||
let cookT = $this.$store.state.recipe.cookTime.match(/PT(\d+?)H(\d+?)M/) | ||
$this.timerCook = { hours: parseInt(cookT[1]), minutes: parseInt(cookT[2]) } | ||
} | ||
|
||
if ($this.$store.state.recipe.prepTime) { | ||
let prepT = $this.$store.state.recipe.prepTime.match(/PT(\d+?)H(\d+?)M/) | ||
$this.timerPrep = { hours: parseInt(prepT[1]), minutes: parseInt(prepT[2]) } | ||
} | ||
|
||
if ($this.$store.state.recipe.totalTime) { | ||
let totalT = $this.$store.state.recipe.totalTime.match(/PT(\d+?)H(\d+?)M/) | ||
$this.timerTotal = { hours: parseInt(totalT[1]), minutes: parseInt(totalT[2]) } | ||
} | ||
|
||
if ($this.$store.state.recipe.tool) { | ||
$this.tools = $this.$store.state.recipe.tool | ||
} | ||
|
||
if ($this.$store.state.recipe.dateCreated) { | ||
let date = $this.parseDateTime($this.$store.state.recipe.dateCreated) | ||
$this.dateCreated = (date != null ? date.format('L, LT').toString() : null) | ||
} | ||
|
||
if ($this.$store.state.recipe.dateModified) { | ||
let date = $this.parseDateTime($this.$store.state.recipe.dateModified) | ||
$this.dateModified = (date != null ? date.format('L, LT').toString() : null) | ||
} | ||
if ($this.$store.state.recipe.nutrition) { | ||
if ( $this.$store.state.recipe.nutrition instanceof Array) { | ||
$this.$store.state.recipe.nutrition = {} | ||
} | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be well suited for a computed property from the recipe data itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. what do you think is better: a recipe object as a computed property or a computed property for each recipe part (ingredients, dateModified, etc.)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume both are similarly useful. Personally, I assume a single property with an object might be simpler to use if we think what might (or might not) be able to extend/abstract the component.
@@ -175,11 +174,11 @@ import AppMain from './components/AppMain' | |||
Vue.prototype.t = window.t | |||
|
|||
// Start the app once document is done loading | |||
$(document).ready(function () { | |||
document.addEventListener("DOMContentLoaded", function(event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unsure if this really needed. It will most probably not cause issues but I found nowhere the requirement documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me neither. We could remove this and try if it still works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see what comes out from my question. I fear it will be more of unstable behavior and less of no function at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’s what I would expect, too. Good idea to ask in the vue forum!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already asked in the Discourse app but there was only an uncertain statement given.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
funny how nobody seems to know
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
…n in app controls Signed-off-by: Sebastian Fey <info@sebastianfey.de>
…n in app index and app navi Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
…dit input group. Fixed pasting content without newline in input group Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Added @nextcloud/auth Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
Signed-off-by: Sebastian Fey <info@sebastianfey.de>
0cfb693
to
57045ea
Compare
As NC is dropping the support for the global jQuery and including the library within our app seems to be a bit of an overkill, I replaced the jQuery ajax calls by @nextcloud/axios and switched to plain JS in some places.
Closes #475