Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
2b3a3f26
Commit
2b3a3f26
authored
10 years ago
by
Allen Gilliland
Browse files
Options
Downloads
Patches
Plain Diff
tidy up a couple small things with creating the first org and applying that to the frontend app.
parent
7067ad63
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
resources/frontend_client/app/services.js
+13
-12
13 additions, 12 deletions
resources/frontend_client/app/services.js
resources/frontend_client/app/setup/setup.controllers.js
+5
-2
5 additions, 2 deletions
resources/frontend_client/app/setup/setup.controllers.js
with
18 additions
and
14 deletions
resources/frontend_client/app/services.js
+
13
−
12
View file @
2b3a3f26
...
...
@@ -93,6 +93,19 @@ CorvusServices.factory('AppState', ['$rootScope', '$routeParams', '$q', '$locati
return
deferred
.
promise
;
},
switchOrg
:
function
(
org_slug
)
{
console
.
log
(
'
changing org to ...
'
,
org_slug
);
Organization
.
get_by_slug
({
'
slug
'
:
org_slug
},
function
(
org
)
{
service
.
model
.
currentOrgSlug
=
org
.
slug
;
service
.
model
.
currentOrg
=
org
;
$rootScope
.
$broadcast
(
'
appstate:organization
'
,
service
.
model
.
currentOrg
);
},
function
(
error
)
{
console
.
log
(
'
error getting current org
'
,
error
);
});
},
// This function performs whatever state cleanup and next steps are required when a user tries to access
// something they are not allowed to.
invalidAccess
:
function
(
user
,
url
,
message
)
{
...
...
@@ -130,18 +143,6 @@ CorvusServices.factory('AppState', ['$rootScope', '$routeParams', '$q', '$locati
}
},
switchOrg
:
function
(
org_slug
)
{
console
.
log
(
'
swtiching to...
'
,
org_slug
)
Organization
.
get_by_slug
({
'
slug
'
:
org_slug
},
function
(
org
)
{
service
.
model
.
currentOrg
=
org
;
$rootScope
.
$broadcast
(
'
appstate:organization
'
,
service
.
model
.
currentOrg
);
},
function
(
error
)
{
console
.
log
(
'
error getting current org
'
,
error
);
});
},
routeChangedImpl
:
function
(
event
)
{
// whenever we have a route change (including initial page load) we need to establish some context
...
...
This diff is collapsed.
Click to expand it.
resources/frontend_client/app/setup/setup.controllers.js
+
5
−
2
View file @
2b3a3f26
...
...
@@ -44,9 +44,10 @@ SetupControllers.controller('SetupIntro', ['$scope', '$location', '$timeout', 'i
// now that we should be logged in and our session cookie is established, lets do the rest of the work
// create our first Organization
// TODO - we need some logic to slugify the name specified. can't have spaces, caps, etc.
Organization
.
create
({
'
name
'
:
n
ame
,
'
slug
'
:
n
ame
'
name
'
:
$scope
.
userOrgN
ame
,
'
slug
'
:
$scope
.
userOrgN
ame
},
function
(
org
)
{
console
.
log
(
'
first org created
'
,
org
);
...
...
@@ -184,6 +185,8 @@ SetupControllers.controller('SetupConnection', ['$scope', '$routeParams', '$loca
SetupControllers
.
controller
(
'
SetupData
'
,
[
'
$scope
'
,
'
Metabase
'
,
function
(
$scope
,
Metabase
)
{
$scope
.
$watch
(
'
currentOrg
'
,
function
(
org
)
{
if
(
!
org
)
return
;
Metabase
.
db_list
({
'
orgId
'
:
org
.
id
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment