-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update group forms header and footer
Align the header and footer of the group forms more closely with the mocks in https://www.figma.com/design/jon1U01LGSLcx7PWtZ9TPZ/Hypothesis---Group-Management?node-id=2942-1928&node-type=frame&t=NPDV4Y62CUMkfEpq-0. - Add "View group activity" link at the top of the page and remove the "Back to group overview" link from the bottom - Vertically align the page title with the Settings / Members tabs on the right - Add a divider below the title / tabs line, mirroring the one on the bottom of the form
- Loading branch information
1 parent
9bfe5e5
commit fb09be7
Showing
6 changed files
with
110 additions
and
40 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
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
46 changes: 46 additions & 0 deletions
46
h/static/scripts/group-forms/components/test/GroupFormHeader-test.js
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,46 @@ | ||
import { mount } from '@hypothesis/frontend-testing'; | ||
|
||
import GroupFormHeader from '../GroupFormHeader'; | ||
|
||
describe('GroupFormHeader', () => { | ||
const createHeader = (props = {}) => mount(<GroupFormHeader {...props} />); | ||
|
||
const group = { | ||
pubid: 'abc123', | ||
link: 'https://anno.co/groups/abc123', | ||
}; | ||
|
||
const getLink = (wrapper, name) => wrapper.find(`a[data-testid="${name}"]`); | ||
|
||
it('renders title', () => { | ||
const header = createHeader({ title: 'Create a new group' }); | ||
assert.equal(header.find('h1').text(), 'Create a new group'); | ||
}); | ||
|
||
it('does not show activity link or tabs if no group', () => { | ||
const header = createHeader(); | ||
assert.isFalse(getLink(header, 'activity-link').exists()); | ||
assert.isFalse(getLink(header, 'settings-link').exists()); | ||
assert.isFalse(getLink(header, 'members-link').exists()); | ||
}); | ||
|
||
it('renders group activity link and tabs if there is a group', () => { | ||
const header = createHeader({ group }); | ||
|
||
const activityLink = getLink(header, 'activity-link'); | ||
assert.equal(activityLink.prop('href'), group.link); | ||
|
||
const settingsLink = getLink(header, 'settings-link'); | ||
assert.equal(settingsLink.prop('href'), '/groups/abc123/edit'); | ||
|
||
const membersLink = getLink(header, 'members-link'); | ||
assert.equal(membersLink.prop('href'), '/groups/abc123/edit/members'); | ||
}); | ||
|
||
it('does not show tabs if the members flag is disabled', () => { | ||
const header = createHeader({ group, enableMembers: false }); | ||
assert.isTrue(getLink(header, 'activity-link').exists()); | ||
assert.isFalse(getLink(header, 'settings-link').exists()); | ||
assert.isFalse(getLink(header, 'members-link').exists()); | ||
}); | ||
}); |