-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ui] Version Tags on the job versions page (#24013)
* Timeline styles and their buttons modernized, and tags added * styled but not yet functional version blocks * Rough pass at edit/unedit UX * Styles consolidated * better UX around version tag crud, plus adapter and serializers * Mirage and acceptance tests * Modify percy to not show time-based things
- Loading branch information
1 parent
deb4b86
commit 30c743d
Showing
14 changed files
with
590 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
// @ts-check | ||
|
||
import ApplicationAdapter from './application'; | ||
import classic from 'ember-classic-decorator'; | ||
|
||
@classic | ||
export default class VersionTagAdapter extends ApplicationAdapter { | ||
urlForCreateRecord(_modelName, model) { | ||
const tagName = model.attr('name'); | ||
const jobName = model.attr('jobName'); | ||
return `${this.buildURL()}/job/${jobName}/versions/${tagName}/tag`; | ||
} | ||
|
||
async deleteTag(jobName, tagName) { | ||
let deletion = this.ajax( | ||
this.urlForDeleteRecord(jobName, tagName), | ||
'DELETE' | ||
); | ||
return deletion; | ||
} | ||
|
||
urlForDeleteRecord(jobName, tagName) { | ||
return `${this.buildURL()}/job/${jobName}/versions/${tagName}/tag`; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
import Fragment from 'ember-data-model-fragments/fragment'; | ||
import { attr } from '@ember-data/model'; | ||
|
||
export default class VersionTagModel extends Fragment { | ||
@attr() name; | ||
@attr() description; | ||
@attr() taggedTime; | ||
@attr('number') versionNumber; | ||
@attr('string') jobName; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Copyright (c) HashiCorp, Inc. | ||
* SPDX-License-Identifier: BUSL-1.1 | ||
*/ | ||
|
||
// @ts-check | ||
import ApplicationSerializer from './application'; | ||
import { inject as service } from '@ember/service'; | ||
|
||
export default class VersionTagSerializer extends ApplicationSerializer { | ||
@service store; | ||
|
||
serialize(snapshot, options) { | ||
const hash = super.serialize(snapshot, options); | ||
hash.Version = hash.VersionNumber; | ||
return hash; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.