2015-02-20 23:15:48 +00:00
( function ( ) {
/ * *
* Interactive tutorial page .
* /
angular . module ( 'quayPages' ) . config ( [ 'pages' , function ( pages ) {
2015-02-23 19:23:54 +00:00
pages . create ( 'tutorial' , 'tutorial.html' , TutorialCtrl , {
2015-04-08 19:19:01 +00:00
'newLayout' : true ,
2015-02-23 19:23:54 +00:00
'title' : 'Tutorial' ,
2015-11-02 19:16:04 +00:00
'description' : 'Basic tutorial on using Quay'
2015-06-29 09:33:00 +00:00
} )
2015-02-20 23:15:48 +00:00
} ] ) ;
2015-06-04 18:15:47 +00:00
function TutorialCtrl ( $scope , AngularTour , AngularTourSignals , UserService , Config , Features ) {
2015-02-20 23:15:48 +00:00
// Default to showing sudo on all commands if on linux.
var showSudo = navigator . appVersion . indexOf ( "Linux" ) != - 1 ;
$scope . tour = {
'title' : Config . REGISTRY _TITLE _SHORT + ' Tutorial' ,
'initialScope' : {
'showSudo' : showSudo ,
'domainName' : Config . getDomain ( )
} ,
'steps' : [
{
'title' : 'Welcome to the ' + Config . REGISTRY _TITLE _SHORT + ' tutorial!' ,
'templateUrl' : '/static/tutorial/welcome.html'
} ,
{
'title' : 'Sign in to get started' ,
'templateUrl' : '/static/tutorial/signup.html' ,
'signal' : function ( $tourScope ) {
var user = UserService . currentUser ( ) ;
$tourScope . username = user . username ;
$tourScope . email = user . email ;
$tourScope . inOrganization = user . organizations && user . organizations . length > 0 ;
return ! user . anonymous ;
}
} ,
{
'title' : 'Step 1: Login to ' + Config . REGISTRY _TITLE ,
'templateUrl' : '/static/tutorial/docker-login.html' ,
'signal' : AngularTourSignals . serverEvent ( '/realtime/user/subscribe?events=docker-cli' ,
function ( message ) {
return message [ 'data' ] [ 'action' ] == 'login' ;
} ) ,
'waitMessage' : "Waiting for docker login" ,
'skipTitle' : "I'm already logged in" ,
'mixpanelEvent' : 'tutorial_start'
} ,
{
'title' : 'Step 2: Create a new container' ,
'templateUrl' : '/static/tutorial/create-container.html'
} ,
{
'title' : 'Step 3: Create a new image' ,
'templateUrl' : '/static/tutorial/create-image.html'
} ,
{
'title' : 'Step 4: Push the image to ' + Config . REGISTRY _TITLE ,
'templateUrl' : '/static/tutorial/push-image.html' ,
'signal' : AngularTourSignals . serverEvent ( '/realtime/user/subscribe?events=docker-cli' ,
function ( message , tourScope ) {
2015-04-03 16:13:33 +00:00
var pushing = message [ 'data' ] [ 'action' ] == 'push_start' ;
2015-02-20 23:15:48 +00:00
if ( pushing ) {
tourScope . repoName = message [ 'data' ] [ 'repository' ] ;
}
return pushing ;
} ) ,
'waitMessage' : "Waiting for repository push to begin" ,
'mixpanelEvent' : 'tutorial_wait_for_push'
} ,
{
'title' : 'Push in progress' ,
'templateUrl' : '/static/tutorial/pushing.html' ,
'signal' : AngularTourSignals . serverEvent ( '/realtime/user/subscribe?events=docker-cli' ,
function ( message , tourScope ) {
2015-04-03 16:13:33 +00:00
return message [ 'data' ] [ 'action' ] == 'push_repo' ;
2015-02-20 23:15:48 +00:00
} ) ,
'waitMessage' : "Waiting for repository push to complete"
} ,
{
'title' : 'Step 5: View the repository on ' + Config . REGISTRY _TITLE ,
'templateUrl' : '/static/tutorial/view-repo.html' ,
'signal' : AngularTourSignals . matchesLocation ( '/repository/' ) ,
'overlayable' : true ,
'mixpanelEvent' : 'tutorial_push_complete'
} ,
{
'templateUrl' : '/static/tutorial/view-repo.html' ,
'signal' : AngularTourSignals . matchesLocation ( '/repository/' ) ,
'overlayable' : true
} ,
{
'templateUrl' : '/static/tutorial/waiting-repo-list.html' ,
'signal' : AngularTourSignals . elementAvaliable ( '*[data-repo="{{username}}/{{repoName}}"]' ) ,
'overlayable' : true
} ,
{
'templateUrl' : '/static/tutorial/repo-list.html' ,
'signal' : AngularTourSignals . matchesLocation ( '/repository/{{username}}/{{repoName}}' ) ,
'element' : '*[data-repo="{{username}}/{{repoName}}"]' ,
'overlayable' : true
} ,
{
'title' : 'Repository View' ,
2015-05-13 18:55:39 +00:00
'content' : 'This is the repository view page. It displays all the primary information about your repository' ,
2015-02-20 23:15:48 +00:00
'overlayable' : true ,
'mixpanelEvent' : 'tutorial_view_repo'
} ,
{
2015-05-13 18:55:39 +00:00
'title' : 'Repository Tags' ,
'content' : 'Click on the tags tab to view all the tags in the repository' ,
'overlayable' : true ,
'element' : '#tagsTab' ,
'signal' : AngularTourSignals . elementVisible ( '*[id="tagsTable"]' )
} ,
{
'title' : 'Tag List' ,
'content' : 'The tag list displays shows the full list of active tags in the repository. ' +
'You can click on an image to see its information or click on a tag to see its history.' ,
'element' : '#tagsTable' ,
2015-02-20 23:15:48 +00:00
'overlayable' : true
} ,
{
2015-05-13 18:55:39 +00:00
'title' : 'Tag Information' ,
'content' : 'Each row displays information about a specific tag' ,
'element' : '#tagsTable tr:first-child' ,
2015-02-20 23:15:48 +00:00
'overlayable' : true
} ,
{
2015-05-13 18:55:39 +00:00
'title' : 'Tag Actions' ,
'content' : 'You can modify a tag by clicking on the Tag Options icon' ,
'element' : '#tagsTable tr:first-child .fa-gear' ,
2015-02-20 23:15:48 +00:00
'overlayable' : true
} ,
{
2015-05-13 18:55:39 +00:00
'title' : 'Tag History' ,
'content' : 'You can view a tags history by clicking on the Tag History icon' ,
'element' : '#tagsTable tr:first-child .fa-history' ,
2015-02-20 23:15:48 +00:00
'overlayable' : true
} ,
{
2015-05-13 18:55:39 +00:00
'title' : 'Fetch Tag' ,
'content' : 'To see the various ways to fetch/pull a tag, click the Fetch Tag icon' ,
'element' : '#tagsTable tr:first-child .fa-download' ,
'overlayable' : true
} ,
{
2015-06-04 18:15:47 +00:00
'content' : 'To view the permissions for a repository, click on the Gear tab' ,
'element' : '#settingsTab' ,
2015-05-13 18:55:39 +00:00
'overlayable' : true ,
'signal' : AngularTourSignals . elementVisible ( '*[id="repoPermissions"]' )
} ,
{
'title' : 'Repository Settings' ,
'content' : "The repository settings tab allows for modification of a repository's permissions, notifications, visibility and other settings" ,
2015-02-20 23:15:48 +00:00
'overlayable' : true ,
'mixpanelEvent' : 'tutorial_view_admin'
} ,
{
'title' : 'Permissions' ,
'templateUrl' : '/static/tutorial/permissions.html' ,
'overlayable' : true ,
2015-05-13 18:55:39 +00:00
'element' : '#repoPermissions'
2015-02-20 23:15:48 +00:00
} ,
{
'title' : 'Adding a permission' ,
'content' : 'To add an <b>additional</b> permission, enter a username or robot account name into the autocomplete ' +
'or hit the dropdown arrow to manage robot accounts' ,
'overlayable' : true ,
'element' : '#add-entity-permission'
} ,
2015-05-13 18:55:39 +00:00
{
'content' : 'Repositories can be automatically populated in response to a Dockerfile build. To view the build settings for a repository, click on the builds tab' ,
'element' : '#buildsTab' ,
'overlayable' : true ,
2015-06-04 18:15:47 +00:00
'signal' : AngularTourSignals . elementVisible ( '*[id="repoBuilds"]' ) ,
'skip' : ! Features . BUILD _SUPPORT
2015-05-13 18:55:39 +00:00
} ,
{
'content' : 'New build triggers can be created by clicking the "Create Build Trigger" button.' ,
'element' : '#addBuildTrigger' ,
2015-06-04 18:15:47 +00:00
'overlayable' : true ,
'skip' : ! Features . BUILD _SUPPORT
2015-05-13 18:55:39 +00:00
} ,
{
'content' : 'The full build history can always be referenced and filtered in the builds list.' ,
'element' : '#repoBuilds' ,
2015-06-04 18:15:47 +00:00
'overlayable' : true ,
'skip' : ! Features . BUILD _SUPPORT
2015-05-13 18:55:39 +00:00
} ,
2015-02-20 23:15:48 +00:00
{
'templateUrl' : '/static/tutorial/done.html' ,
'overlayable' : true ,
'mixpanelEvent' : 'tutorial_complete'
}
]
} ;
}
} ) ( ) ;