-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updates for transitions, db edits and refreshes in groups pages
frontend/app/ Use injected .router for .transitionTo() instead of this in routes and this.target in controller, in : controllers/ group/edit.js : deleteGroup() and groups.js : selectedServerChanged() routes/group.js : beforeModel(). adapters/application.js : updateRecord() : use attributesToSave instead of snapshot._internalModel._relationshipProxyCache / changedAttributes. components/panel/manage-dataset.js : add : ownedByMe: alias(dataset.owner). datasetChangeGroup() : objectAttributeChanged(this.dataset, groupId), which pushes the change to dataset record Symbol attributesToSave. controllers/ group/edit.js and group.js : get services () is replaced by setting controller owner via setupController(), to enable setup of these values via @service. group.js : alias(model) group. group/edit.js : removeGroupMemberClient() and removeAllGroupMembers() : pass clientGroup object to removeGroupMember() instead of .id groups.js : serverObj() : fall back to primaryServer when server name is not given in queryParams. groups/add.js : addGroup() : pass client object instead of id as clientId. add group/index.js, with removeGroupMember() copied from controllers/groups.js with one change : get server from .model.server and derive apiServers from that, instead of using server = apiServers.lookupServerName(store.name). models/ client-group.js : clientId, groupId, client.js : clientGroups and group.js : clientGroups : specify the belongsTo / hasMany relation inverse field name, instead of null. routes/ group.js : add model(). beforeModel() : record .server instead of .store. group/edit.js and groups.js : setupController = setupControllerModelOwnerTarget serializers/ application.js : normalizeResponse() : add store.name to trace. groups-in.js : normalizeGroupsIn() and groups-in.js : normalizeGroupsOwn() : add param store, used instead of this.store. groups-own.js : normalize() : add debugger statement - seems not used. services/controls.js : apiServerSelectedOrPrimary() : access apiServers.lookupServerName without .get(). group/index.hbs : group-members param group change .group -> .model; pass action param removeGroupMember. utils/data/group.js : getGroups() : groupsPR : pass store to serializer .normalizeGroups{Own,In}() utils/ember-devel.js : add objectAttributeChanged(), setupControllerModelOwnerTarget(). # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # Date: Fri Mar 22 15:26:14 2024 +1100 # # On branch feature/upgradeFrontend # Your branch is ahead of 'origin/feature/upgradeFrontend' by 1 commit. # (use "git push" to publish your local commits) # # Changes to be committed: # modified: frontend/app/adapters/application.js # modified: frontend/app/components/panel/manage-dataset.js # modified: frontend/app/controllers/group.js # modified: frontend/app/controllers/group/edit.js # new file: frontend/app/controllers/group/index.js # modified: frontend/app/controllers/groups.js # modified: frontend/app/controllers/groups/add.js # modified: frontend/app/models/client-group.js # modified: frontend/app/models/client.js # modified: frontend/app/models/group.js # modified: frontend/app/routes/group.js # modified: frontend/app/routes/group/edit.js # modified: frontend/app/routes/groups.js # modified: frontend/app/serializers/application.js # modified: frontend/app/serializers/groups-in.js # modified: frontend/app/serializers/groups-own.js # modified: frontend/app/services/controls.js # deleted: frontend/app/services/store.js # modified: frontend/app/templates/group/index.hbs # modified: frontend/app/utils/data/group.js # modified: frontend/app/utils/ember-devel.js # # Changes not staged for commit: # modified: frontend/app/controllers/group/index.js # # Untracked files: # lb4app/client # lb4app/dnaSequence.0.fasta # lb4app/dnaSequence.1.fasta # lb4app/lb3app/common/index/ # lb4app/tmp/ # package-lock.json #
- Loading branch information
1 parent
4edfb9b
commit d802eb1
Showing
21 changed files
with
239 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import Controller from '@ember/controller'; | ||
import { getOwner } from '@ember/application'; | ||
import { computed, action } from '@ember/object'; | ||
|
||
import { removeGroupMember } from '../../utils/data/group'; | ||
|
||
// ----------------------------------------------------------------------------- | ||
|
||
const dLog = console.debug; | ||
|
||
// ----------------------------------------------------------------------------- | ||
|
||
|
||
/** | ||
* @param model group | ||
*/ | ||
export default class GroupIndexController extends Controller { | ||
|
||
//---------------------------------------------------------------------------- | ||
|
||
// copied from controllers/groups.js | ||
/** | ||
* @param clientGroup is from this.model.groupsIn, via #each in .hbs | ||
*/ | ||
@action | ||
removeGroupMember(clientGroup) { | ||
const | ||
fnName = 'removeGroupMember', | ||
msgName = fnName + 'Msg', | ||
/** model is group */ | ||
server = this.model.server, | ||
apiServers = server.apiServers, | ||
clientGroupId = clientGroup.id; | ||
|
||
this.set(msgName, ''); | ||
let | ||
destroyP = removeGroupMember(apiServers, server, clientGroup, clientGroupId); | ||
destroyP | ||
.then((cg) => { | ||
this.set('selectedClientGroupId', null); | ||
this.send('refreshModel'); | ||
}) | ||
.catch((errorText) => { | ||
this.set(msgName, errorText); | ||
}); | ||
return destroyP; | ||
}; | ||
|
||
//---------------------------------------------------------------------------- | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.