Skip to content

Commit

Permalink
fix: pin the ember-moment PR to an issue instead of head
Browse files Browse the repository at this point in the history
fix: refactore the document selection

fix: fix the category display in the upload button

fix: url update on ctrl selection
  • Loading branch information
StephanH90 authored and czosel committed Sep 17, 2021
1 parent 7d46c6a commit c329861
Show file tree
Hide file tree
Showing 8 changed files with 396 additions and 352 deletions.
18 changes: 2 additions & 16 deletions addon/components/document-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,33 +150,19 @@ export default class DocumentViewComponent extends Component {
}

@action handleDocumentSelection(selectedDocument, event) {
if (!event.ctrlKey && !event.shiftKey) {
const isNoDocSelected = this.documents.selectedDocuments.length === 0;
if ((!event.ctrlKey && !event.shiftKey) || isNoDocSelected) {
this.documents.clearDocumentSelection();
this.documents.selectDocument(selectedDocument);
this.router.transitionTo({
queryParams: { document: selectedDocument.id },
});
return;
}
if (event.ctrlKey) {
if (this.documents.documentIsSelected(selectedDocument)) {
this.documents.deselectDocument(selectedDocument);
} else {
this.documents.selectDocument(selectedDocument);
}
return;
}
if (event.shiftKey) {
const isNoDocSelected = this.documents.selectedDocuments.length === 0;
if (isNoDocSelected) {
// If we don't have a document selected yet so simply select the clicked document
this.documents.selectDocument(selectedDocument);
this.router.transitionTo({
queryParams: { document: selectedDocument.id },
});
return;
}

const selectedDocIndex = this.fetchedDocuments.indexOf(selectedDocument);
const lastSelectedDocIndex = this.fetchedDocuments.indexOf(
this.documents.selectedDocuments[0]
Expand Down
2 changes: 1 addition & 1 deletion addon/components/drop/item.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<a class="item" href="#" ...attributes>
{{#if has-block}}
{{#if (has-block)}}
{{yield}}
{{else}}
{{@label}}
Expand Down
2 changes: 0 additions & 2 deletions addon/controllers/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ export default class ApplicationController extends Controller {
tags: this.tags,
search: this.search,
activeGroup: this.activeGroup,
// sort: this.sort,
// sortDirection: this.sortDirection,
};

if (this.config && this.config.modelMetaFilters.document) {
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"ember-intl": "^5.5.1",
"ember-localized-model": "^1.0.1",
"ember-modifier": "^2.1.1",
"ember-moment": "stefanpenner/ember-moment#351/head",
"ember-moment": "stefanpenner/ember-moment#89a2c42a7a282bc78127b9a0c623e919df86422e",
"ember-promise-helpers": "^1.0.9",
"ember-simple-set-helper": "^0.1.2",
"ember-truth-helpers": "^2.1.0",
Expand Down Expand Up @@ -109,8 +109,6 @@
"extends": "@adfinis-sygroup/semantic-release-config"
},
"//": {
"ember-moment": "there is a bug in ember-moment. the merge request referenced above fixes this but it has not been merged yet.",
"uikit": "Higher versions break the build. https://github.com/uikit/uikit/issues/4403",
"@babel/parser": "For some reason 7.12.13 fails to transpile TypeScript sources. https://github.com/babel/babel/issues/12745"
"ember-moment": "there is a bug in ember-moment. the merge request referenced above fixes this but it has not been merged yet. (https://github.com/adopted-ember-addons/ember-moment/pull/351)"
}
}
1 change: 0 additions & 1 deletion tests/acceptance/documents-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ module("Acceptance | documents", function (hooks) {
}
);
assert.dom("[data-test-zip-download-text]").includesText("3");
// TODO: Update this test as soon as the backend has been set up
this.assertRequest("GET", "/api/v1/documents/zip/:ids", (request) => {
assert.equal(
request.params.ids,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module("Integration | Component | document-upload-button", function (hooks) {
);
});

test.todo("upload without predefined category", async function (assert) {
test("upload without predefined category", async function (assert) {
const store = this.owner.lookup("service:store");

store.createRecord = sinon.fake();
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/components/drop/item-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module("Integration | Component | drop/item", function (hooks) {
assert.dom(this.element).hasText("test");
});

test.todo("it renders with block", async function (assert) {
test("it renders with block", async function (assert) {
await render(hbs`
<Drop::Item>
test
Expand Down
Loading

0 comments on commit c329861

Please sign in to comment.