Add UI/UX polish in prep for merge

* Bring UI/UX inline with recent changes
* Use select components as a stopgap for credential_types and orgs
* Add tabs to permissions view
* Add Organization model
This commit is contained in:
gconsidine
2017-06-16 15:23:18 -04:00
parent 861cfd3e13
commit fa330db9c5
26 changed files with 145 additions and 43 deletions

View File

@@ -128,10 +128,17 @@ function normalizePath (resource) {
return `${version}${resource}/`;
}
function getById (id) {
let item = this.get('results').filter(result => result.id === id);
return item ? item[0] : undefined;
}
function BaseModel (path) {
this.model = {};
this.get = get;
this.normalizePath = normalizePath;
this.getById = getById;
this.request = request;
this.http = {
get: httpGet.bind(this),

View File

@@ -26,18 +26,11 @@ function mergeInputProperties (type) {
});
}
function getById (id) {
let type = this.get('results').filter(type => type.id === id);
return type ? type[0] : undefined;
}
function CredentialTypeModel (method, id) {
BaseModel.call(this, 'credential_types');
this.categorizeByKind = categorizeByKind.bind(this);
this.mergeInputProperties = mergeInputProperties.bind(this);
this.getById = getById.bind(this);
return this.request(method, id)
.then(() => this);

View File

@@ -0,0 +1,18 @@
let BaseModel;
function OrganizationModel (method) {
BaseModel.call(this, 'organizations');
return this.request(method)
.then(() => this);
}
function OrganizationModelLoader (_BaseModel_) {
BaseModel = _BaseModel_;
return OrganizationModel;
}
OrganizationModelLoader.$inject = ['BaseModel'];
export default OrganizationModelLoader;

View File

@@ -2,11 +2,13 @@ import Base from './Base';
import Credential from './Credential';
import CredentialType from './CredentialType';
import Me from './Me';
import Organization from './Organization';
angular
.module('at.lib.models', [])
.service('BaseModel', Base)
.service('CredentialModel', Credential)
.service('CredentialTypeModel', CredentialType)
.service('MeModel', Me);
.service('MeModel', Me)
.service('OrganizationModel', Organization);