Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
api-connection
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
frontend
libraries
api-connection
Commits
dc110968
Commit
dc110968
authored
5 years ago
by
Marcel Nellesen
Browse files
Options
Downloads
Patches
Plain Diff
New: connection for Activated Features coscine/issues#672
parent
c0590e7d
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/api-connection.ts
+1
-0
1 addition, 0 deletions
src/api-connection.ts
src/requests/activatedFeatures-api.ts
+86
-0
86 additions, 0 deletions
src/requests/activatedFeatures-api.ts
with
87 additions
and
0 deletions
src/api-connection.ts
+
1
−
0
View file @
dc110968
...
...
@@ -12,6 +12,7 @@ export { DisciplineApi } from './requests/discipline-api';
export
{
LicenseApi
}
from
'
./requests/license-api
'
;
export
{
MetadataApi
}
from
'
./requests/metadata-api
'
;
export
{
SearchApi
}
from
'
./requests/search-api
'
;
export
{
ActivatedFeaturesApi
}
from
'
./requests/activatedFeatures-api
'
;
import
apiConnectionBasic
from
'
./basic/api-connection-basic
'
;
...
...
This diff is collapsed.
Click to expand it.
src/requests/activatedFeatures-api.ts
0 → 100644
+
86
−
0
View file @
dc110968
const
axios
=
require
(
'
axios
'
);
import
apiConnectionBasic
from
'
../basic/api-connection-basic
'
;
function
getActivatedFeaturesApiUrl
()
{
return
(
'
https://
'
+
apiConnectionBasic
.
getHostName
()
+
'
/coscine/api/Coscine.Api.ActivatedFeatures/ActivatedFeatures/
'
);
}
export
class
ActivatedFeaturesApi
{
public
static
listAllFeatures
(
thenHandler
:
any
=
apiConnectionBasic
.
defaultThenHandler
,
catchHandler
:
any
=
apiConnectionBasic
.
defaultOnCatch
)
{
apiConnectionBasic
.
setHeader
();
return
axios
.
get
(
getActivatedFeaturesApiUrl
())
.
then
(
thenHandler
)
.
catch
(
catchHandler
);
}
public
static
listAllFeaturesOfProject
(
projectId
:
any
,
thenHandler
:
any
=
apiConnectionBasic
.
defaultThenHandler
,
catchHandler
:
any
=
apiConnectionBasic
.
defaultOnCatch
)
{
apiConnectionBasic
.
setHeader
();
return
axios
.
get
(
getActivatedFeaturesApiUrl
()
+
projectId
)
.
then
(
thenHandler
)
.
catch
(
catchHandler
);
}
public
static
getActiveFeatures
(
projectId
:
any
,
thenHandler
:
any
=
apiConnectionBasic
.
defaultThenHandler
,
catchHandler
:
any
=
apiConnectionBasic
.
defaultOnCatch
)
{
apiConnectionBasic
.
setHeader
();
return
axios
.
get
(
getActivatedFeaturesApiUrl
()
+
projectId
+
'
/activeFeatures
'
)
.
then
(
thenHandler
)
.
catch
(
catchHandler
);
}
public
static
getInactiveFeatures
(
projectId
:
any
,
thenHandler
:
any
=
apiConnectionBasic
.
defaultThenHandler
,
catchHandler
:
any
=
apiConnectionBasic
.
defaultOnCatch
)
{
apiConnectionBasic
.
setHeader
();
return
axios
.
get
(
getActivatedFeaturesApiUrl
()
+
projectId
+
'
/inactiveFeatures
'
)
.
then
(
thenHandler
)
.
catch
(
catchHandler
);
}
public
static
activateFeature
(
projectId
:
any
,
featureId
:
any
,
thenHandler
:
any
=
apiConnectionBasic
.
defaultThenHandler
,
catchHandler
:
any
=
apiConnectionBasic
.
defaultOnCatch
)
{
apiConnectionBasic
.
setHeader
();
return
axios
.
get
(
getActivatedFeaturesApiUrl
()
+
projectId
+
'
/activateFeature/
'
+
featureId
)
.
then
(
thenHandler
)
.
catch
(
catchHandler
);
}
public
static
deactivateFeature
(
projectId
:
any
,
featureId
:
any
,
thenHandler
:
any
=
apiConnectionBasic
.
defaultThenHandler
,
catchHandler
:
any
=
apiConnectionBasic
.
defaultOnCatch
)
{
apiConnectionBasic
.
setHeader
();
return
axios
.
get
(
getActivatedFeaturesApiUrl
()
+
projectId
+
'
/deactivateFeature/
'
+
featureId
)
.
then
(
thenHandler
)
.
catch
(
catchHandler
);
}
}
This diff is collapsed.
Click to expand it.
CoscineBot
@CoscineBot
mentioned in commit
bb1a50ed
·
5 years ago
mentioned in commit
bb1a50ed
mentioned in commit bb1a50ed93a133b30af01c9577aad85d54bb6c43
Toggle commit list
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