Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
b16a0701
Commit
b16a0701
authored
Jun 17, 2020
by
Justin Ho
Committed by
Lukas Eipert
Jul 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Vuex state to integration form
Add state for override and overrideAvailable to disable all form fields
parent
3a79b4e7
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
0 deletions
+44
-0
app/assets/javascripts/integrations/edit/index.js
app/assets/javascripts/integrations/edit/index.js
+2
-0
app/assets/javascripts/integrations/edit/store/actions.js
app/assets/javascripts/integrations/edit/store/actions.js
+6
-0
app/assets/javascripts/integrations/edit/store/getters.js
app/assets/javascripts/integrations/edit/store/getters.js
+2
-0
app/assets/javascripts/integrations/edit/store/index.js
app/assets/javascripts/integrations/edit/store/index.js
+17
-0
app/assets/javascripts/integrations/edit/store/mutation_types.js
...ets/javascripts/integrations/edit/store/mutation_types.js
+2
-0
app/assets/javascripts/integrations/edit/store/mutations.js
app/assets/javascripts/integrations/edit/store/mutations.js
+11
-0
app/assets/javascripts/integrations/edit/store/state.js
app/assets/javascripts/integrations/edit/store/state.js
+4
-0
No files found.
app/assets/javascripts/integrations/edit/index.js
View file @
b16a0701
import
Vue
from
'
vue
'
;
import
{
createStore
}
from
'
./store
'
;
import
{
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
import
IntegrationForm
from
'
./components/integration_form.vue
'
;
...
...
@@ -37,6 +38,7 @@ export default el => {
return
new
Vue
({
el
,
store
:
createStore
(),
render
(
createElement
)
{
return
createElement
(
IntegrationForm
,
{
props
:
{
...
...
app/assets/javascripts/integrations/edit/store/actions.js
0 → 100644
View file @
b16a0701
import
*
as
types
from
'
./mutation_types
'
;
export
const
setOverride
=
({
commit
},
override
)
=>
commit
(
types
.
SET_OVERRIDE
,
override
);
export
const
setOverrideAvailable
=
({
commit
},
overrideAvailable
)
=>
commit
(
types
.
SET_OVERRIDE_AVAILABLE
,
overrideAvailable
);
app/assets/javascripts/integrations/edit/store/getters.js
0 → 100644
View file @
b16a0701
// eslint-disable-next-line import/prefer-default-export
export
const
disableForm
=
state
=>
state
.
overrideAvailable
&&
!
state
.
override
;
app/assets/javascripts/integrations/edit/store/index.js
0 → 100644
View file @
b16a0701
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
*
as
actions
from
'
./actions
'
;
import
*
as
getters
from
'
./getters
'
;
import
mutations
from
'
./mutations
'
;
import
state
from
'
./state
'
;
Vue
.
use
(
Vuex
);
export
const
createStore
=
()
=>
new
Vuex
.
Store
({
actions
,
getters
,
mutations
,
state
,
});
export
default
createStore
();
app/assets/javascripts/integrations/edit/store/mutation_types.js
0 → 100644
View file @
b16a0701
export
const
SET_OVERRIDE
=
'
SET_OVERRIDE
'
;
export
const
SET_OVERRIDE_AVAILABLE
=
'
SET_OVERRIDE_AVAILABLE
'
;
app/assets/javascripts/integrations/edit/store/mutations.js
0 → 100644
View file @
b16a0701
import
*
as
types
from
'
./mutation_types
'
;
export
default
{
[
types
.
SET_OVERRIDE
](
state
,
override
)
{
state
.
override
=
override
;
},
[
types
.
SET_OVERRIDE_AVAILABLE
](
state
,
overrideAvailable
)
{
state
.
overrideAvailable
=
overrideAvailable
;
},
};
app/assets/javascripts/integrations/edit/store/state.js
0 → 100644
View file @
b16a0701
export
default
()
=>
({
override
:
false
,
overrideAvailable
:
true
,
// TODO: Should default to false and be passed from the backend
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment